diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 3632a9fed1e50..9ea90805fb51e 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -82,6 +82,7 @@ import { FunctionExpression, FunctionLikeDeclaration, GetAccessorDeclaration, + getAlwaysStrict, getAssignedExpandoInitializer, getAssignmentDeclarationKind, getAssignmentDeclarationPropertyAccessKind, @@ -108,7 +109,6 @@ import { getSourceFileOfNode, getSourceTextOfNodeFromSourceFile, getSpanOfTokenAtPosition, - getStrictOptionValue, getSymbolNameForPrivateIdentifier, getTextOfIdentifierOrLiteral, getThisContainer, @@ -618,7 +618,7 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void { } function bindInStrictMode(file: SourceFile, opts: CompilerOptions): boolean { - if (getStrictOptionValue(opts, "alwaysStrict") && !file.isDeclarationFile) { + if (getAlwaysStrict(opts) && !file.isDeclarationFile) { // bind in strict mode source files with alwaysStrict option return true; } diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 8a62a51e6f75f..3657d15800a5b 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -899,7 +899,7 @@ const commandOptionsWithoutBuild: CommandLineOption[] = [ showInSimplifiedHelpView: true, category: Diagnostics.Type_Checking, description: Diagnostics.Enable_all_strict_type_checking_options, - defaultValueDescription: false, + defaultValueDescription: true, }, { name: "noImplicitAny", @@ -987,10 +987,9 @@ const commandOptionsWithoutBuild: CommandLineOption[] = [ affectsSourceFile: true, affectsEmit: true, affectsBuildInfo: true, - strictFlag: true, category: Diagnostics.Type_Checking, description: Diagnostics.Ensure_use_strict_is_always_emitted, - defaultValueDescription: Diagnostics.false_unless_strict_is_set, + defaultValueDescription: true, }, // Additional Checks diff --git a/src/compiler/program.ts b/src/compiler/program.ts index b0314dc12e53a..cba6998dd8306 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -4526,6 +4526,9 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro }); checkDeprecations("6.0", "7.0", createDiagnostic, createDeprecatedDiagnostic => { + if (options.alwaysStrict === false) { + createDeprecatedDiagnostic("alwaysStrict", "false", /*useInstead*/ undefined, /*related*/ undefined); + } if (options.target === ScriptTarget.ES5) { createDeprecatedDiagnostic("target", "ES5"); } diff --git a/src/compiler/transformers/module/module.ts b/src/compiler/transformers/module/module.ts index ae0d2a0aaa87c..1c43d18afccc5 100644 --- a/src/compiler/transformers/module/module.ts +++ b/src/compiler/transformers/module/module.ts @@ -41,6 +41,7 @@ import { FunctionDeclaration, FunctionExpression, GeneratedIdentifierFlags, + getAlwaysStrict, getEmitFlags, getEmitModuleKind, getEmitScriptTarget, @@ -55,7 +56,6 @@ import { getNamespaceDeclarationNode, getNodeId, getOriginalNodeId, - getStrictOptionValue, getTextOfIdentifierOrLiteral, hasJSFileExtension, hasJsonModuleEmitEnabled, @@ -277,7 +277,7 @@ export function transformModule(context: TransformationContext): (x: SourceFile startLexicalEnvironment(); const statements: Statement[] = []; - const ensureUseStrict = getStrictOptionValue(compilerOptions, "alwaysStrict") || isExternalModule(currentSourceFile); + const ensureUseStrict = getAlwaysStrict(compilerOptions) || isExternalModule(currentSourceFile); const statementOffset = factory.copyPrologue(node.statements, statements, ensureUseStrict && !isJsonSourceFile(node), topLevelVisitor); if (shouldEmitUnderscoreUnderscoreESModule()) { diff --git a/src/compiler/transformers/module/system.ts b/src/compiler/transformers/module/system.ts index c9fd1645345ca..8a4f01392decb 100644 --- a/src/compiler/transformers/module/system.ts +++ b/src/compiler/transformers/module/system.ts @@ -33,6 +33,7 @@ import { ForOfStatement, ForStatement, FunctionDeclaration, + getAlwaysStrict, getEmitFlags, getExternalHelpersModuleName, getExternalModuleNameLiteral, @@ -40,7 +41,6 @@ import { getNodeId, getOriginalNode, getOriginalNodeId, - getStrictOptionValue, getTextOfIdentifierOrLiteral, hasSyntacticModifier, Identifier, @@ -357,7 +357,7 @@ export function transformSystemModule(context: TransformationContext): (x: Sourc startLexicalEnvironment(); // Add any prologue directives. - const ensureUseStrict = getStrictOptionValue(compilerOptions, "alwaysStrict") || isExternalModule(currentSourceFile); + const ensureUseStrict = getAlwaysStrict(compilerOptions) || isExternalModule(currentSourceFile); const statementOffset = factory.copyPrologue(node.statements, statements, ensureUseStrict, topLevelVisitor); // var __moduleName = context_1 && context_1.id; diff --git a/src/compiler/transformers/ts.ts b/src/compiler/transformers/ts.ts index 5a927a0496ce8..f66568ac169ed 100644 --- a/src/compiler/transformers/ts.ts +++ b/src/compiler/transformers/ts.ts @@ -47,6 +47,7 @@ import { FunctionExpression, FunctionLikeDeclaration, GetAccessorDeclaration, + getAlwaysStrict, getEffectiveBaseTypeNode, getEmitFlags, getEmitModuleKind, @@ -57,7 +58,6 @@ import { getOriginalNode, getParseTreeNode, getProperties, - getStrictOptionValue, getTextOfNode, hasDecorators, hasSyntacticModifier, @@ -836,7 +836,7 @@ export function transformTypeScript(context: TransformationContext): Transformer } function visitSourceFile(node: SourceFile) { - const alwaysStrict = getStrictOptionValue(compilerOptions, "alwaysStrict") && + const alwaysStrict = getAlwaysStrict(compilerOptions) && !(isExternalModule(node) && moduleKind >= ModuleKind.ES2015) && !isJsonSourceFile(node); diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index a0d1c6e75d2c7..809225c090613 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -2132,7 +2132,7 @@ export function isEffectiveStrictModeSourceFile(node: SourceFile, compilerOption return false; } // If `alwaysStrict` is set, then treat the file as strict. - if (getStrictOptionValue(compilerOptions, "alwaysStrict")) { + if (getAlwaysStrict(compilerOptions)) { return true; } // Starting with a "use strict" directive indicates the file is strict. @@ -9212,10 +9212,11 @@ const _computedOptions = createComputedCompilerOptions({ return getStrictOptionValue(compilerOptions, "strictBuiltinIteratorReturn"); }, }, + // Previously a strict-mode flag, but no longer. alwaysStrict: { - dependencies: ["strict"], + dependencies: [], computeValue: compilerOptions => { - return getStrictOptionValue(compilerOptions, "alwaysStrict"); + return compilerOptions.alwaysStrict !== false; }, }, useUnknownInCatchVariables: { @@ -9263,6 +9264,8 @@ export const getAreDeclarationMapsEnabled: (compilerOptions: CompilerOptions) => export const getAllowJSCompilerOption: (compilerOptions: CompilerOptions) => boolean = _computedOptions.allowJs.computeValue; /** @internal */ export const getUseDefineForClassFields: (compilerOptions: CompilerOptions) => boolean = _computedOptions.useDefineForClassFields.computeValue; +/** @internal */ +export const getAlwaysStrict: (compilerOptions: CompilerOptions) => boolean = _computedOptions.alwaysStrict.computeValue; /** @internal */ export function emitModuleKindIsNonNodeESM(moduleKind: ModuleKind): boolean { @@ -9305,12 +9308,11 @@ export type StrictOptionName = | "strictBindCallApply" | "strictPropertyInitialization" | "strictBuiltinIteratorReturn" - | "alwaysStrict" | "useUnknownInCatchVariables"; /** @internal */ export function getStrictOptionValue(compilerOptions: CompilerOptions, flag: StrictOptionName): boolean { - return compilerOptions[flag] === undefined ? !!compilerOptions.strict : !!compilerOptions[flag]; + return compilerOptions[flag] === undefined ? (compilerOptions.strict !== false) : !!compilerOptions[flag]; } /** @internal */ diff --git a/src/testRunner/unittests/tscWatch/programUpdates.ts b/src/testRunner/unittests/tscWatch/programUpdates.ts index f676472804e0c..fed193fbe900c 100644 --- a/src/testRunner/unittests/tscWatch/programUpdates.ts +++ b/src/testRunner/unittests/tscWatch/programUpdates.ts @@ -1600,7 +1600,7 @@ foo().hello`, }, { caption: "Set always strict false", - edit: sys => sys.writeFile(`/user/username/projects/myproject/tsconfig.json`, jsonToReadableText({ compilerOptions: { strict: true, alwaysStrict: false } })), // Avoid changing 'alwaysStrict' or must re-bind + edit: sys => sys.writeFile(`/user/username/projects/myproject/tsconfig.json`, jsonToReadableText({ compilerOptions: { strict: true, alwaysStrict: false, ignoreDeprecations: "6.0" } })), // Avoid changing 'alwaysStrict' or must re-bind timeouts: sys => sys.runQueuedTimeoutCallbacks(), }, { diff --git a/tests/baselines/reference/2dArrays.js b/tests/baselines/reference/2dArrays.js index f05603ad21ff5..61ec7339603c1 100644 --- a/tests/baselines/reference/2dArrays.js +++ b/tests/baselines/reference/2dArrays.js @@ -18,6 +18,7 @@ class Board { } //// [2dArrays.js] +"use strict"; class Cell { } class Ship { diff --git a/tests/baselines/reference/2dArrays.types b/tests/baselines/reference/2dArrays.types index 3ad88ae6b15dc..c46ad07777b57 100644 --- a/tests/baselines/reference/2dArrays.types +++ b/tests/baselines/reference/2dArrays.types @@ -24,14 +24,14 @@ class Board { ships: Ship[] = []; >ships : Ship[] > : ^^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ cells: Cell[] = []; >cells : Cell[] > : ^^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ private allShipsSunk() { >allShipsSunk : () => boolean diff --git a/tests/baselines/reference/AmbientModuleAndAmbientFunctionWithTheSameNameAndCommonRoot.js b/tests/baselines/reference/AmbientModuleAndAmbientFunctionWithTheSameNameAndCommonRoot.js index 266bc0d6c031a..16c3ac1b7ae29 100644 --- a/tests/baselines/reference/AmbientModuleAndAmbientFunctionWithTheSameNameAndCommonRoot.js +++ b/tests/baselines/reference/AmbientModuleAndAmbientFunctionWithTheSameNameAndCommonRoot.js @@ -14,6 +14,7 @@ var cl = Point(); var cl = Point.Origin; //// [test.js] +"use strict"; var cl; var cl = Point(); var cl = Point.Origin; diff --git a/tests/baselines/reference/AmbientModuleAndAmbientWithSameNameAndCommonRoot.js b/tests/baselines/reference/AmbientModuleAndAmbientWithSameNameAndCommonRoot.js index e5cd0192637af..fca530f585d3f 100644 --- a/tests/baselines/reference/AmbientModuleAndAmbientWithSameNameAndCommonRoot.js +++ b/tests/baselines/reference/AmbientModuleAndAmbientWithSameNameAndCommonRoot.js @@ -26,6 +26,7 @@ var p = new A.Point(0, 0); // unexpected error here, bug 840000 //// [test.js] +"use strict"; var p; var p = A.Point.Origin; var p = new A.Point(0, 0); // unexpected error here, bug 840000 diff --git a/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.js b/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.js index 8c2439c14b9d5..19c6187ed2392 100644 --- a/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.js +++ b/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.js @@ -23,6 +23,7 @@ var p = A.Point.Origin; var p = new A.Point(0, 0); // unexpected error here, bug 840000 //// [classPoint.js] +"use strict"; var A; (function (A) { class Point { @@ -34,6 +35,7 @@ var A; A.Point = Point; })(A || (A = {})); //// [test.js] +"use strict"; var p; var p = A.Point.Origin; var p = new A.Point(0, 0); // unexpected error here, bug 840000 diff --git a/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.js b/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.js index b18fd32dae902..187e1c52e202d 100644 --- a/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.js +++ b/tests/baselines/reference/AmbientModuleAndNonAmbientFunctionWithTheSameNameAndCommonRoot.js @@ -16,10 +16,12 @@ var cl = Point(); var cl = Point.Origin; //// [function.js] +"use strict"; function Point() { return { x: 0, y: 0 }; } //// [test.js] +"use strict"; var cl; var cl = Point(); var cl = Point.Origin; diff --git a/tests/baselines/reference/ArrowFunction1.js b/tests/baselines/reference/ArrowFunction1.js index f234409cb52cf..e078c8566f6c9 100644 --- a/tests/baselines/reference/ArrowFunction1.js +++ b/tests/baselines/reference/ArrowFunction1.js @@ -6,5 +6,6 @@ var v = (a: ) => { }; //// [ArrowFunction1.js] +"use strict"; var v = (a) => { }; diff --git a/tests/baselines/reference/ArrowFunction3.js b/tests/baselines/reference/ArrowFunction3.js index eb6b8614e2fec..a2566318b95ce 100644 --- a/tests/baselines/reference/ArrowFunction3.js +++ b/tests/baselines/reference/ArrowFunction3.js @@ -6,6 +6,7 @@ var v = (a): => { }; //// [ArrowFunction3.js] +"use strict"; var v = (a); { } diff --git a/tests/baselines/reference/ArrowFunction4.js b/tests/baselines/reference/ArrowFunction4.js index 309f54c2ef75f..c817fb853adb0 100644 --- a/tests/baselines/reference/ArrowFunction4.js +++ b/tests/baselines/reference/ArrowFunction4.js @@ -6,5 +6,6 @@ var v = (a, b) => { }; //// [ArrowFunction4.js] +"use strict"; var v = (a, b) => { }; diff --git a/tests/baselines/reference/ArrowFunctionExpression1.js b/tests/baselines/reference/ArrowFunctionExpression1.js index 016e1dcf903cf..52615df26a563 100644 --- a/tests/baselines/reference/ArrowFunctionExpression1.js +++ b/tests/baselines/reference/ArrowFunctionExpression1.js @@ -4,4 +4,5 @@ var v = (public x: string) => { }; //// [ArrowFunctionExpression1.js] +"use strict"; var v = (x) => { }; diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.errors.txt b/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.errors.txt index 3f343e8db2c68..af45b2c0c7e80 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.errors.txt +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.errors.txt @@ -1,17 +1,31 @@ +ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(5,5): error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. +ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(6,5): error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor. ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(10,19): error TS2304: Cannot find name 'T'. +ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(15,5): error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. +ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(16,5): error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor. ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(20,12): error TS2304: Cannot find name 'T'. ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(22,23): error TS2304: Cannot find name 'T'. +ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(23,9): error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. +ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(24,9): error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor. +ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(30,5): error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. +ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(31,5): error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor. ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(35,26): error TS2304: Cannot find name 'T'. +ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(40,5): error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. +ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(41,5): error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor. ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(46,15): error TS2304: Cannot find name 'T'. -==== ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts (5 errors) ==== +==== ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts (15 errors) ==== // all expected to be errors class clodule1{ id: string; + ~~ +!!! error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. value: T; + ~~~~~ +!!! error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor. } namespace clodule1 { @@ -23,7 +37,11 @@ ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(46,15): err class clodule2{ id: string; + ~~ +!!! error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. value: T; + ~~~~~ +!!! error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor. } namespace clodule2 { @@ -35,14 +53,22 @@ ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(46,15): err ~ !!! error TS2304: Cannot find name 'T'. id: string; + ~~ +!!! error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. value: U; + ~~~~~ +!!! error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor. } } class clodule3{ id: string; + ~~ +!!! error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. value: T; + ~~~~~ +!!! error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor. } namespace clodule3 { @@ -54,7 +80,11 @@ ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.ts(46,15): err class clodule4{ id: string; + ~~ +!!! error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. value: T; + ~~~~~ +!!! error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor. } namespace clodule4 { diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.js b/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.js index cbf1a04111177..fc0d2714cea3f 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.js @@ -52,6 +52,7 @@ namespace clodule4 { //// [ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.js] +"use strict"; // all expected to be errors class clodule1 { } diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.errors.txt b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.errors.txt index 19aae27496a5c..58a384b3ceab5 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.errors.txt +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.errors.txt @@ -1,11 +1,17 @@ +ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts(2,5): error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. +ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts(3,5): error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor. ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts(5,12): error TS2300: Duplicate identifier 'fn'. ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts(10,21): error TS2300: Duplicate identifier 'fn'. -==== ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts (2 errors) ==== +==== ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts (4 errors) ==== class clodule { id: string; + ~~ +!!! error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. value: T; + ~~~~~ +!!! error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor. static fn(id: U) { } ~~ diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.js b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.js index 1449486288f7f..6cd1feb0fa00c 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.js @@ -18,6 +18,7 @@ namespace clodule { //// [ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.js] +"use strict"; class clodule { static fn(id) { } } diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.errors.txt b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.errors.txt index ac95f1b8897b3..a50e87a8e877a 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.errors.txt +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.errors.txt @@ -1,11 +1,17 @@ +ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts(2,5): error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. +ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts(3,5): error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor. ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts(5,12): error TS2300: Duplicate identifier 'fn'. ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts(10,21): error TS2300: Duplicate identifier 'fn'. -==== ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts (2 errors) ==== +==== ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts (4 errors) ==== class clodule { id: string; + ~~ +!!! error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. value: T; + ~~~~~ +!!! error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor. static fn(id: string) { } ~~ diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.js b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.js index 5298599c30959..4bc5a91b5f4f8 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.js @@ -18,6 +18,7 @@ namespace clodule { //// [ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.js] +"use strict"; class clodule { static fn(id) { } } diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.errors.txt b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.errors.txt index 42c3a1487e0cc..198a58d959bfc 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.errors.txt +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.errors.txt @@ -1,10 +1,16 @@ +ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts(2,5): error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. +ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts(3,5): error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor. ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts(11,24): error TS2341: Property 'sfn' is private and only accessible within class 'clodule'. -==== ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts (1 errors) ==== +==== ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts (3 errors) ==== class clodule { id: string; + ~~ +!!! error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. value: T; + ~~~~~ +!!! error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor. private static sfn(id: string) { return 42; } } diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.js b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.js index 7f11ed4be75de..fcc3dbf334067 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.js @@ -18,6 +18,7 @@ namespace clodule { //// [ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.js] +"use strict"; class clodule { static sfn(id) { return 42; } } diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.js b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.js index 85b02b32043b2..d58704caaeb1b 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.js @@ -25,6 +25,7 @@ namespace A { } //// [ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.js] +"use strict"; class Point { constructor(x, y) { this.x = x; diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.types b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.types index 4b335c14e22b7..c30cc2815a349 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.types +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.types @@ -31,8 +31,8 @@ namespace Point { > : ^^^^^^^^^^^^ export function Origin() { return null; } //expected duplicate identifier error ->Origin : () => any -> : ^^^^^^^^^ +>Origin : () => null +> : ^^^^^^^^^^ } diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.js b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.js index c414c47c7a8af..84a2649c0cd92 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.js @@ -25,6 +25,7 @@ namespace A { } //// [ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.js] +"use strict"; class Point { constructor(x, y) { this.x = x; diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.js b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.js index 84158d29be56c..c14d302e23abd 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.js @@ -25,6 +25,7 @@ namespace A { } //// [ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.js] +"use strict"; class Point { constructor(x, y) { this.x = x; diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.js b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.js index 112ce1d162e11..e9d8287fd91fb 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.js @@ -25,6 +25,7 @@ namespace A { } //// [ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.js] +"use strict"; class Point { constructor(x, y) { this.x = x; diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStringIndexerAndExportedFunctionWithTypeIncompatibleWithIndexer.js b/tests/baselines/reference/ClassAndModuleThatMergeWithStringIndexerAndExportedFunctionWithTypeIncompatibleWithIndexer.js index 3fcff5b439277..6494115308f77 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStringIndexerAndExportedFunctionWithTypeIncompatibleWithIndexer.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStringIndexerAndExportedFunctionWithTypeIncompatibleWithIndexer.js @@ -4,3 +4,4 @@ //// [ClassAndModuleThatMergeWithStringIndexerAndExportedFunctionWithTypeIncompatibleWithIndexer.js] +"use strict"; diff --git a/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.errors.txt b/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.errors.txt index 751142a949b7c..2921d902dcb4c 100644 --- a/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.errors.txt +++ b/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.errors.txt @@ -1,4 +1,5 @@ module.ts(2,22): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. +simple.ts(2,5): error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. ==== class.ts (0 errors) ==== @@ -28,9 +29,11 @@ module.ts(2,22): error TS2433: A namespace declaration cannot be in a different var cl = X.Y.Point.Origin; // error not expected here same as bug 83996 ? -==== simple.ts (0 errors) ==== +==== simple.ts (1 errors) ==== class A { id: string; + ~~ +!!! error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. } namespace A { diff --git a/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.js b/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.js index 6acfa440e20b2..f8741527bc213 100644 --- a/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.js +++ b/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.js @@ -41,6 +41,7 @@ var a: { id: string }; //// [class.js] +"use strict"; var X; (function (X) { var Y; @@ -55,6 +56,7 @@ var X; })(Y = X.Y || (X.Y = {})); })(X || (X = {})); //// [module.js] +"use strict"; var X; (function (X) { var Y; @@ -66,10 +68,12 @@ var X; })(Y = X.Y || (X.Y = {})); })(X || (X = {})); //// [test.js] +"use strict"; //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] +"use strict"; class A { } (function (A) { diff --git a/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRootES6.errors.txt b/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRootES6.errors.txt index 751142a949b7c..2921d902dcb4c 100644 --- a/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRootES6.errors.txt +++ b/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRootES6.errors.txt @@ -1,4 +1,5 @@ module.ts(2,22): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. +simple.ts(2,5): error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. ==== class.ts (0 errors) ==== @@ -28,9 +29,11 @@ module.ts(2,22): error TS2433: A namespace declaration cannot be in a different var cl = X.Y.Point.Origin; // error not expected here same as bug 83996 ? -==== simple.ts (0 errors) ==== +==== simple.ts (1 errors) ==== class A { id: string; + ~~ +!!! error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. } namespace A { diff --git a/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRootES6.js b/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRootES6.js index 8dd5d75bb1fa7..0cc4c767b05f4 100644 --- a/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRootES6.js +++ b/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRootES6.js @@ -41,6 +41,7 @@ var a: { id: string }; //// [class.js] +"use strict"; var X; (function (X) { var Y; @@ -55,6 +56,7 @@ var X; })(Y = X.Y || (X.Y = {})); })(X || (X = {})); //// [module.js] +"use strict"; var X; (function (X) { var Y; @@ -66,10 +68,12 @@ var X; })(Y = X.Y || (X.Y = {})); })(X || (X = {})); //// [test.js] +"use strict"; //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] +"use strict"; class A { } (function (A) { diff --git a/tests/baselines/reference/ClassDeclaration10.js b/tests/baselines/reference/ClassDeclaration10.js index 3cb041d7a5b45..316829b237104 100644 --- a/tests/baselines/reference/ClassDeclaration10.js +++ b/tests/baselines/reference/ClassDeclaration10.js @@ -7,5 +7,6 @@ class C { } //// [ClassDeclaration10.js] +"use strict"; class C { } diff --git a/tests/baselines/reference/ClassDeclaration11.js b/tests/baselines/reference/ClassDeclaration11.js index 2f42f600bf88b..f9794b7519d37 100644 --- a/tests/baselines/reference/ClassDeclaration11.js +++ b/tests/baselines/reference/ClassDeclaration11.js @@ -7,6 +7,7 @@ class C { } //// [ClassDeclaration11.js] +"use strict"; class C { foo() { } } diff --git a/tests/baselines/reference/ClassDeclaration13.js b/tests/baselines/reference/ClassDeclaration13.js index 371e91c0bc865..061f53ef88085 100644 --- a/tests/baselines/reference/ClassDeclaration13.js +++ b/tests/baselines/reference/ClassDeclaration13.js @@ -7,6 +7,7 @@ class C { } //// [ClassDeclaration13.js] +"use strict"; class C { bar() { } } diff --git a/tests/baselines/reference/ClassDeclaration14.js b/tests/baselines/reference/ClassDeclaration14.js index 3b62c34cf23fa..63158ee095999 100644 --- a/tests/baselines/reference/ClassDeclaration14.js +++ b/tests/baselines/reference/ClassDeclaration14.js @@ -7,5 +7,6 @@ class C { } //// [ClassDeclaration14.js] +"use strict"; class C { } diff --git a/tests/baselines/reference/ClassDeclaration15.js b/tests/baselines/reference/ClassDeclaration15.js index f94caa3511ee2..64b359498036a 100644 --- a/tests/baselines/reference/ClassDeclaration15.js +++ b/tests/baselines/reference/ClassDeclaration15.js @@ -7,6 +7,7 @@ class C { } //// [ClassDeclaration15.js] +"use strict"; class C { constructor() { } } diff --git a/tests/baselines/reference/ClassDeclaration21.js b/tests/baselines/reference/ClassDeclaration21.js index 3245fbc09db44..309cc33f3b7d1 100644 --- a/tests/baselines/reference/ClassDeclaration21.js +++ b/tests/baselines/reference/ClassDeclaration21.js @@ -7,6 +7,7 @@ class C { } //// [ClassDeclaration21.js] +"use strict"; class C { 1() { } } diff --git a/tests/baselines/reference/ClassDeclaration22.js b/tests/baselines/reference/ClassDeclaration22.js index 6fffe6f1ecb59..d50f45e250f23 100644 --- a/tests/baselines/reference/ClassDeclaration22.js +++ b/tests/baselines/reference/ClassDeclaration22.js @@ -7,6 +7,7 @@ class C { } //// [ClassDeclaration22.js] +"use strict"; class C { "bar"() { } } diff --git a/tests/baselines/reference/ClassDeclaration24.js b/tests/baselines/reference/ClassDeclaration24.js index 52b44e71162a2..b383845873a8c 100644 --- a/tests/baselines/reference/ClassDeclaration24.js +++ b/tests/baselines/reference/ClassDeclaration24.js @@ -5,5 +5,6 @@ class any { } //// [ClassDeclaration24.js] +"use strict"; class any { } diff --git a/tests/baselines/reference/ClassDeclaration25.js b/tests/baselines/reference/ClassDeclaration25.js index 3edb98403adb8..76c6cc75736ae 100644 --- a/tests/baselines/reference/ClassDeclaration25.js +++ b/tests/baselines/reference/ClassDeclaration25.js @@ -12,5 +12,6 @@ class List implements IList { //// [ClassDeclaration25.js] +"use strict"; class List { } diff --git a/tests/baselines/reference/ClassDeclaration26.js b/tests/baselines/reference/ClassDeclaration26.js index ef0394713d52a..8506fb52e1f2a 100644 --- a/tests/baselines/reference/ClassDeclaration26.js +++ b/tests/baselines/reference/ClassDeclaration26.js @@ -8,6 +8,7 @@ class C { } //// [ClassDeclaration26.js] +"use strict"; class C { constructor() { this.foo = 10; diff --git a/tests/baselines/reference/ClassDeclaration8.js b/tests/baselines/reference/ClassDeclaration8.js index d8856c8acee9a..a08e243efd783 100644 --- a/tests/baselines/reference/ClassDeclaration8.js +++ b/tests/baselines/reference/ClassDeclaration8.js @@ -6,5 +6,6 @@ class C { } //// [ClassDeclaration8.js] +"use strict"; class C { } diff --git a/tests/baselines/reference/ClassDeclaration9.js b/tests/baselines/reference/ClassDeclaration9.js index da185fe963361..7859100b1d7bc 100644 --- a/tests/baselines/reference/ClassDeclaration9.js +++ b/tests/baselines/reference/ClassDeclaration9.js @@ -6,5 +6,6 @@ class C { } //// [ClassDeclaration9.js] +"use strict"; class C { } diff --git a/tests/baselines/reference/ClassDeclarationWithInvalidConstOnPropertyDeclaration.js b/tests/baselines/reference/ClassDeclarationWithInvalidConstOnPropertyDeclaration.js index 77788ce8d6f92..b2907020b51a6 100644 --- a/tests/baselines/reference/ClassDeclarationWithInvalidConstOnPropertyDeclaration.js +++ b/tests/baselines/reference/ClassDeclarationWithInvalidConstOnPropertyDeclaration.js @@ -6,6 +6,7 @@ class AtomicNumbers { } //// [ClassDeclarationWithInvalidConstOnPropertyDeclaration.js] +"use strict"; class AtomicNumbers { } AtomicNumbers.H = 1; diff --git a/tests/baselines/reference/ClassDeclarationWithInvalidConstOnPropertyDeclaration2.js b/tests/baselines/reference/ClassDeclarationWithInvalidConstOnPropertyDeclaration2.js index 40df79ce06b4e..426db23ee92d0 100644 --- a/tests/baselines/reference/ClassDeclarationWithInvalidConstOnPropertyDeclaration2.js +++ b/tests/baselines/reference/ClassDeclarationWithInvalidConstOnPropertyDeclaration2.js @@ -7,6 +7,7 @@ class C { } //// [ClassDeclarationWithInvalidConstOnPropertyDeclaration2.js] +"use strict"; class C { constructor() { this.x = 10; diff --git a/tests/baselines/reference/ES3For-ofTypeCheck1(target=es2015).js b/tests/baselines/reference/ES3For-ofTypeCheck1(target=es2015).js index af8e5ba01d848..26dba28761da2 100644 --- a/tests/baselines/reference/ES3For-ofTypeCheck1(target=es2015).js +++ b/tests/baselines/reference/ES3For-ofTypeCheck1(target=es2015).js @@ -4,4 +4,5 @@ for (var v of "") { } //// [ES3For-ofTypeCheck1.js] +"use strict"; for (var v of "") { } diff --git a/tests/baselines/reference/ES3For-ofTypeCheck1(target=es5).js b/tests/baselines/reference/ES3For-ofTypeCheck1(target=es5).js index 7c119c66deddb..85f303f8a90e5 100644 --- a/tests/baselines/reference/ES3For-ofTypeCheck1(target=es5).js +++ b/tests/baselines/reference/ES3For-ofTypeCheck1(target=es5).js @@ -4,6 +4,7 @@ for (var v of "") { } //// [ES3For-ofTypeCheck1.js] +"use strict"; for (var _i = 0, _a = ""; _i < _a.length; _i++) { var v = _a[_i]; } diff --git a/tests/baselines/reference/ES3For-ofTypeCheck2(target=es2015).js b/tests/baselines/reference/ES3For-ofTypeCheck2(target=es2015).js index abc5b98801ce6..1f27c677dfaa9 100644 --- a/tests/baselines/reference/ES3For-ofTypeCheck2(target=es2015).js +++ b/tests/baselines/reference/ES3For-ofTypeCheck2(target=es2015).js @@ -4,4 +4,5 @@ for (var v of [true]) { } //// [ES3For-ofTypeCheck2.js] +"use strict"; for (var v of [true]) { } diff --git a/tests/baselines/reference/ES3For-ofTypeCheck2(target=es5).js b/tests/baselines/reference/ES3For-ofTypeCheck2(target=es5).js index 2e0aab3481f1c..ba2cf70aceb7c 100644 --- a/tests/baselines/reference/ES3For-ofTypeCheck2(target=es5).js +++ b/tests/baselines/reference/ES3For-ofTypeCheck2(target=es5).js @@ -4,6 +4,7 @@ for (var v of [true]) { } //// [ES3For-ofTypeCheck2.js] +"use strict"; for (var _i = 0, _a = [true]; _i < _a.length; _i++) { var v = _a[_i]; } diff --git a/tests/baselines/reference/ES3For-ofTypeCheck4(target=es2015).errors.txt b/tests/baselines/reference/ES3For-ofTypeCheck4(target=es2015).errors.txt new file mode 100644 index 0000000000000..eacac19ff1cfc --- /dev/null +++ b/tests/baselines/reference/ES3For-ofTypeCheck4(target=es2015).errors.txt @@ -0,0 +1,8 @@ +ES3For-ofTypeCheck4.ts(2,17): error TS2454: Variable 'union' is used before being assigned. + + +==== ES3For-ofTypeCheck4.ts (1 errors) ==== + var union: string | string[]; + for (const v of union) { } + ~~~~~ +!!! error TS2454: Variable 'union' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/ES3For-ofTypeCheck4(target=es2015).js b/tests/baselines/reference/ES3For-ofTypeCheck4(target=es2015).js index 031efba7fe0f8..8fc824cccbd8e 100644 --- a/tests/baselines/reference/ES3For-ofTypeCheck4(target=es2015).js +++ b/tests/baselines/reference/ES3For-ofTypeCheck4(target=es2015).js @@ -5,5 +5,6 @@ var union: string | string[]; for (const v of union) { } //// [ES3For-ofTypeCheck4.js] +"use strict"; var union; for (const v of union) { } diff --git a/tests/baselines/reference/ES3For-ofTypeCheck4(target=es5).errors.txt b/tests/baselines/reference/ES3For-ofTypeCheck4(target=es5).errors.txt index 875b8bc5183ab..fdb508cae83f7 100644 --- a/tests/baselines/reference/ES3For-ofTypeCheck4(target=es5).errors.txt +++ b/tests/baselines/reference/ES3For-ofTypeCheck4(target=es5).errors.txt @@ -1,7 +1,10 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +ES3For-ofTypeCheck4.ts(2,17): error TS2454: Variable 'union' is used before being assigned. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== ES3For-ofTypeCheck4.ts (0 errors) ==== +==== ES3For-ofTypeCheck4.ts (1 errors) ==== var union: string | string[]; - for (const v of union) { } \ No newline at end of file + for (const v of union) { } + ~~~~~ +!!! error TS2454: Variable 'union' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/ES3For-ofTypeCheck4(target=es5).js b/tests/baselines/reference/ES3For-ofTypeCheck4(target=es5).js index 30b042c3c77ef..02a258fd770cf 100644 --- a/tests/baselines/reference/ES3For-ofTypeCheck4(target=es5).js +++ b/tests/baselines/reference/ES3For-ofTypeCheck4(target=es5).js @@ -5,6 +5,7 @@ var union: string | string[]; for (const v of union) { } //// [ES3For-ofTypeCheck4.js] +"use strict"; var union; for (var _i = 0, union_1 = union; _i < union_1.length; _i++) { var v = union_1[_i]; diff --git a/tests/baselines/reference/ES3For-ofTypeCheck6(target=es2015).errors.txt b/tests/baselines/reference/ES3For-ofTypeCheck6(target=es2015).errors.txt new file mode 100644 index 0000000000000..921c1cc13bb9c --- /dev/null +++ b/tests/baselines/reference/ES3For-ofTypeCheck6(target=es2015).errors.txt @@ -0,0 +1,8 @@ +ES3For-ofTypeCheck6.ts(2,15): error TS2454: Variable 'union' is used before being assigned. + + +==== ES3For-ofTypeCheck6.ts (1 errors) ==== + var union: string[] | number[]; + for (var v of union) { } + ~~~~~ +!!! error TS2454: Variable 'union' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/ES3For-ofTypeCheck6(target=es2015).js b/tests/baselines/reference/ES3For-ofTypeCheck6(target=es2015).js index 7ca31e97bae2e..3d8fe17723145 100644 --- a/tests/baselines/reference/ES3For-ofTypeCheck6(target=es2015).js +++ b/tests/baselines/reference/ES3For-ofTypeCheck6(target=es2015).js @@ -5,5 +5,6 @@ var union: string[] | number[]; for (var v of union) { } //// [ES3For-ofTypeCheck6.js] +"use strict"; var union; for (var v of union) { } diff --git a/tests/baselines/reference/ES3For-ofTypeCheck6(target=es5).errors.txt b/tests/baselines/reference/ES3For-ofTypeCheck6(target=es5).errors.txt index d1d44ab630a64..b2dfd71bc2d57 100644 --- a/tests/baselines/reference/ES3For-ofTypeCheck6(target=es5).errors.txt +++ b/tests/baselines/reference/ES3For-ofTypeCheck6(target=es5).errors.txt @@ -1,7 +1,10 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +ES3For-ofTypeCheck6.ts(2,15): error TS2454: Variable 'union' is used before being assigned. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== ES3For-ofTypeCheck6.ts (0 errors) ==== +==== ES3For-ofTypeCheck6.ts (1 errors) ==== var union: string[] | number[]; - for (var v of union) { } \ No newline at end of file + for (var v of union) { } + ~~~~~ +!!! error TS2454: Variable 'union' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/ES3For-ofTypeCheck6(target=es5).js b/tests/baselines/reference/ES3For-ofTypeCheck6(target=es5).js index ba5a4971ba36b..dd75ed916d55d 100644 --- a/tests/baselines/reference/ES3For-ofTypeCheck6(target=es5).js +++ b/tests/baselines/reference/ES3For-ofTypeCheck6(target=es5).js @@ -5,6 +5,7 @@ var union: string[] | number[]; for (var v of union) { } //// [ES3For-ofTypeCheck6.js] +"use strict"; var union; for (var _i = 0, union_1 = union; _i < union_1.length; _i++) { var v = union_1[_i]; diff --git a/tests/baselines/reference/ES5For-of1(target=es2015).js b/tests/baselines/reference/ES5For-of1(target=es2015).js index 3ee566049805d..6b21273cd3b87 100644 --- a/tests/baselines/reference/ES5For-of1(target=es2015).js +++ b/tests/baselines/reference/ES5For-of1(target=es2015).js @@ -6,6 +6,7 @@ for (var v of ['a', 'b', 'c']) { } //// [ES5For-of1.js] +"use strict"; for (var v of ['a', 'b', 'c']) { console.log(v); } diff --git a/tests/baselines/reference/ES5For-of1(target=es2015).js.map b/tests/baselines/reference/ES5For-of1(target=es2015).js.map index e486811b4b7e9..c8013f1f5f499 100644 --- a/tests/baselines/reference/ES5For-of1(target=es2015).js.map +++ b/tests/baselines/reference/ES5For-of1(target=es2015).js.map @@ -1,3 +1,3 @@ //// [ES5For-of1.js.map] -{"version":3,"file":"ES5For-of1.js","sourceRoot":"","sources":["ES5For-of1.ts"],"names":[],"mappings":"AAAA,KAAK,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IAC5B,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACnB,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,Zm9yICh2YXIgdiBvZiBbJ2EnLCAnYicsICdjJ10pIHsNCiAgICBjb25zb2xlLmxvZyh2KTsNCn0NCi8vIyBzb3VyY2VNYXBwaW5nVVJMPUVTNUZvci1vZjEuanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIkVTNUZvci1vZjEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsS0FBSyxJQUFJLENBQUMsSUFBSSxDQUFDLEdBQUcsRUFBRSxHQUFHLEVBQUUsR0FBRyxDQUFDLEVBQUUsQ0FBQztJQUM1QixPQUFPLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ25CLENBQUMifQ==,Zm9yICh2YXIgdiBvZiBbJ2EnLCAnYicsICdjJ10pIHsKICAgIGNvbnNvbGUubG9nKHYpOwp9 +{"version":3,"file":"ES5For-of1.js","sourceRoot":"","sources":["ES5For-of1.ts"],"names":[],"mappings":";AAAA,KAAK,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IAC5B,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACnB,CAAC"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KZm9yICh2YXIgdiBvZiBbJ2EnLCAnYicsICdjJ10pIHsNCiAgICBjb25zb2xlLmxvZyh2KTsNCn0NCi8vIyBzb3VyY2VNYXBwaW5nVVJMPUVTNUZvci1vZjEuanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIkVTNUZvci1vZjEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLEtBQUssSUFBSSxDQUFDLElBQUksQ0FBQyxHQUFHLEVBQUUsR0FBRyxFQUFFLEdBQUcsQ0FBQyxFQUFFLENBQUM7SUFDNUIsT0FBTyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNuQixDQUFDIn0=,Zm9yICh2YXIgdiBvZiBbJ2EnLCAnYicsICdjJ10pIHsKICAgIGNvbnNvbGUubG9nKHYpOwp9 diff --git a/tests/baselines/reference/ES5For-of1(target=es2015).sourcemap.txt b/tests/baselines/reference/ES5For-of1(target=es2015).sourcemap.txt index 176f6b2207986..87a30faf253a8 100644 --- a/tests/baselines/reference/ES5For-of1(target=es2015).sourcemap.txt +++ b/tests/baselines/reference/ES5For-of1(target=es2015).sourcemap.txt @@ -8,6 +8,7 @@ sources: ES5For-of1.ts emittedFile:ES5For-of1.js sourceFile:ES5For-of1.ts ------------------------------------------------------------------- +>>>"use strict"; >>>for (var v of ['a', 'b', 'c']) { 1 > 2 >^^^^^ @@ -37,20 +38,20 @@ sourceFile:ES5For-of1.ts 12> ] 13> ) 14> { -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) -7 >Emitted(1, 19) Source(1, 19) + SourceIndex(0) -8 >Emitted(1, 21) Source(1, 21) + SourceIndex(0) -9 >Emitted(1, 24) Source(1, 24) + SourceIndex(0) -10>Emitted(1, 26) Source(1, 26) + SourceIndex(0) -11>Emitted(1, 29) Source(1, 29) + SourceIndex(0) -12>Emitted(1, 30) Source(1, 30) + SourceIndex(0) -13>Emitted(1, 32) Source(1, 32) + SourceIndex(0) -14>Emitted(1, 33) Source(1, 33) + SourceIndex(0) +1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 6) Source(1, 6) + SourceIndex(0) +3 >Emitted(2, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(2, 11) Source(1, 11) + SourceIndex(0) +5 >Emitted(2, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(2, 16) Source(1, 16) + SourceIndex(0) +7 >Emitted(2, 19) Source(1, 19) + SourceIndex(0) +8 >Emitted(2, 21) Source(1, 21) + SourceIndex(0) +9 >Emitted(2, 24) Source(1, 24) + SourceIndex(0) +10>Emitted(2, 26) Source(1, 26) + SourceIndex(0) +11>Emitted(2, 29) Source(1, 29) + SourceIndex(0) +12>Emitted(2, 30) Source(1, 30) + SourceIndex(0) +13>Emitted(2, 32) Source(1, 32) + SourceIndex(0) +14>Emitted(2, 33) Source(1, 33) + SourceIndex(0) --- >>> console.log(v); 1 >^^^^ @@ -70,14 +71,14 @@ sourceFile:ES5For-of1.ts 6 > v 7 > ) 8 > ; -1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -2 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -3 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) -4 >Emitted(2, 16) Source(2, 16) + SourceIndex(0) -5 >Emitted(2, 17) Source(2, 17) + SourceIndex(0) -6 >Emitted(2, 18) Source(2, 18) + SourceIndex(0) -7 >Emitted(2, 19) Source(2, 19) + SourceIndex(0) -8 >Emitted(2, 20) Source(2, 20) + SourceIndex(0) +1 >Emitted(3, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(3, 12) Source(2, 12) + SourceIndex(0) +3 >Emitted(3, 13) Source(2, 13) + SourceIndex(0) +4 >Emitted(3, 16) Source(2, 16) + SourceIndex(0) +5 >Emitted(3, 17) Source(2, 17) + SourceIndex(0) +6 >Emitted(3, 18) Source(2, 18) + SourceIndex(0) +7 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) +8 >Emitted(3, 20) Source(2, 20) + SourceIndex(0) --- >>>} 1 > @@ -86,7 +87,7 @@ sourceFile:ES5For-of1.ts 1 > > 2 >} -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 2) Source(3, 2) + SourceIndex(0) +1 >Emitted(4, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(4, 2) Source(3, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=ES5For-of1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of1(target=es5).js b/tests/baselines/reference/ES5For-of1(target=es5).js index 41d9072a7ae68..e61054a0894cc 100644 --- a/tests/baselines/reference/ES5For-of1(target=es5).js +++ b/tests/baselines/reference/ES5For-of1(target=es5).js @@ -6,6 +6,7 @@ for (var v of ['a', 'b', 'c']) { } //// [ES5For-of1.js] +"use strict"; for (var _i = 0, _a = ['a', 'b', 'c']; _i < _a.length; _i++) { var v = _a[_i]; console.log(v); diff --git a/tests/baselines/reference/ES5For-of1(target=es5).js.map b/tests/baselines/reference/ES5For-of1(target=es5).js.map index 983cd686fbb88..da1714ebda575 100644 --- a/tests/baselines/reference/ES5For-of1(target=es5).js.map +++ b/tests/baselines/reference/ES5For-of1(target=es5).js.map @@ -1,3 +1,3 @@ //// [ES5For-of1.js.map] -{"version":3,"file":"ES5For-of1.js","sourceRoot":"","sources":["ES5For-of1.ts"],"names":[],"mappings":"AAAA,KAAc,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAf,cAAe,EAAf,IAAe,EAAE,CAAC;IAA3B,IAAI,CAAC,SAAA;IACN,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACnB,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,Zm9yICh2YXIgX2kgPSAwLCBfYSA9IFsnYScsICdiJywgJ2MnXTsgX2kgPCBfYS5sZW5ndGg7IF9pKyspIHsNCiAgICB2YXIgdiA9IF9hW19pXTsNCiAgICBjb25zb2xlLmxvZyh2KTsNCn0NCi8vIyBzb3VyY2VNYXBwaW5nVVJMPUVTNUZvci1vZjEuanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIkVTNUZvci1vZjEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsS0FBYyxVQUFlLEVBQWYsTUFBQyxHQUFHLEVBQUUsR0FBRyxFQUFFLEdBQUcsQ0FBQyxFQUFmLGNBQWUsRUFBZixJQUFlLEVBQUUsQ0FBQztJQUEzQixJQUFJLENBQUMsU0FBQTtJQUNOLE9BQU8sQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDbkIsQ0FBQyJ9,Zm9yICh2YXIgdiBvZiBbJ2EnLCAnYicsICdjJ10pIHsKICAgIGNvbnNvbGUubG9nKHYpOwp9 +{"version":3,"file":"ES5For-of1.js","sourceRoot":"","sources":["ES5For-of1.ts"],"names":[],"mappings":";AAAA,KAAc,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAf,cAAe,EAAf,IAAe,EAAE,CAAC;IAA3B,IAAI,CAAC,SAAA;IACN,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACnB,CAAC"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KZm9yICh2YXIgX2kgPSAwLCBfYSA9IFsnYScsICdiJywgJ2MnXTsgX2kgPCBfYS5sZW5ndGg7IF9pKyspIHsNCiAgICB2YXIgdiA9IF9hW19pXTsNCiAgICBjb25zb2xlLmxvZyh2KTsNCn0NCi8vIyBzb3VyY2VNYXBwaW5nVVJMPUVTNUZvci1vZjEuanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIkVTNUZvci1vZjEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLEtBQWMsVUFBZSxFQUFmLE1BQUMsR0FBRyxFQUFFLEdBQUcsRUFBRSxHQUFHLENBQUMsRUFBZixjQUFlLEVBQWYsSUFBZSxFQUFFLENBQUM7SUFBM0IsSUFBSSxDQUFDLFNBQUE7SUFDTixPQUFPLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ25CLENBQUMifQ==,Zm9yICh2YXIgdiBvZiBbJ2EnLCAnYicsICdjJ10pIHsKICAgIGNvbnNvbGUubG9nKHYpOwp9 diff --git a/tests/baselines/reference/ES5For-of1(target=es5).sourcemap.txt b/tests/baselines/reference/ES5For-of1(target=es5).sourcemap.txt index 3ac3f01bea663..0c95684bbd9dc 100644 --- a/tests/baselines/reference/ES5For-of1(target=es5).sourcemap.txt +++ b/tests/baselines/reference/ES5For-of1(target=es5).sourcemap.txt @@ -8,6 +8,7 @@ sources: ES5For-of1.ts emittedFile:ES5For-of1.js sourceFile:ES5For-of1.ts ------------------------------------------------------------------- +>>>"use strict"; >>>for (var _i = 0, _a = ['a', 'b', 'c']; _i < _a.length; _i++) { 1 > 2 >^^^^^ @@ -43,23 +44,23 @@ sourceFile:ES5For-of1.ts 15> ['a', 'b', 'c'] 16> ) 17> { -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 6) Source(1, 15) + SourceIndex(0) -3 >Emitted(1, 16) Source(1, 30) + SourceIndex(0) -4 >Emitted(1, 18) Source(1, 15) + SourceIndex(0) -5 >Emitted(1, 24) Source(1, 16) + SourceIndex(0) -6 >Emitted(1, 27) Source(1, 19) + SourceIndex(0) -7 >Emitted(1, 29) Source(1, 21) + SourceIndex(0) -8 >Emitted(1, 32) Source(1, 24) + SourceIndex(0) -9 >Emitted(1, 34) Source(1, 26) + SourceIndex(0) -10>Emitted(1, 37) Source(1, 29) + SourceIndex(0) -11>Emitted(1, 38) Source(1, 30) + SourceIndex(0) -12>Emitted(1, 40) Source(1, 15) + SourceIndex(0) -13>Emitted(1, 54) Source(1, 30) + SourceIndex(0) -14>Emitted(1, 56) Source(1, 15) + SourceIndex(0) -15>Emitted(1, 60) Source(1, 30) + SourceIndex(0) -16>Emitted(1, 62) Source(1, 32) + SourceIndex(0) -17>Emitted(1, 63) Source(1, 33) + SourceIndex(0) +1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 6) Source(1, 15) + SourceIndex(0) +3 >Emitted(2, 16) Source(1, 30) + SourceIndex(0) +4 >Emitted(2, 18) Source(1, 15) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 16) + SourceIndex(0) +6 >Emitted(2, 27) Source(1, 19) + SourceIndex(0) +7 >Emitted(2, 29) Source(1, 21) + SourceIndex(0) +8 >Emitted(2, 32) Source(1, 24) + SourceIndex(0) +9 >Emitted(2, 34) Source(1, 26) + SourceIndex(0) +10>Emitted(2, 37) Source(1, 29) + SourceIndex(0) +11>Emitted(2, 38) Source(1, 30) + SourceIndex(0) +12>Emitted(2, 40) Source(1, 15) + SourceIndex(0) +13>Emitted(2, 54) Source(1, 30) + SourceIndex(0) +14>Emitted(2, 56) Source(1, 15) + SourceIndex(0) +15>Emitted(2, 60) Source(1, 30) + SourceIndex(0) +16>Emitted(2, 62) Source(1, 32) + SourceIndex(0) +17>Emitted(2, 63) Source(1, 33) + SourceIndex(0) --- >>> var v = _a[_i]; 1 >^^^^ @@ -71,10 +72,10 @@ sourceFile:ES5For-of1.ts 2 > var 3 > v 4 > -1 >Emitted(2, 5) Source(1, 6) + SourceIndex(0) -2 >Emitted(2, 9) Source(1, 10) + SourceIndex(0) -3 >Emitted(2, 10) Source(1, 11) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 11) + SourceIndex(0) +1 >Emitted(3, 5) Source(1, 6) + SourceIndex(0) +2 >Emitted(3, 9) Source(1, 10) + SourceIndex(0) +3 >Emitted(3, 10) Source(1, 11) + SourceIndex(0) +4 >Emitted(3, 19) Source(1, 11) + SourceIndex(0) --- >>> console.log(v); 1->^^^^ @@ -94,14 +95,14 @@ sourceFile:ES5For-of1.ts 6 > v 7 > ) 8 > ; -1->Emitted(3, 5) Source(2, 5) + SourceIndex(0) -2 >Emitted(3, 12) Source(2, 12) + SourceIndex(0) -3 >Emitted(3, 13) Source(2, 13) + SourceIndex(0) -4 >Emitted(3, 16) Source(2, 16) + SourceIndex(0) -5 >Emitted(3, 17) Source(2, 17) + SourceIndex(0) -6 >Emitted(3, 18) Source(2, 18) + SourceIndex(0) -7 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) -8 >Emitted(3, 20) Source(2, 20) + SourceIndex(0) +1->Emitted(4, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(4, 12) Source(2, 12) + SourceIndex(0) +3 >Emitted(4, 13) Source(2, 13) + SourceIndex(0) +4 >Emitted(4, 16) Source(2, 16) + SourceIndex(0) +5 >Emitted(4, 17) Source(2, 17) + SourceIndex(0) +6 >Emitted(4, 18) Source(2, 18) + SourceIndex(0) +7 >Emitted(4, 19) Source(2, 19) + SourceIndex(0) +8 >Emitted(4, 20) Source(2, 20) + SourceIndex(0) --- >>>} 1 > @@ -110,7 +111,7 @@ sourceFile:ES5For-of1.ts 1 > > 2 >} -1 >Emitted(4, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(4, 2) Source(3, 2) + SourceIndex(0) +1 >Emitted(5, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(5, 2) Source(3, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=ES5For-of1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of10(target=es2015).js b/tests/baselines/reference/ES5For-of10(target=es2015).js index 09bda2be87df8..9d0da1eab63c7 100644 --- a/tests/baselines/reference/ES5For-of10(target=es2015).js +++ b/tests/baselines/reference/ES5For-of10(target=es2015).js @@ -10,6 +10,7 @@ for (foo().x of []) { } //// [ES5For-of10.js] +"use strict"; function foo() { return { x: 0 }; } diff --git a/tests/baselines/reference/ES5For-of10(target=es2015).types b/tests/baselines/reference/ES5For-of10(target=es2015).types index 01bbdea4126dd..c5df64a5b1b9f 100644 --- a/tests/baselines/reference/ES5For-of10(target=es2015).types +++ b/tests/baselines/reference/ES5For-of10(target=es2015).types @@ -22,8 +22,8 @@ for (foo().x of []) { > : ^^^^^^^^^^^^^^^^^^^^ >x : number > : ^^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ for (foo().x of []) >foo().x : number @@ -34,8 +34,8 @@ for (foo().x of []) { > : ^^^^^^^^^^^^^^^^^^^^ >x : number > : ^^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ var p = foo().x; >p : number diff --git a/tests/baselines/reference/ES5For-of10(target=es5).js b/tests/baselines/reference/ES5For-of10(target=es5).js index 434d9cacaa529..21aa6540b2162 100644 --- a/tests/baselines/reference/ES5For-of10(target=es5).js +++ b/tests/baselines/reference/ES5For-of10(target=es5).js @@ -10,6 +10,7 @@ for (foo().x of []) { } //// [ES5For-of10.js] +"use strict"; function foo() { return { x: 0 }; } diff --git a/tests/baselines/reference/ES5For-of10(target=es5).types b/tests/baselines/reference/ES5For-of10(target=es5).types index 01bbdea4126dd..c5df64a5b1b9f 100644 --- a/tests/baselines/reference/ES5For-of10(target=es5).types +++ b/tests/baselines/reference/ES5For-of10(target=es5).types @@ -22,8 +22,8 @@ for (foo().x of []) { > : ^^^^^^^^^^^^^^^^^^^^ >x : number > : ^^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ for (foo().x of []) >foo().x : number @@ -34,8 +34,8 @@ for (foo().x of []) { > : ^^^^^^^^^^^^^^^^^^^^ >x : number > : ^^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ var p = foo().x; >p : number diff --git a/tests/baselines/reference/ES5For-of11(target=es2015).js b/tests/baselines/reference/ES5For-of11(target=es2015).js index daa93fe417015..3a3e3cf641858 100644 --- a/tests/baselines/reference/ES5For-of11(target=es2015).js +++ b/tests/baselines/reference/ES5For-of11(target=es2015).js @@ -5,5 +5,6 @@ var v; for (v of []) { } //// [ES5For-of11.js] +"use strict"; var v; for (v of []) { } diff --git a/tests/baselines/reference/ES5For-of11(target=es2015).types b/tests/baselines/reference/ES5For-of11(target=es2015).types index 47714be3636ca..41467e76d8953 100644 --- a/tests/baselines/reference/ES5For-of11(target=es2015).types +++ b/tests/baselines/reference/ES5For-of11(target=es2015).types @@ -6,6 +6,6 @@ var v; for (v of []) { } >v : any ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ diff --git a/tests/baselines/reference/ES5For-of11(target=es5).js b/tests/baselines/reference/ES5For-of11(target=es5).js index c22ea957f644c..fe32d588322fa 100644 --- a/tests/baselines/reference/ES5For-of11(target=es5).js +++ b/tests/baselines/reference/ES5For-of11(target=es5).js @@ -5,6 +5,7 @@ var v; for (v of []) { } //// [ES5For-of11.js] +"use strict"; var v; for (var _i = 0, _a = []; _i < _a.length; _i++) { v = _a[_i]; diff --git a/tests/baselines/reference/ES5For-of11(target=es5).types b/tests/baselines/reference/ES5For-of11(target=es5).types index 296009f658e75..3c6bf6daec767 100644 --- a/tests/baselines/reference/ES5For-of11(target=es5).types +++ b/tests/baselines/reference/ES5For-of11(target=es5).types @@ -8,6 +8,6 @@ var v; for (v of []) { } >v : any > : ^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ diff --git a/tests/baselines/reference/ES5For-of12(target=es2015).js b/tests/baselines/reference/ES5For-of12(target=es2015).js index 964a55195deef..8e62d2b9e1569 100644 --- a/tests/baselines/reference/ES5For-of12(target=es2015).js +++ b/tests/baselines/reference/ES5For-of12(target=es2015).js @@ -4,4 +4,5 @@ for ([""] of [[""]]) { } //// [ES5For-of12.js] +"use strict"; for ([""] of [[""]]) { } diff --git a/tests/baselines/reference/ES5For-of12(target=es5).js b/tests/baselines/reference/ES5For-of12(target=es5).js index 39deefe2cce98..3b65b31e26b9d 100644 --- a/tests/baselines/reference/ES5For-of12(target=es5).js +++ b/tests/baselines/reference/ES5For-of12(target=es5).js @@ -4,6 +4,7 @@ for ([""] of [[""]]) { } //// [ES5For-of12.js] +"use strict"; for (var _i = 0, _a = [[""]]; _i < _a.length; _i++) { "" = _a[_i][0]; } diff --git a/tests/baselines/reference/ES5For-of13(target=es2015).js b/tests/baselines/reference/ES5For-of13(target=es2015).js index 8a83fbe3810c2..f1984c77ea9fe 100644 --- a/tests/baselines/reference/ES5For-of13(target=es2015).js +++ b/tests/baselines/reference/ES5For-of13(target=es2015).js @@ -6,6 +6,7 @@ for (let v of ['a', 'b', 'c']) { } //// [ES5For-of13.js] +"use strict"; for (let v of ['a', 'b', 'c']) { var x = v; } diff --git a/tests/baselines/reference/ES5For-of13(target=es2015).js.map b/tests/baselines/reference/ES5For-of13(target=es2015).js.map index 8bc98cc2ca124..b3a871ca94d9f 100644 --- a/tests/baselines/reference/ES5For-of13(target=es2015).js.map +++ b/tests/baselines/reference/ES5For-of13(target=es2015).js.map @@ -1,3 +1,3 @@ //// [ES5For-of13.js.map] -{"version":3,"file":"ES5For-of13.js","sourceRoot":"","sources":["ES5For-of13.ts"],"names":[],"mappings":"AAAA,KAAK,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IAC5B,IAAI,CAAC,GAAG,CAAC,CAAC;AACd,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,Zm9yIChsZXQgdiBvZiBbJ2EnLCAnYicsICdjJ10pIHsNCiAgICB2YXIgeCA9IHY7DQp9DQovLyMgc291cmNlTWFwcGluZ1VSTD1FUzVGb3Itb2YxMy5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMTMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YxMy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxLQUFLLElBQUksQ0FBQyxJQUFJLENBQUMsR0FBRyxFQUFFLEdBQUcsRUFBRSxHQUFHLENBQUMsRUFBRSxDQUFDO0lBQzVCLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUNkLENBQUMifQ==,Zm9yIChsZXQgdiBvZiBbJ2EnLCAnYicsICdjJ10pIHsKICAgIHZhciB4ID0gdjsKfQ== +{"version":3,"file":"ES5For-of13.js","sourceRoot":"","sources":["ES5For-of13.ts"],"names":[],"mappings":";AAAA,KAAK,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IAC5B,IAAI,CAAC,GAAG,CAAC,CAAC;AACd,CAAC"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KZm9yIChsZXQgdiBvZiBbJ2EnLCAnYicsICdjJ10pIHsNCiAgICB2YXIgeCA9IHY7DQp9DQovLyMgc291cmNlTWFwcGluZ1VSTD1FUzVGb3Itb2YxMy5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMTMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YxMy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsS0FBSyxJQUFJLENBQUMsSUFBSSxDQUFDLEdBQUcsRUFBRSxHQUFHLEVBQUUsR0FBRyxDQUFDLEVBQUUsQ0FBQztJQUM1QixJQUFJLENBQUMsR0FBRyxDQUFDLENBQUM7QUFDZCxDQUFDIn0=,Zm9yIChsZXQgdiBvZiBbJ2EnLCAnYicsICdjJ10pIHsKICAgIHZhciB4ID0gdjsKfQ== diff --git a/tests/baselines/reference/ES5For-of13(target=es2015).sourcemap.txt b/tests/baselines/reference/ES5For-of13(target=es2015).sourcemap.txt index 497dd4ee6d519..2adf6c37c210e 100644 --- a/tests/baselines/reference/ES5For-of13(target=es2015).sourcemap.txt +++ b/tests/baselines/reference/ES5For-of13(target=es2015).sourcemap.txt @@ -8,6 +8,7 @@ sources: ES5For-of13.ts emittedFile:ES5For-of13.js sourceFile:ES5For-of13.ts ------------------------------------------------------------------- +>>>"use strict"; >>>for (let v of ['a', 'b', 'c']) { 1 > 2 >^^^^^ @@ -37,20 +38,20 @@ sourceFile:ES5For-of13.ts 12> ] 13> ) 14> { -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) -7 >Emitted(1, 19) Source(1, 19) + SourceIndex(0) -8 >Emitted(1, 21) Source(1, 21) + SourceIndex(0) -9 >Emitted(1, 24) Source(1, 24) + SourceIndex(0) -10>Emitted(1, 26) Source(1, 26) + SourceIndex(0) -11>Emitted(1, 29) Source(1, 29) + SourceIndex(0) -12>Emitted(1, 30) Source(1, 30) + SourceIndex(0) -13>Emitted(1, 32) Source(1, 32) + SourceIndex(0) -14>Emitted(1, 33) Source(1, 33) + SourceIndex(0) +1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 6) Source(1, 6) + SourceIndex(0) +3 >Emitted(2, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(2, 11) Source(1, 11) + SourceIndex(0) +5 >Emitted(2, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(2, 16) Source(1, 16) + SourceIndex(0) +7 >Emitted(2, 19) Source(1, 19) + SourceIndex(0) +8 >Emitted(2, 21) Source(1, 21) + SourceIndex(0) +9 >Emitted(2, 24) Source(1, 24) + SourceIndex(0) +10>Emitted(2, 26) Source(1, 26) + SourceIndex(0) +11>Emitted(2, 29) Source(1, 29) + SourceIndex(0) +12>Emitted(2, 30) Source(1, 30) + SourceIndex(0) +13>Emitted(2, 32) Source(1, 32) + SourceIndex(0) +14>Emitted(2, 33) Source(1, 33) + SourceIndex(0) --- >>> var x = v; 1 >^^^^ @@ -66,12 +67,12 @@ sourceFile:ES5For-of13.ts 4 > = 5 > v 6 > ; -1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -2 >Emitted(2, 9) Source(2, 9) + SourceIndex(0) -3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -4 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) -5 >Emitted(2, 14) Source(2, 14) + SourceIndex(0) -6 >Emitted(2, 15) Source(2, 15) + SourceIndex(0) +1 >Emitted(3, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 9) + SourceIndex(0) +3 >Emitted(3, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(3, 13) Source(2, 13) + SourceIndex(0) +5 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) +6 >Emitted(3, 15) Source(2, 15) + SourceIndex(0) --- >>>} 1 > @@ -80,7 +81,7 @@ sourceFile:ES5For-of13.ts 1 > > 2 >} -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 2) Source(3, 2) + SourceIndex(0) +1 >Emitted(4, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(4, 2) Source(3, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=ES5For-of13.js.map \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of13(target=es5).js b/tests/baselines/reference/ES5For-of13(target=es5).js index fe1a0f41a0c9d..a116fb82739e6 100644 --- a/tests/baselines/reference/ES5For-of13(target=es5).js +++ b/tests/baselines/reference/ES5For-of13(target=es5).js @@ -6,6 +6,7 @@ for (let v of ['a', 'b', 'c']) { } //// [ES5For-of13.js] +"use strict"; for (var _i = 0, _a = ['a', 'b', 'c']; _i < _a.length; _i++) { var v = _a[_i]; var x = v; diff --git a/tests/baselines/reference/ES5For-of13(target=es5).js.map b/tests/baselines/reference/ES5For-of13(target=es5).js.map index 89e9b0c0e74c5..1a3e1925925c9 100644 --- a/tests/baselines/reference/ES5For-of13(target=es5).js.map +++ b/tests/baselines/reference/ES5For-of13(target=es5).js.map @@ -1,3 +1,3 @@ //// [ES5For-of13.js.map] -{"version":3,"file":"ES5For-of13.js","sourceRoot":"","sources":["ES5For-of13.ts"],"names":[],"mappings":"AAAA,KAAc,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAf,cAAe,EAAf,IAAe,EAAE,CAAC;IAA3B,IAAI,CAAC,SAAA;IACN,IAAI,CAAC,GAAG,CAAC,CAAC;AACd,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,Zm9yICh2YXIgX2kgPSAwLCBfYSA9IFsnYScsICdiJywgJ2MnXTsgX2kgPCBfYS5sZW5ndGg7IF9pKyspIHsNCiAgICB2YXIgdiA9IF9hW19pXTsNCiAgICB2YXIgeCA9IHY7DQp9DQovLyMgc291cmNlTWFwcGluZ1VSTD1FUzVGb3Itb2YxMy5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMTMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YxMy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxLQUFjLFVBQWUsRUFBZixNQUFDLEdBQUcsRUFBRSxHQUFHLEVBQUUsR0FBRyxDQUFDLEVBQWYsY0FBZSxFQUFmLElBQWUsRUFBRSxDQUFDO0lBQTNCLElBQUksQ0FBQyxTQUFBO0lBQ04sSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDO0FBQ2QsQ0FBQyJ9,Zm9yIChsZXQgdiBvZiBbJ2EnLCAnYicsICdjJ10pIHsKICAgIHZhciB4ID0gdjsKfQ== +{"version":3,"file":"ES5For-of13.js","sourceRoot":"","sources":["ES5For-of13.ts"],"names":[],"mappings":";AAAA,KAAc,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAf,cAAe,EAAf,IAAe,EAAE,CAAC;IAA3B,IAAI,CAAC,SAAA;IACN,IAAI,CAAC,GAAG,CAAC,CAAC;AACd,CAAC"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KZm9yICh2YXIgX2kgPSAwLCBfYSA9IFsnYScsICdiJywgJ2MnXTsgX2kgPCBfYS5sZW5ndGg7IF9pKyspIHsNCiAgICB2YXIgdiA9IF9hW19pXTsNCiAgICB2YXIgeCA9IHY7DQp9DQovLyMgc291cmNlTWFwcGluZ1VSTD1FUzVGb3Itb2YxMy5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMTMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YxMy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsS0FBYyxVQUFlLEVBQWYsTUFBQyxHQUFHLEVBQUUsR0FBRyxFQUFFLEdBQUcsQ0FBQyxFQUFmLGNBQWUsRUFBZixJQUFlLEVBQUUsQ0FBQztJQUEzQixJQUFJLENBQUMsU0FBQTtJQUNOLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUNkLENBQUMifQ==,Zm9yIChsZXQgdiBvZiBbJ2EnLCAnYicsICdjJ10pIHsKICAgIHZhciB4ID0gdjsKfQ== diff --git a/tests/baselines/reference/ES5For-of13(target=es5).sourcemap.txt b/tests/baselines/reference/ES5For-of13(target=es5).sourcemap.txt index 59c7ac07319ca..2ca8e904afa9f 100644 --- a/tests/baselines/reference/ES5For-of13(target=es5).sourcemap.txt +++ b/tests/baselines/reference/ES5For-of13(target=es5).sourcemap.txt @@ -8,6 +8,7 @@ sources: ES5For-of13.ts emittedFile:ES5For-of13.js sourceFile:ES5For-of13.ts ------------------------------------------------------------------- +>>>"use strict"; >>>for (var _i = 0, _a = ['a', 'b', 'c']; _i < _a.length; _i++) { 1 > 2 >^^^^^ @@ -43,23 +44,23 @@ sourceFile:ES5For-of13.ts 15> ['a', 'b', 'c'] 16> ) 17> { -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 6) Source(1, 15) + SourceIndex(0) -3 >Emitted(1, 16) Source(1, 30) + SourceIndex(0) -4 >Emitted(1, 18) Source(1, 15) + SourceIndex(0) -5 >Emitted(1, 24) Source(1, 16) + SourceIndex(0) -6 >Emitted(1, 27) Source(1, 19) + SourceIndex(0) -7 >Emitted(1, 29) Source(1, 21) + SourceIndex(0) -8 >Emitted(1, 32) Source(1, 24) + SourceIndex(0) -9 >Emitted(1, 34) Source(1, 26) + SourceIndex(0) -10>Emitted(1, 37) Source(1, 29) + SourceIndex(0) -11>Emitted(1, 38) Source(1, 30) + SourceIndex(0) -12>Emitted(1, 40) Source(1, 15) + SourceIndex(0) -13>Emitted(1, 54) Source(1, 30) + SourceIndex(0) -14>Emitted(1, 56) Source(1, 15) + SourceIndex(0) -15>Emitted(1, 60) Source(1, 30) + SourceIndex(0) -16>Emitted(1, 62) Source(1, 32) + SourceIndex(0) -17>Emitted(1, 63) Source(1, 33) + SourceIndex(0) +1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 6) Source(1, 15) + SourceIndex(0) +3 >Emitted(2, 16) Source(1, 30) + SourceIndex(0) +4 >Emitted(2, 18) Source(1, 15) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 16) + SourceIndex(0) +6 >Emitted(2, 27) Source(1, 19) + SourceIndex(0) +7 >Emitted(2, 29) Source(1, 21) + SourceIndex(0) +8 >Emitted(2, 32) Source(1, 24) + SourceIndex(0) +9 >Emitted(2, 34) Source(1, 26) + SourceIndex(0) +10>Emitted(2, 37) Source(1, 29) + SourceIndex(0) +11>Emitted(2, 38) Source(1, 30) + SourceIndex(0) +12>Emitted(2, 40) Source(1, 15) + SourceIndex(0) +13>Emitted(2, 54) Source(1, 30) + SourceIndex(0) +14>Emitted(2, 56) Source(1, 15) + SourceIndex(0) +15>Emitted(2, 60) Source(1, 30) + SourceIndex(0) +16>Emitted(2, 62) Source(1, 32) + SourceIndex(0) +17>Emitted(2, 63) Source(1, 33) + SourceIndex(0) --- >>> var v = _a[_i]; 1 >^^^^ @@ -70,10 +71,10 @@ sourceFile:ES5For-of13.ts 2 > let 3 > v 4 > -1 >Emitted(2, 5) Source(1, 6) + SourceIndex(0) -2 >Emitted(2, 9) Source(1, 10) + SourceIndex(0) -3 >Emitted(2, 10) Source(1, 11) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 11) + SourceIndex(0) +1 >Emitted(3, 5) Source(1, 6) + SourceIndex(0) +2 >Emitted(3, 9) Source(1, 10) + SourceIndex(0) +3 >Emitted(3, 10) Source(1, 11) + SourceIndex(0) +4 >Emitted(3, 19) Source(1, 11) + SourceIndex(0) --- >>> var x = v; 1 >^^^^ @@ -89,12 +90,12 @@ sourceFile:ES5For-of13.ts 4 > = 5 > v 6 > ; -1 >Emitted(3, 5) Source(2, 5) + SourceIndex(0) -2 >Emitted(3, 9) Source(2, 9) + SourceIndex(0) -3 >Emitted(3, 10) Source(2, 10) + SourceIndex(0) -4 >Emitted(3, 13) Source(2, 13) + SourceIndex(0) -5 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) -6 >Emitted(3, 15) Source(2, 15) + SourceIndex(0) +1 >Emitted(4, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(4, 9) Source(2, 9) + SourceIndex(0) +3 >Emitted(4, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(4, 13) Source(2, 13) + SourceIndex(0) +5 >Emitted(4, 14) Source(2, 14) + SourceIndex(0) +6 >Emitted(4, 15) Source(2, 15) + SourceIndex(0) --- >>>} 1 > @@ -103,7 +104,7 @@ sourceFile:ES5For-of13.ts 1 > > 2 >} -1 >Emitted(4, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(4, 2) Source(3, 2) + SourceIndex(0) +1 >Emitted(5, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(5, 2) Source(3, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=ES5For-of13.js.map \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of14(target=es2015).js b/tests/baselines/reference/ES5For-of14(target=es2015).js index 3e84ee916125a..9a82f40f11d98 100644 --- a/tests/baselines/reference/ES5For-of14(target=es2015).js +++ b/tests/baselines/reference/ES5For-of14(target=es2015).js @@ -6,6 +6,7 @@ for (const v of []) { } //// [ES5For-of14.js] +"use strict"; for (const v of []) { var x = v; } diff --git a/tests/baselines/reference/ES5For-of14(target=es5).js b/tests/baselines/reference/ES5For-of14(target=es5).js index 6e3c5a2ff5642..3fa80915dedb5 100644 --- a/tests/baselines/reference/ES5For-of14(target=es5).js +++ b/tests/baselines/reference/ES5For-of14(target=es5).js @@ -6,6 +6,7 @@ for (const v of []) { } //// [ES5For-of14.js] +"use strict"; for (var _i = 0, _a = []; _i < _a.length; _i++) { var v = _a[_i]; var x = v; diff --git a/tests/baselines/reference/ES5For-of15(target=es2015).js b/tests/baselines/reference/ES5For-of15(target=es2015).js index 58d1ffb0dab23..0e809ad936cd9 100644 --- a/tests/baselines/reference/ES5For-of15(target=es2015).js +++ b/tests/baselines/reference/ES5For-of15(target=es2015).js @@ -9,6 +9,7 @@ for (let v of []) { } //// [ES5For-of15.js] +"use strict"; for (let v of []) { v; for (const v of []) { diff --git a/tests/baselines/reference/ES5For-of15(target=es5).js b/tests/baselines/reference/ES5For-of15(target=es5).js index c9138b2974055..ed40afc4dfdf7 100644 --- a/tests/baselines/reference/ES5For-of15(target=es5).js +++ b/tests/baselines/reference/ES5For-of15(target=es5).js @@ -9,6 +9,7 @@ for (let v of []) { } //// [ES5For-of15.js] +"use strict"; for (var _i = 0, _a = []; _i < _a.length; _i++) { var v = _a[_i]; v; diff --git a/tests/baselines/reference/ES5For-of16(target=es2015).js b/tests/baselines/reference/ES5For-of16(target=es2015).js index 199e8a861ca35..bd0125bf5105a 100644 --- a/tests/baselines/reference/ES5For-of16(target=es2015).js +++ b/tests/baselines/reference/ES5For-of16(target=es2015).js @@ -10,6 +10,7 @@ for (let v of []) { } //// [ES5For-of16.js] +"use strict"; for (let v of []) { v; for (let v of []) { diff --git a/tests/baselines/reference/ES5For-of16(target=es5).js b/tests/baselines/reference/ES5For-of16(target=es5).js index 72a190faae400..57cc2aeb3276d 100644 --- a/tests/baselines/reference/ES5For-of16(target=es5).js +++ b/tests/baselines/reference/ES5For-of16(target=es5).js @@ -10,6 +10,7 @@ for (let v of []) { } //// [ES5For-of16.js] +"use strict"; for (var _i = 0, _a = []; _i < _a.length; _i++) { var v = _a[_i]; v; diff --git a/tests/baselines/reference/ES5For-of17(target=es2015).errors.txt b/tests/baselines/reference/ES5For-of17(target=es2015).errors.txt index 8f20fb7f68a15..6d9273667e82a 100644 --- a/tests/baselines/reference/ES5For-of17(target=es2015).errors.txt +++ b/tests/baselines/reference/ES5For-of17(target=es2015).errors.txt @@ -1,10 +1,13 @@ +ES5For-of17.ts(3,14): error TS7022: 'v' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. ES5For-of17.ts(3,20): error TS2448: Block-scoped variable 'v' used before its declaration. -==== ES5For-of17.ts (1 errors) ==== +==== ES5For-of17.ts (2 errors) ==== for (let v of []) { v; for (let v of [v]) { + ~ +!!! error TS7022: 'v' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. ~ !!! error TS2448: Block-scoped variable 'v' used before its declaration. !!! related TS2728 ES5For-of17.ts:3:14: 'v' is declared here. diff --git a/tests/baselines/reference/ES5For-of17(target=es2015).js b/tests/baselines/reference/ES5For-of17(target=es2015).js index 71c348468a7ff..b3b17df19d802 100644 --- a/tests/baselines/reference/ES5For-of17(target=es2015).js +++ b/tests/baselines/reference/ES5For-of17(target=es2015).js @@ -10,6 +10,7 @@ for (let v of []) { } //// [ES5For-of17.js] +"use strict"; for (let v of []) { v; for (let v of [v]) { diff --git a/tests/baselines/reference/ES5For-of17(target=es2015).types b/tests/baselines/reference/ES5For-of17(target=es2015).types index 04cd108109cc6..8cbdb2a82afab 100644 --- a/tests/baselines/reference/ES5For-of17(target=es2015).types +++ b/tests/baselines/reference/ES5For-of17(target=es2015).types @@ -2,14 +2,14 @@ === ES5For-of17.ts === for (let v of []) { ->v : any -> : ^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>v : never +> : ^^^^^ +>[] : never[] +> : ^^^^^^^ v; ->v : any -> : ^^^ +>v : never +> : ^^^^^ for (let v of [v]) { >v : any diff --git a/tests/baselines/reference/ES5For-of17(target=es5).errors.txt b/tests/baselines/reference/ES5For-of17(target=es5).errors.txt index 722a8101e29ab..706eeadb9972e 100644 --- a/tests/baselines/reference/ES5For-of17(target=es5).errors.txt +++ b/tests/baselines/reference/ES5For-of17(target=es5).errors.txt @@ -1,12 +1,15 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +ES5For-of17.ts(3,14): error TS7022: 'v' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. ES5For-of17.ts(3,20): error TS2448: Block-scoped variable 'v' used before its declaration. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== ES5For-of17.ts (1 errors) ==== +==== ES5For-of17.ts (2 errors) ==== for (let v of []) { v; for (let v of [v]) { + ~ +!!! error TS7022: 'v' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. ~ !!! error TS2448: Block-scoped variable 'v' used before its declaration. !!! related TS2728 ES5For-of17.ts:3:14: 'v' is declared here. diff --git a/tests/baselines/reference/ES5For-of17(target=es5).js b/tests/baselines/reference/ES5For-of17(target=es5).js index 807c5e5f879dc..19966ad93deb1 100644 --- a/tests/baselines/reference/ES5For-of17(target=es5).js +++ b/tests/baselines/reference/ES5For-of17(target=es5).js @@ -10,6 +10,7 @@ for (let v of []) { } //// [ES5For-of17.js] +"use strict"; for (var _i = 0, _a = []; _i < _a.length; _i++) { var v = _a[_i]; v; diff --git a/tests/baselines/reference/ES5For-of17(target=es5).types b/tests/baselines/reference/ES5For-of17(target=es5).types index 04cd108109cc6..8cbdb2a82afab 100644 --- a/tests/baselines/reference/ES5For-of17(target=es5).types +++ b/tests/baselines/reference/ES5For-of17(target=es5).types @@ -2,14 +2,14 @@ === ES5For-of17.ts === for (let v of []) { ->v : any -> : ^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>v : never +> : ^^^^^ +>[] : never[] +> : ^^^^^^^ v; ->v : any -> : ^^^ +>v : never +> : ^^^^^ for (let v of [v]) { >v : any diff --git a/tests/baselines/reference/ES5For-of18(target=es2015).js b/tests/baselines/reference/ES5For-of18(target=es2015).js index d68fda7a14662..24bc7ce9cecca 100644 --- a/tests/baselines/reference/ES5For-of18(target=es2015).js +++ b/tests/baselines/reference/ES5For-of18(target=es2015).js @@ -10,6 +10,7 @@ for (let v of []) { //// [ES5For-of18.js] +"use strict"; for (let v of []) { v; } diff --git a/tests/baselines/reference/ES5For-of18(target=es5).js b/tests/baselines/reference/ES5For-of18(target=es5).js index e120417cbb582..cf76f8ea5f9ef 100644 --- a/tests/baselines/reference/ES5For-of18(target=es5).js +++ b/tests/baselines/reference/ES5For-of18(target=es5).js @@ -10,6 +10,7 @@ for (let v of []) { //// [ES5For-of18.js] +"use strict"; for (var _i = 0, _a = []; _i < _a.length; _i++) { var v = _a[_i]; v; diff --git a/tests/baselines/reference/ES5For-of19(target=es2015).js b/tests/baselines/reference/ES5For-of19(target=es2015).js index 5c3a9a9e90c3f..294c9624cfdd3 100644 --- a/tests/baselines/reference/ES5For-of19(target=es2015).js +++ b/tests/baselines/reference/ES5For-of19(target=es2015).js @@ -12,6 +12,7 @@ for (let v of []) { //// [ES5For-of19.js] +"use strict"; for (let v of []) { v; function foo() { diff --git a/tests/baselines/reference/ES5For-of19(target=es5).errors.txt b/tests/baselines/reference/ES5For-of19(target=es5).errors.txt index 9d68e6c5170b2..3144df32b2ab4 100644 --- a/tests/baselines/reference/ES5For-of19(target=es5).errors.txt +++ b/tests/baselines/reference/ES5For-of19(target=es5).errors.txt @@ -1,11 +1,14 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +ES5For-of19.ts(3,14): error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== ES5For-of19.ts (0 errors) ==== +==== ES5For-of19.ts (1 errors) ==== for (let v of []) { v; function foo() { + ~~~ +!!! error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'. for (const v of []) { v; } diff --git a/tests/baselines/reference/ES5For-of19(target=es5).js b/tests/baselines/reference/ES5For-of19(target=es5).js index fa2933b5c3390..945b75dd239ae 100644 --- a/tests/baselines/reference/ES5For-of19(target=es5).js +++ b/tests/baselines/reference/ES5For-of19(target=es5).js @@ -12,6 +12,7 @@ for (let v of []) { //// [ES5For-of19.js] +"use strict"; for (var _i = 0, _a = []; _i < _a.length; _i++) { var v = _a[_i]; v; diff --git a/tests/baselines/reference/ES5For-of19.errors.txt b/tests/baselines/reference/ES5For-of19.errors.txt new file mode 100644 index 0000000000000..f44152785e780 --- /dev/null +++ b/tests/baselines/reference/ES5For-of19.errors.txt @@ -0,0 +1,15 @@ +ES5For-of19.ts(3,14): error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'. + + +==== ES5For-of19.ts (1 errors) ==== + for (let v of []) { + v; + function foo() { + ~~~ +!!! error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'. + for (const v of []) { + v; + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of2(target=es2015).js b/tests/baselines/reference/ES5For-of2(target=es2015).js index 4df827070fd14..cb30595dca296 100644 --- a/tests/baselines/reference/ES5For-of2(target=es2015).js +++ b/tests/baselines/reference/ES5For-of2(target=es2015).js @@ -6,6 +6,7 @@ for (var v of []) { } //// [ES5For-of2.js] +"use strict"; for (var v of []) { var x = v; } diff --git a/tests/baselines/reference/ES5For-of2(target=es5).js b/tests/baselines/reference/ES5For-of2(target=es5).js index a816e9a1abd21..8d5e6d25f52a7 100644 --- a/tests/baselines/reference/ES5For-of2(target=es5).js +++ b/tests/baselines/reference/ES5For-of2(target=es5).js @@ -6,6 +6,7 @@ for (var v of []) { } //// [ES5For-of2.js] +"use strict"; for (var _i = 0, _a = []; _i < _a.length; _i++) { var v = _a[_i]; var x = v; diff --git a/tests/baselines/reference/ES5For-of20(target=es2015).js b/tests/baselines/reference/ES5For-of20(target=es2015).js index f8315134bee34..d3d3208a1a8bf 100644 --- a/tests/baselines/reference/ES5For-of20(target=es2015).js +++ b/tests/baselines/reference/ES5For-of20(target=es2015).js @@ -9,6 +9,7 @@ for (let v of []) { } //// [ES5For-of20.js] +"use strict"; for (let v of []) { let v; for (let v of [v]) { diff --git a/tests/baselines/reference/ES5For-of20(target=es5).js b/tests/baselines/reference/ES5For-of20(target=es5).js index 2438413e2f2bd..a4cbd609fefbc 100644 --- a/tests/baselines/reference/ES5For-of20(target=es5).js +++ b/tests/baselines/reference/ES5For-of20(target=es5).js @@ -9,6 +9,7 @@ for (let v of []) { } //// [ES5For-of20.js] +"use strict"; for (var _i = 0, _a = []; _i < _a.length; _i++) { var v = _a[_i]; var v_1; diff --git a/tests/baselines/reference/ES5For-of21(target=es2015).js b/tests/baselines/reference/ES5For-of21(target=es2015).js index 53c46d7b35453..1fa4a33d8fae3 100644 --- a/tests/baselines/reference/ES5For-of21(target=es2015).js +++ b/tests/baselines/reference/ES5For-of21(target=es2015).js @@ -6,6 +6,7 @@ for (let v of []) { } //// [ES5For-of21.js] +"use strict"; for (let v of []) { for (let _i of []) { } } diff --git a/tests/baselines/reference/ES5For-of21(target=es5).js b/tests/baselines/reference/ES5For-of21(target=es5).js index 57cc47fbfc294..4beace125f0da 100644 --- a/tests/baselines/reference/ES5For-of21(target=es5).js +++ b/tests/baselines/reference/ES5For-of21(target=es5).js @@ -6,6 +6,7 @@ for (let v of []) { } //// [ES5For-of21.js] +"use strict"; for (var _a = 0, _b = []; _a < _b.length; _a++) { var v = _b[_a]; for (var _c = 0, _d = []; _c < _d.length; _c++) { diff --git a/tests/baselines/reference/ES5For-of22(target=es2015).js b/tests/baselines/reference/ES5For-of22(target=es2015).js index 3d522b59363b0..1521690c43397 100644 --- a/tests/baselines/reference/ES5For-of22(target=es2015).js +++ b/tests/baselines/reference/ES5For-of22(target=es2015).js @@ -7,6 +7,7 @@ for (var x of [1, 2, 3]) { } //// [ES5For-of22.js] +"use strict"; for (var x of [1, 2, 3]) { let _a = 0; console.log(x); diff --git a/tests/baselines/reference/ES5For-of22(target=es5).js b/tests/baselines/reference/ES5For-of22(target=es5).js index ad6e593985551..5845ac26471af 100644 --- a/tests/baselines/reference/ES5For-of22(target=es5).js +++ b/tests/baselines/reference/ES5For-of22(target=es5).js @@ -7,6 +7,7 @@ for (var x of [1, 2, 3]) { } //// [ES5For-of22.js] +"use strict"; for (var _i = 0, _b = [1, 2, 3]; _i < _b.length; _i++) { var x = _b[_i]; var _a = 0; diff --git a/tests/baselines/reference/ES5For-of23(target=es2015).js b/tests/baselines/reference/ES5For-of23(target=es2015).js index e6a6acdcca266..fb33817fe7194 100644 --- a/tests/baselines/reference/ES5For-of23(target=es2015).js +++ b/tests/baselines/reference/ES5For-of23(target=es2015).js @@ -7,6 +7,7 @@ for (var x of [1, 2, 3]) { } //// [ES5For-of23.js] +"use strict"; for (var x of [1, 2, 3]) { var _a = 0; console.log(x); diff --git a/tests/baselines/reference/ES5For-of23(target=es5).js b/tests/baselines/reference/ES5For-of23(target=es5).js index 3082de8b084e0..de426b30bf906 100644 --- a/tests/baselines/reference/ES5For-of23(target=es5).js +++ b/tests/baselines/reference/ES5For-of23(target=es5).js @@ -7,6 +7,7 @@ for (var x of [1, 2, 3]) { } //// [ES5For-of23.js] +"use strict"; for (var _i = 0, _b = [1, 2, 3]; _i < _b.length; _i++) { var x = _b[_i]; var _a = 0; diff --git a/tests/baselines/reference/ES5For-of24(target=es2015).js b/tests/baselines/reference/ES5For-of24(target=es2015).js index aed1c5adbdf66..fdd8256f85bd6 100644 --- a/tests/baselines/reference/ES5For-of24(target=es2015).js +++ b/tests/baselines/reference/ES5For-of24(target=es2015).js @@ -7,6 +7,7 @@ for (var v of a) { } //// [ES5For-of24.js] +"use strict"; var a = [1, 2, 3]; for (var v of a) { let a = 0; diff --git a/tests/baselines/reference/ES5For-of24(target=es5).js b/tests/baselines/reference/ES5For-of24(target=es5).js index c7f4b85d84f49..5b56ae1f75bbd 100644 --- a/tests/baselines/reference/ES5For-of24(target=es5).js +++ b/tests/baselines/reference/ES5For-of24(target=es5).js @@ -7,6 +7,7 @@ for (var v of a) { } //// [ES5For-of24.js] +"use strict"; var a = [1, 2, 3]; for (var _i = 0, a_1 = a; _i < a_1.length; _i++) { var v = a_1[_i]; diff --git a/tests/baselines/reference/ES5For-of25(target=es2015).js b/tests/baselines/reference/ES5For-of25(target=es2015).js index 481e49092b250..e165a93724cd3 100644 --- a/tests/baselines/reference/ES5For-of25(target=es2015).js +++ b/tests/baselines/reference/ES5For-of25(target=es2015).js @@ -8,6 +8,7 @@ for (var v of a) { } //// [ES5For-of25.js] +"use strict"; var a = [1, 2, 3]; for (var v of a) { v; diff --git a/tests/baselines/reference/ES5For-of25(target=es2015).js.map b/tests/baselines/reference/ES5For-of25(target=es2015).js.map index 4cb55270ed3c6..14db38aa9ee4d 100644 --- a/tests/baselines/reference/ES5For-of25(target=es2015).js.map +++ b/tests/baselines/reference/ES5For-of25(target=es2015).js.map @@ -1,3 +1,3 @@ //// [ES5For-of25.js.map] -{"version":3,"file":"ES5For-of25.js","sourceRoot":"","sources":["ES5For-of25.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAClB,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;IACd,CAAC,CAAC;IACF,CAAC,CAAC;AACN,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,dmFyIGEgPSBbMSwgMiwgM107DQpmb3IgKHZhciB2IG9mIGEpIHsNCiAgICB2Ow0KICAgIGE7DQp9DQovLyMgc291cmNlTWFwcGluZ1VSTD1FUzVGb3Itb2YyNS5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMjUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YyNS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUM7QUFDbEIsS0FBSyxJQUFJLENBQUMsSUFBSSxDQUFDLEVBQUUsQ0FBQztJQUNkLENBQUMsQ0FBQztJQUNGLENBQUMsQ0FBQztBQUNOLENBQUMifQ==,dmFyIGEgPSBbMSwgMiwgM107CmZvciAodmFyIHYgb2YgYSkgewogICAgdjsKICAgIGE7Cn0= +{"version":3,"file":"ES5For-of25.js","sourceRoot":"","sources":["ES5For-of25.ts"],"names":[],"mappings":";AAAA,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAClB,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;IACd,CAAC,CAAC;IACF,CAAC,CAAC;AACN,CAAC"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KdmFyIGEgPSBbMSwgMiwgM107DQpmb3IgKHZhciB2IG9mIGEpIHsNCiAgICB2Ow0KICAgIGE7DQp9DQovLyMgc291cmNlTWFwcGluZ1VSTD1FUzVGb3Itb2YyNS5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMjUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YyNS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDO0FBQ2xCLEtBQUssSUFBSSxDQUFDLElBQUksQ0FBQyxFQUFFLENBQUM7SUFDZCxDQUFDLENBQUM7SUFDRixDQUFDLENBQUM7QUFDTixDQUFDIn0=,dmFyIGEgPSBbMSwgMiwgM107CmZvciAodmFyIHYgb2YgYSkgewogICAgdjsKICAgIGE7Cn0= diff --git a/tests/baselines/reference/ES5For-of25(target=es2015).sourcemap.txt b/tests/baselines/reference/ES5For-of25(target=es2015).sourcemap.txt index 12f7a2d129fc4..dfc97dcd8d871 100644 --- a/tests/baselines/reference/ES5For-of25(target=es2015).sourcemap.txt +++ b/tests/baselines/reference/ES5For-of25(target=es2015).sourcemap.txt @@ -8,6 +8,7 @@ sources: ES5For-of25.ts emittedFile:ES5For-of25.js sourceFile:ES5For-of25.ts ------------------------------------------------------------------- +>>>"use strict"; >>>var a = [1, 2, 3]; 1 > 2 >^^^^ @@ -34,18 +35,18 @@ sourceFile:ES5For-of25.ts 10> 3 11> ] 12> ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) -4 >Emitted(1, 9) Source(1, 9) + SourceIndex(0) -5 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -6 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) -7 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -8 >Emitted(1, 14) Source(1, 14) + SourceIndex(0) -9 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) -10>Emitted(1, 17) Source(1, 17) + SourceIndex(0) -11>Emitted(1, 18) Source(1, 18) + SourceIndex(0) -12>Emitted(1, 19) Source(1, 19) + SourceIndex(0) +1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(2, 6) Source(1, 6) + SourceIndex(0) +4 >Emitted(2, 9) Source(1, 9) + SourceIndex(0) +5 >Emitted(2, 10) Source(1, 10) + SourceIndex(0) +6 >Emitted(2, 11) Source(1, 11) + SourceIndex(0) +7 >Emitted(2, 13) Source(1, 13) + SourceIndex(0) +8 >Emitted(2, 14) Source(1, 14) + SourceIndex(0) +9 >Emitted(2, 16) Source(1, 16) + SourceIndex(0) +10>Emitted(2, 17) Source(1, 17) + SourceIndex(0) +11>Emitted(2, 18) Source(1, 18) + SourceIndex(0) +12>Emitted(2, 19) Source(1, 19) + SourceIndex(0) --- >>>for (var v of a) { 1-> @@ -65,14 +66,14 @@ sourceFile:ES5For-of25.ts 6 > a 7 > ) 8 > { -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 6) Source(2, 6) + SourceIndex(0) -3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -4 >Emitted(2, 11) Source(2, 11) + SourceIndex(0) -5 >Emitted(2, 15) Source(2, 15) + SourceIndex(0) -6 >Emitted(2, 16) Source(2, 16) + SourceIndex(0) -7 >Emitted(2, 18) Source(2, 18) + SourceIndex(0) -8 >Emitted(2, 19) Source(2, 19) + SourceIndex(0) +1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 6) Source(2, 6) + SourceIndex(0) +3 >Emitted(3, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(3, 11) Source(2, 11) + SourceIndex(0) +5 >Emitted(3, 15) Source(2, 15) + SourceIndex(0) +6 >Emitted(3, 16) Source(2, 16) + SourceIndex(0) +7 >Emitted(3, 18) Source(2, 18) + SourceIndex(0) +8 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) --- >>> v; 1 >^^^^ @@ -83,9 +84,9 @@ sourceFile:ES5For-of25.ts > 2 > v 3 > ; -1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) -2 >Emitted(3, 6) Source(3, 6) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +1 >Emitted(4, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(4, 6) Source(3, 6) + SourceIndex(0) +3 >Emitted(4, 7) Source(3, 7) + SourceIndex(0) --- >>> a; 1->^^^^ @@ -95,9 +96,9 @@ sourceFile:ES5For-of25.ts > 2 > a 3 > ; -1->Emitted(4, 5) Source(4, 5) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 6) + SourceIndex(0) -3 >Emitted(4, 7) Source(4, 7) + SourceIndex(0) +1->Emitted(5, 5) Source(4, 5) + SourceIndex(0) +2 >Emitted(5, 6) Source(4, 6) + SourceIndex(0) +3 >Emitted(5, 7) Source(4, 7) + SourceIndex(0) --- >>>} 1 > @@ -106,7 +107,7 @@ sourceFile:ES5For-of25.ts 1 > > 2 >} -1 >Emitted(5, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(5, 2) Source(5, 2) + SourceIndex(0) +1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) +2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=ES5For-of25.js.map \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of25(target=es5).js b/tests/baselines/reference/ES5For-of25(target=es5).js index d84336430159d..2710f7fba083a 100644 --- a/tests/baselines/reference/ES5For-of25(target=es5).js +++ b/tests/baselines/reference/ES5For-of25(target=es5).js @@ -8,6 +8,7 @@ for (var v of a) { } //// [ES5For-of25.js] +"use strict"; var a = [1, 2, 3]; for (var _i = 0, a_1 = a; _i < a_1.length; _i++) { var v = a_1[_i]; diff --git a/tests/baselines/reference/ES5For-of25(target=es5).js.map b/tests/baselines/reference/ES5For-of25(target=es5).js.map index 288ec798920c5..eb9181f496a75 100644 --- a/tests/baselines/reference/ES5For-of25(target=es5).js.map +++ b/tests/baselines/reference/ES5For-of25(target=es5).js.map @@ -1,3 +1,3 @@ //// [ES5For-of25.js.map] -{"version":3,"file":"ES5For-of25.js","sourceRoot":"","sources":["ES5For-of25.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAClB,KAAc,UAAC,EAAD,OAAC,EAAD,eAAC,EAAD,IAAC,EAAE,CAAC;IAAb,IAAI,CAAC,UAAA;IACN,CAAC,CAAC;IACF,CAAC,CAAC;AACN,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,dmFyIGEgPSBbMSwgMiwgM107DQpmb3IgKHZhciBfaSA9IDAsIGFfMSA9IGE7IF9pIDwgYV8xLmxlbmd0aDsgX2krKykgew0KICAgIHZhciB2ID0gYV8xW19pXTsNCiAgICB2Ow0KICAgIGE7DQp9DQovLyMgc291cmNlTWFwcGluZ1VSTD1FUzVGb3Itb2YyNS5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMjUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YyNS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUM7QUFDbEIsS0FBYyxVQUFDLEVBQUQsT0FBQyxFQUFELGVBQUMsRUFBRCxJQUFDLEVBQUUsQ0FBQztJQUFiLElBQUksQ0FBQyxVQUFBO0lBQ04sQ0FBQyxDQUFDO0lBQ0YsQ0FBQyxDQUFDO0FBQ04sQ0FBQyJ9,dmFyIGEgPSBbMSwgMiwgM107CmZvciAodmFyIHYgb2YgYSkgewogICAgdjsKICAgIGE7Cn0= +{"version":3,"file":"ES5For-of25.js","sourceRoot":"","sources":["ES5For-of25.ts"],"names":[],"mappings":";AAAA,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAClB,KAAc,UAAC,EAAD,OAAC,EAAD,eAAC,EAAD,IAAC,EAAE,CAAC;IAAb,IAAI,CAAC,UAAA;IACN,CAAC,CAAC;IACF,CAAC,CAAC;AACN,CAAC"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KdmFyIGEgPSBbMSwgMiwgM107DQpmb3IgKHZhciBfaSA9IDAsIGFfMSA9IGE7IF9pIDwgYV8xLmxlbmd0aDsgX2krKykgew0KICAgIHZhciB2ID0gYV8xW19pXTsNCiAgICB2Ow0KICAgIGE7DQp9DQovLyMgc291cmNlTWFwcGluZ1VSTD1FUzVGb3Itb2YyNS5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMjUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YyNS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDO0FBQ2xCLEtBQWMsVUFBQyxFQUFELE9BQUMsRUFBRCxlQUFDLEVBQUQsSUFBQyxFQUFFLENBQUM7SUFBYixJQUFJLENBQUMsVUFBQTtJQUNOLENBQUMsQ0FBQztJQUNGLENBQUMsQ0FBQztBQUNOLENBQUMifQ==,dmFyIGEgPSBbMSwgMiwgM107CmZvciAodmFyIHYgb2YgYSkgewogICAgdjsKICAgIGE7Cn0= diff --git a/tests/baselines/reference/ES5For-of25(target=es5).sourcemap.txt b/tests/baselines/reference/ES5For-of25(target=es5).sourcemap.txt index 345e2ac16ca52..e488df86f345c 100644 --- a/tests/baselines/reference/ES5For-of25(target=es5).sourcemap.txt +++ b/tests/baselines/reference/ES5For-of25(target=es5).sourcemap.txt @@ -8,6 +8,7 @@ sources: ES5For-of25.ts emittedFile:ES5For-of25.js sourceFile:ES5For-of25.ts ------------------------------------------------------------------- +>>>"use strict"; >>>var a = [1, 2, 3]; 1 > 2 >^^^^ @@ -34,18 +35,18 @@ sourceFile:ES5For-of25.ts 10> 3 11> ] 12> ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) -4 >Emitted(1, 9) Source(1, 9) + SourceIndex(0) -5 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -6 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) -7 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) -8 >Emitted(1, 14) Source(1, 14) + SourceIndex(0) -9 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) -10>Emitted(1, 17) Source(1, 17) + SourceIndex(0) -11>Emitted(1, 18) Source(1, 18) + SourceIndex(0) -12>Emitted(1, 19) Source(1, 19) + SourceIndex(0) +1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(2, 6) Source(1, 6) + SourceIndex(0) +4 >Emitted(2, 9) Source(1, 9) + SourceIndex(0) +5 >Emitted(2, 10) Source(1, 10) + SourceIndex(0) +6 >Emitted(2, 11) Source(1, 11) + SourceIndex(0) +7 >Emitted(2, 13) Source(1, 13) + SourceIndex(0) +8 >Emitted(2, 14) Source(1, 14) + SourceIndex(0) +9 >Emitted(2, 16) Source(1, 16) + SourceIndex(0) +10>Emitted(2, 17) Source(1, 17) + SourceIndex(0) +11>Emitted(2, 18) Source(1, 18) + SourceIndex(0) +12>Emitted(2, 19) Source(1, 19) + SourceIndex(0) --- >>>for (var _i = 0, a_1 = a; _i < a_1.length; _i++) { 1-> @@ -71,17 +72,17 @@ sourceFile:ES5For-of25.ts 9 > a 10> ) 11> { -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 6) Source(2, 15) + SourceIndex(0) -3 >Emitted(2, 16) Source(2, 16) + SourceIndex(0) -4 >Emitted(2, 18) Source(2, 15) + SourceIndex(0) -5 >Emitted(2, 25) Source(2, 16) + SourceIndex(0) -6 >Emitted(2, 27) Source(2, 15) + SourceIndex(0) -7 >Emitted(2, 42) Source(2, 16) + SourceIndex(0) -8 >Emitted(2, 44) Source(2, 15) + SourceIndex(0) -9 >Emitted(2, 48) Source(2, 16) + SourceIndex(0) -10>Emitted(2, 50) Source(2, 18) + SourceIndex(0) -11>Emitted(2, 51) Source(2, 19) + SourceIndex(0) +1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 6) Source(2, 15) + SourceIndex(0) +3 >Emitted(3, 16) Source(2, 16) + SourceIndex(0) +4 >Emitted(3, 18) Source(2, 15) + SourceIndex(0) +5 >Emitted(3, 25) Source(2, 16) + SourceIndex(0) +6 >Emitted(3, 27) Source(2, 15) + SourceIndex(0) +7 >Emitted(3, 42) Source(2, 16) + SourceIndex(0) +8 >Emitted(3, 44) Source(2, 15) + SourceIndex(0) +9 >Emitted(3, 48) Source(2, 16) + SourceIndex(0) +10>Emitted(3, 50) Source(2, 18) + SourceIndex(0) +11>Emitted(3, 51) Source(2, 19) + SourceIndex(0) --- >>> var v = a_1[_i]; 1 >^^^^ @@ -92,10 +93,10 @@ sourceFile:ES5For-of25.ts 2 > var 3 > v 4 > -1 >Emitted(3, 5) Source(2, 6) + SourceIndex(0) -2 >Emitted(3, 9) Source(2, 10) + SourceIndex(0) -3 >Emitted(3, 10) Source(2, 11) + SourceIndex(0) -4 >Emitted(3, 20) Source(2, 11) + SourceIndex(0) +1 >Emitted(4, 5) Source(2, 6) + SourceIndex(0) +2 >Emitted(4, 9) Source(2, 10) + SourceIndex(0) +3 >Emitted(4, 10) Source(2, 11) + SourceIndex(0) +4 >Emitted(4, 20) Source(2, 11) + SourceIndex(0) --- >>> v; 1 >^^^^ @@ -106,9 +107,9 @@ sourceFile:ES5For-of25.ts > 2 > v 3 > ; -1 >Emitted(4, 5) Source(3, 5) + SourceIndex(0) -2 >Emitted(4, 6) Source(3, 6) + SourceIndex(0) -3 >Emitted(4, 7) Source(3, 7) + SourceIndex(0) +1 >Emitted(5, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(5, 6) Source(3, 6) + SourceIndex(0) +3 >Emitted(5, 7) Source(3, 7) + SourceIndex(0) --- >>> a; 1->^^^^ @@ -118,9 +119,9 @@ sourceFile:ES5For-of25.ts > 2 > a 3 > ; -1->Emitted(5, 5) Source(4, 5) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 6) + SourceIndex(0) -3 >Emitted(5, 7) Source(4, 7) + SourceIndex(0) +1->Emitted(6, 5) Source(4, 5) + SourceIndex(0) +2 >Emitted(6, 6) Source(4, 6) + SourceIndex(0) +3 >Emitted(6, 7) Source(4, 7) + SourceIndex(0) --- >>>} 1 > @@ -129,7 +130,7 @@ sourceFile:ES5For-of25.ts 1 > > 2 >} -1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) +1 >Emitted(7, 1) Source(5, 1) + SourceIndex(0) +2 >Emitted(7, 2) Source(5, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=ES5For-of25.js.map \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of26(target=es2015).js b/tests/baselines/reference/ES5For-of26(target=es2015).js index 9a37217bc7329..4adeef520467b 100644 --- a/tests/baselines/reference/ES5For-of26(target=es2015).js +++ b/tests/baselines/reference/ES5For-of26(target=es2015).js @@ -7,6 +7,7 @@ for (var [a = 0, b = 1] of [2, 3]) { } //// [ES5For-of26.js] +"use strict"; for (var [a = 0, b = 1] of [2, 3]) { a; b; diff --git a/tests/baselines/reference/ES5For-of26(target=es2015).js.map b/tests/baselines/reference/ES5For-of26(target=es2015).js.map index 51d0525b9d6e4..49e0519113f2c 100644 --- a/tests/baselines/reference/ES5For-of26(target=es2015).js.map +++ b/tests/baselines/reference/ES5For-of26(target=es2015).js.map @@ -1,3 +1,3 @@ //// [ES5For-of26.js.map] -{"version":3,"file":"ES5For-of26.js","sourceRoot":"","sources":["ES5For-of26.ts"],"names":[],"mappings":"AAAA,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;IAChC,CAAC,CAAC;IACF,CAAC,CAAC;AACN,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,Zm9yICh2YXIgW2EgPSAwLCBiID0gMV0gb2YgWzIsIDNdKSB7DQogICAgYTsNCiAgICBiOw0KfQ0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9RVM1Rm9yLW9mMjYuanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMjYuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YyNi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxLQUFLLElBQUksQ0FBQyxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsR0FBRyxDQUFDLENBQUMsSUFBSSxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsRUFBRSxDQUFDO0lBQ2hDLENBQUMsQ0FBQztJQUNGLENBQUMsQ0FBQztBQUNOLENBQUMifQ==,Zm9yICh2YXIgW2EgPSAwLCBiID0gMV0gb2YgWzIsIDNdKSB7CiAgICBhOwogICAgYjsKfQ== +{"version":3,"file":"ES5For-of26.js","sourceRoot":"","sources":["ES5For-of26.ts"],"names":[],"mappings":";AAAA,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;IAChC,CAAC,CAAC;IACF,CAAC,CAAC;AACN,CAAC"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KZm9yICh2YXIgW2EgPSAwLCBiID0gMV0gb2YgWzIsIDNdKSB7DQogICAgYTsNCiAgICBiOw0KfQ0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9RVM1Rm9yLW9mMjYuanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMjYuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YyNi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsS0FBSyxJQUFJLENBQUMsQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEdBQUcsQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLEVBQUUsQ0FBQztJQUNoQyxDQUFDLENBQUM7SUFDRixDQUFDLENBQUM7QUFDTixDQUFDIn0=,Zm9yICh2YXIgW2EgPSAwLCBiID0gMV0gb2YgWzIsIDNdKSB7CiAgICBhOwogICAgYjsKfQ== diff --git a/tests/baselines/reference/ES5For-of26(target=es2015).sourcemap.txt b/tests/baselines/reference/ES5For-of26(target=es2015).sourcemap.txt index 162846607b68b..5198fdfa80f99 100644 --- a/tests/baselines/reference/ES5For-of26(target=es2015).sourcemap.txt +++ b/tests/baselines/reference/ES5For-of26(target=es2015).sourcemap.txt @@ -8,6 +8,7 @@ sources: ES5For-of26.ts emittedFile:ES5For-of26.js sourceFile:ES5For-of26.ts ------------------------------------------------------------------- +>>>"use strict"; >>>for (var [a = 0, b = 1] of [2, 3]) { 1 > 2 >^^^^^ @@ -49,26 +50,26 @@ sourceFile:ES5For-of26.ts 18> ] 19> ) 20> { -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -7 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) -8 >Emitted(1, 18) Source(1, 18) + SourceIndex(0) -9 >Emitted(1, 19) Source(1, 19) + SourceIndex(0) -10>Emitted(1, 22) Source(1, 22) + SourceIndex(0) -11>Emitted(1, 23) Source(1, 23) + SourceIndex(0) -12>Emitted(1, 24) Source(1, 24) + SourceIndex(0) -13>Emitted(1, 28) Source(1, 28) + SourceIndex(0) -14>Emitted(1, 29) Source(1, 29) + SourceIndex(0) -15>Emitted(1, 30) Source(1, 30) + SourceIndex(0) -16>Emitted(1, 32) Source(1, 32) + SourceIndex(0) -17>Emitted(1, 33) Source(1, 33) + SourceIndex(0) -18>Emitted(1, 34) Source(1, 34) + SourceIndex(0) -19>Emitted(1, 36) Source(1, 36) + SourceIndex(0) -20>Emitted(1, 37) Source(1, 37) + SourceIndex(0) +1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 6) Source(1, 6) + SourceIndex(0) +3 >Emitted(2, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(2, 11) Source(1, 11) + SourceIndex(0) +5 >Emitted(2, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(2, 15) Source(1, 15) + SourceIndex(0) +7 >Emitted(2, 16) Source(1, 16) + SourceIndex(0) +8 >Emitted(2, 18) Source(1, 18) + SourceIndex(0) +9 >Emitted(2, 19) Source(1, 19) + SourceIndex(0) +10>Emitted(2, 22) Source(1, 22) + SourceIndex(0) +11>Emitted(2, 23) Source(1, 23) + SourceIndex(0) +12>Emitted(2, 24) Source(1, 24) + SourceIndex(0) +13>Emitted(2, 28) Source(1, 28) + SourceIndex(0) +14>Emitted(2, 29) Source(1, 29) + SourceIndex(0) +15>Emitted(2, 30) Source(1, 30) + SourceIndex(0) +16>Emitted(2, 32) Source(1, 32) + SourceIndex(0) +17>Emitted(2, 33) Source(1, 33) + SourceIndex(0) +18>Emitted(2, 34) Source(1, 34) + SourceIndex(0) +19>Emitted(2, 36) Source(1, 36) + SourceIndex(0) +20>Emitted(2, 37) Source(1, 37) + SourceIndex(0) --- >>> a; 1 >^^^^ @@ -79,9 +80,9 @@ sourceFile:ES5For-of26.ts > 2 > a 3 > ; -1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -2 >Emitted(2, 6) Source(2, 6) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +1 >Emitted(3, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(3, 6) Source(2, 6) + SourceIndex(0) +3 >Emitted(3, 7) Source(2, 7) + SourceIndex(0) --- >>> b; 1->^^^^ @@ -91,9 +92,9 @@ sourceFile:ES5For-of26.ts > 2 > b 3 > ; -1->Emitted(3, 5) Source(3, 5) + SourceIndex(0) -2 >Emitted(3, 6) Source(3, 6) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +1->Emitted(4, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(4, 6) Source(3, 6) + SourceIndex(0) +3 >Emitted(4, 7) Source(3, 7) + SourceIndex(0) --- >>>} 1 > @@ -102,7 +103,7 @@ sourceFile:ES5For-of26.ts 1 > > 2 >} -1 >Emitted(4, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 2) Source(4, 2) + SourceIndex(0) +1 >Emitted(5, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(5, 2) Source(4, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=ES5For-of26.js.map \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of26(target=es5).js b/tests/baselines/reference/ES5For-of26(target=es5).js index 00d65b7c2f184..4ccc7c058c868 100644 --- a/tests/baselines/reference/ES5For-of26(target=es5).js +++ b/tests/baselines/reference/ES5For-of26(target=es5).js @@ -7,6 +7,7 @@ for (var [a = 0, b = 1] of [2, 3]) { } //// [ES5For-of26.js] +"use strict"; for (var _i = 0, _a = [2, 3]; _i < _a.length; _i++) { var _b = _a[_i], _c = _b[0], a = _c === void 0 ? 0 : _c, _d = _b[1], b = _d === void 0 ? 1 : _d; a; diff --git a/tests/baselines/reference/ES5For-of26(target=es5).js.map b/tests/baselines/reference/ES5For-of26(target=es5).js.map index 196e63437187a..8a864c9c86e53 100644 --- a/tests/baselines/reference/ES5For-of26(target=es5).js.map +++ b/tests/baselines/reference/ES5For-of26(target=es5).js.map @@ -1,3 +1,3 @@ //// [ES5For-of26.js.map] -{"version":3,"file":"ES5For-of26.js","sourceRoot":"","sources":["ES5For-of26.ts"],"names":[],"mappings":"AAAA,KAA2B,UAAM,EAAN,MAAC,CAAC,EAAE,CAAC,CAAC,EAAN,cAAM,EAAN,IAAM,EAAE,CAAC;IAA3B,IAAA,WAAc,EAAb,UAAK,EAAL,CAAC,mBAAG,CAAC,KAAA,EAAE,UAAK,EAAL,CAAC,mBAAG,CAAC,KAAA;IAClB,CAAC,CAAC;IACF,CAAC,CAAC;AACN,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,Zm9yICh2YXIgX2kgPSAwLCBfYSA9IFsyLCAzXTsgX2kgPCBfYS5sZW5ndGg7IF9pKyspIHsNCiAgICB2YXIgX2IgPSBfYVtfaV0sIF9jID0gX2JbMF0sIGEgPSBfYyA9PT0gdm9pZCAwID8gMCA6IF9jLCBfZCA9IF9iWzFdLCBiID0gX2QgPT09IHZvaWQgMCA/IDEgOiBfZDsNCiAgICBhOw0KICAgIGI7DQp9DQovLyMgc291cmNlTWFwcGluZ1VSTD1FUzVGb3Itb2YyNi5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMjYuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YyNi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxLQUEyQixVQUFNLEVBQU4sTUFBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLEVBQU4sY0FBTSxFQUFOLElBQU0sRUFBRSxDQUFDO0lBQTNCLElBQUEsV0FBYyxFQUFiLFVBQUssRUFBTCxDQUFDLG1CQUFHLENBQUMsS0FBQSxFQUFFLFVBQUssRUFBTCxDQUFDLG1CQUFHLENBQUMsS0FBQTtJQUNsQixDQUFDLENBQUM7SUFDRixDQUFDLENBQUM7QUFDTixDQUFDIn0=,Zm9yICh2YXIgW2EgPSAwLCBiID0gMV0gb2YgWzIsIDNdKSB7CiAgICBhOwogICAgYjsKfQ== +{"version":3,"file":"ES5For-of26.js","sourceRoot":"","sources":["ES5For-of26.ts"],"names":[],"mappings":";AAAA,KAA2B,UAAM,EAAN,MAAC,CAAC,EAAE,CAAC,CAAC,EAAN,cAAM,EAAN,IAAM,EAAE,CAAC;IAA3B,IAAA,WAAc,EAAb,UAAK,EAAL,CAAC,mBAAG,CAAC,KAAA,EAAE,UAAK,EAAL,CAAC,mBAAG,CAAC,KAAA;IAClB,CAAC,CAAC;IACF,CAAC,CAAC;AACN,CAAC"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KZm9yICh2YXIgX2kgPSAwLCBfYSA9IFsyLCAzXTsgX2kgPCBfYS5sZW5ndGg7IF9pKyspIHsNCiAgICB2YXIgX2IgPSBfYVtfaV0sIF9jID0gX2JbMF0sIGEgPSBfYyA9PT0gdm9pZCAwID8gMCA6IF9jLCBfZCA9IF9iWzFdLCBiID0gX2QgPT09IHZvaWQgMCA/IDEgOiBfZDsNCiAgICBhOw0KICAgIGI7DQp9DQovLyMgc291cmNlTWFwcGluZ1VSTD1FUzVGb3Itb2YyNi5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMjYuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YyNi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsS0FBMkIsVUFBTSxFQUFOLE1BQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxFQUFOLGNBQU0sRUFBTixJQUFNLEVBQUUsQ0FBQztJQUEzQixJQUFBLFdBQWMsRUFBYixVQUFLLEVBQUwsQ0FBQyxtQkFBRyxDQUFDLEtBQUEsRUFBRSxVQUFLLEVBQUwsQ0FBQyxtQkFBRyxDQUFDLEtBQUE7SUFDbEIsQ0FBQyxDQUFDO0lBQ0YsQ0FBQyxDQUFDO0FBQ04sQ0FBQyJ9,Zm9yICh2YXIgW2EgPSAwLCBiID0gMV0gb2YgWzIsIDNdKSB7CiAgICBhOwogICAgYjsKfQ== diff --git a/tests/baselines/reference/ES5For-of26(target=es5).sourcemap.txt b/tests/baselines/reference/ES5For-of26(target=es5).sourcemap.txt index 2955602a9b846..191d32947b0f4 100644 --- a/tests/baselines/reference/ES5For-of26(target=es5).sourcemap.txt +++ b/tests/baselines/reference/ES5For-of26(target=es5).sourcemap.txt @@ -8,6 +8,7 @@ sources: ES5For-of26.ts emittedFile:ES5For-of26.js sourceFile:ES5For-of26.ts ------------------------------------------------------------------- +>>>"use strict"; >>>for (var _i = 0, _a = [2, 3]; _i < _a.length; _i++) { 1 > 2 >^^^^^ @@ -40,21 +41,21 @@ sourceFile:ES5For-of26.ts 13> [2, 3] 14> ) 15> { -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 6) Source(1, 28) + SourceIndex(0) -3 >Emitted(1, 16) Source(1, 34) + SourceIndex(0) -4 >Emitted(1, 18) Source(1, 28) + SourceIndex(0) -5 >Emitted(1, 24) Source(1, 29) + SourceIndex(0) -6 >Emitted(1, 25) Source(1, 30) + SourceIndex(0) -7 >Emitted(1, 27) Source(1, 32) + SourceIndex(0) -8 >Emitted(1, 28) Source(1, 33) + SourceIndex(0) -9 >Emitted(1, 29) Source(1, 34) + SourceIndex(0) -10>Emitted(1, 31) Source(1, 28) + SourceIndex(0) -11>Emitted(1, 45) Source(1, 34) + SourceIndex(0) -12>Emitted(1, 47) Source(1, 28) + SourceIndex(0) -13>Emitted(1, 51) Source(1, 34) + SourceIndex(0) -14>Emitted(1, 53) Source(1, 36) + SourceIndex(0) -15>Emitted(1, 54) Source(1, 37) + SourceIndex(0) +1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 6) Source(1, 28) + SourceIndex(0) +3 >Emitted(2, 16) Source(1, 34) + SourceIndex(0) +4 >Emitted(2, 18) Source(1, 28) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 29) + SourceIndex(0) +6 >Emitted(2, 25) Source(1, 30) + SourceIndex(0) +7 >Emitted(2, 27) Source(1, 32) + SourceIndex(0) +8 >Emitted(2, 28) Source(1, 33) + SourceIndex(0) +9 >Emitted(2, 29) Source(1, 34) + SourceIndex(0) +10>Emitted(2, 31) Source(1, 28) + SourceIndex(0) +11>Emitted(2, 45) Source(1, 34) + SourceIndex(0) +12>Emitted(2, 47) Source(1, 28) + SourceIndex(0) +13>Emitted(2, 51) Source(1, 34) + SourceIndex(0) +14>Emitted(2, 53) Source(1, 36) + SourceIndex(0) +15>Emitted(2, 54) Source(1, 37) + SourceIndex(0) --- >>> var _b = _a[_i], _c = _b[0], a = _c === void 0 ? 0 : _c, _d = _b[1], b = _d === void 0 ? 1 : _d; 1->^^^^ @@ -91,23 +92,23 @@ sourceFile:ES5For-of26.ts 15> = 16> 1 17> -1->Emitted(2, 5) Source(1, 10) + SourceIndex(0) -2 >Emitted(2, 9) Source(1, 10) + SourceIndex(0) -3 >Emitted(2, 20) Source(1, 24) + SourceIndex(0) -4 >Emitted(2, 22) Source(1, 11) + SourceIndex(0) -5 >Emitted(2, 32) Source(1, 16) + SourceIndex(0) -6 >Emitted(2, 34) Source(1, 11) + SourceIndex(0) -7 >Emitted(2, 35) Source(1, 12) + SourceIndex(0) -8 >Emitted(2, 54) Source(1, 15) + SourceIndex(0) -9 >Emitted(2, 55) Source(1, 16) + SourceIndex(0) -10>Emitted(2, 60) Source(1, 16) + SourceIndex(0) -11>Emitted(2, 62) Source(1, 18) + SourceIndex(0) -12>Emitted(2, 72) Source(1, 23) + SourceIndex(0) -13>Emitted(2, 74) Source(1, 18) + SourceIndex(0) -14>Emitted(2, 75) Source(1, 19) + SourceIndex(0) -15>Emitted(2, 94) Source(1, 22) + SourceIndex(0) -16>Emitted(2, 95) Source(1, 23) + SourceIndex(0) -17>Emitted(2, 100) Source(1, 23) + SourceIndex(0) +1->Emitted(3, 5) Source(1, 10) + SourceIndex(0) +2 >Emitted(3, 9) Source(1, 10) + SourceIndex(0) +3 >Emitted(3, 20) Source(1, 24) + SourceIndex(0) +4 >Emitted(3, 22) Source(1, 11) + SourceIndex(0) +5 >Emitted(3, 32) Source(1, 16) + SourceIndex(0) +6 >Emitted(3, 34) Source(1, 11) + SourceIndex(0) +7 >Emitted(3, 35) Source(1, 12) + SourceIndex(0) +8 >Emitted(3, 54) Source(1, 15) + SourceIndex(0) +9 >Emitted(3, 55) Source(1, 16) + SourceIndex(0) +10>Emitted(3, 60) Source(1, 16) + SourceIndex(0) +11>Emitted(3, 62) Source(1, 18) + SourceIndex(0) +12>Emitted(3, 72) Source(1, 23) + SourceIndex(0) +13>Emitted(3, 74) Source(1, 18) + SourceIndex(0) +14>Emitted(3, 75) Source(1, 19) + SourceIndex(0) +15>Emitted(3, 94) Source(1, 22) + SourceIndex(0) +16>Emitted(3, 95) Source(1, 23) + SourceIndex(0) +17>Emitted(3, 100) Source(1, 23) + SourceIndex(0) --- >>> a; 1 >^^^^ @@ -118,9 +119,9 @@ sourceFile:ES5For-of26.ts > 2 > a 3 > ; -1 >Emitted(3, 5) Source(2, 5) + SourceIndex(0) -2 >Emitted(3, 6) Source(2, 6) + SourceIndex(0) -3 >Emitted(3, 7) Source(2, 7) + SourceIndex(0) +1 >Emitted(4, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(4, 6) Source(2, 6) + SourceIndex(0) +3 >Emitted(4, 7) Source(2, 7) + SourceIndex(0) --- >>> b; 1->^^^^ @@ -130,9 +131,9 @@ sourceFile:ES5For-of26.ts > 2 > b 3 > ; -1->Emitted(4, 5) Source(3, 5) + SourceIndex(0) -2 >Emitted(4, 6) Source(3, 6) + SourceIndex(0) -3 >Emitted(4, 7) Source(3, 7) + SourceIndex(0) +1->Emitted(5, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(5, 6) Source(3, 6) + SourceIndex(0) +3 >Emitted(5, 7) Source(3, 7) + SourceIndex(0) --- >>>} 1 > @@ -141,7 +142,7 @@ sourceFile:ES5For-of26.ts 1 > > 2 >} -1 >Emitted(5, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 2) Source(4, 2) + SourceIndex(0) +1 >Emitted(6, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(6, 2) Source(4, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=ES5For-of26.js.map \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of27(target=es2015).js b/tests/baselines/reference/ES5For-of27(target=es2015).js index 1ca415339df70..d8eb49cb8c747 100644 --- a/tests/baselines/reference/ES5For-of27(target=es2015).js +++ b/tests/baselines/reference/ES5For-of27(target=es2015).js @@ -7,6 +7,7 @@ for (var {x: a = 0, y: b = 1} of [2, 3]) { } //// [ES5For-of27.js] +"use strict"; for (var { x: a = 0, y: b = 1 } of [2, 3]) { a; b; diff --git a/tests/baselines/reference/ES5For-of27(target=es5).js b/tests/baselines/reference/ES5For-of27(target=es5).js index 28110b6177be7..096fc082bf229 100644 --- a/tests/baselines/reference/ES5For-of27(target=es5).js +++ b/tests/baselines/reference/ES5For-of27(target=es5).js @@ -7,6 +7,7 @@ for (var {x: a = 0, y: b = 1} of [2, 3]) { } //// [ES5For-of27.js] +"use strict"; for (var _i = 0, _a = [2, 3]; _i < _a.length; _i++) { var _b = _a[_i], _c = _b.x, a = _c === void 0 ? 0 : _c, _d = _b.y, b = _d === void 0 ? 1 : _d; a; diff --git a/tests/baselines/reference/ES5For-of28(target=es2015).js b/tests/baselines/reference/ES5For-of28(target=es2015).js index c9314fb1830b5..93aaffc4d52da 100644 --- a/tests/baselines/reference/ES5For-of28(target=es2015).js +++ b/tests/baselines/reference/ES5For-of28(target=es2015).js @@ -7,6 +7,7 @@ for (let [a = 0, b = 1] of [2, 3]) { } //// [ES5For-of28.js] +"use strict"; for (let [a = 0, b = 1] of [2, 3]) { a; b; diff --git a/tests/baselines/reference/ES5For-of28(target=es5).js b/tests/baselines/reference/ES5For-of28(target=es5).js index 933f6548a0852..9854cecb24b75 100644 --- a/tests/baselines/reference/ES5For-of28(target=es5).js +++ b/tests/baselines/reference/ES5For-of28(target=es5).js @@ -7,6 +7,7 @@ for (let [a = 0, b = 1] of [2, 3]) { } //// [ES5For-of28.js] +"use strict"; for (var _i = 0, _a = [2, 3]; _i < _a.length; _i++) { var _b = _a[_i], _c = _b[0], a = _c === void 0 ? 0 : _c, _d = _b[1], b = _d === void 0 ? 1 : _d; a; diff --git a/tests/baselines/reference/ES5For-of29(target=es2015).js b/tests/baselines/reference/ES5For-of29(target=es2015).js index ca022d966c1ac..3090950a11032 100644 --- a/tests/baselines/reference/ES5For-of29(target=es2015).js +++ b/tests/baselines/reference/ES5For-of29(target=es2015).js @@ -7,6 +7,7 @@ for (const {x: a = 0, y: b = 1} of [2, 3]) { } //// [ES5For-of29.js] +"use strict"; for (const { x: a = 0, y: b = 1 } of [2, 3]) { a; b; diff --git a/tests/baselines/reference/ES5For-of29(target=es5).js b/tests/baselines/reference/ES5For-of29(target=es5).js index 45c85c38d5915..514a8a4e9558f 100644 --- a/tests/baselines/reference/ES5For-of29(target=es5).js +++ b/tests/baselines/reference/ES5For-of29(target=es5).js @@ -7,6 +7,7 @@ for (const {x: a = 0, y: b = 1} of [2, 3]) { } //// [ES5For-of29.js] +"use strict"; for (var _i = 0, _a = [2, 3]; _i < _a.length; _i++) { var _b = _a[_i], _c = _b.x, a = _c === void 0 ? 0 : _c, _d = _b.y, b = _d === void 0 ? 1 : _d; a; diff --git a/tests/baselines/reference/ES5For-of3(target=es2015).js b/tests/baselines/reference/ES5For-of3(target=es2015).js index e44cd90361a76..56216081fba45 100644 --- a/tests/baselines/reference/ES5For-of3(target=es2015).js +++ b/tests/baselines/reference/ES5For-of3(target=es2015).js @@ -5,6 +5,7 @@ for (var v of ['a', 'b', 'c']) var x = v; //// [ES5For-of3.js] +"use strict"; for (var v of ['a', 'b', 'c']) var x = v; //# sourceMappingURL=ES5For-of3.js.map \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of3(target=es2015).js.map b/tests/baselines/reference/ES5For-of3(target=es2015).js.map index 429f6596ae844..ea6f6c9375af7 100644 --- a/tests/baselines/reference/ES5For-of3(target=es2015).js.map +++ b/tests/baselines/reference/ES5For-of3(target=es2015).js.map @@ -1,3 +1,3 @@ //// [ES5For-of3.js.map] -{"version":3,"file":"ES5For-of3.js","sourceRoot":"","sources":["ES5For-of3.ts"],"names":[],"mappings":"AAAA,KAAK,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IACzB,IAAI,CAAC,GAAG,CAAC,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,Zm9yICh2YXIgdiBvZiBbJ2EnLCAnYicsICdjJ10pDQogICAgdmFyIHggPSB2Ow0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9RVM1Rm9yLW9mMy5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIkVTNUZvci1vZjMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsS0FBSyxJQUFJLENBQUMsSUFBSSxDQUFDLEdBQUcsRUFBRSxHQUFHLEVBQUUsR0FBRyxDQUFDO0lBQ3pCLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQyJ9,Zm9yICh2YXIgdiBvZiBbJ2EnLCAnYicsICdjJ10pCiAgICB2YXIgeCA9IHY7 +{"version":3,"file":"ES5For-of3.js","sourceRoot":"","sources":["ES5For-of3.ts"],"names":[],"mappings":";AAAA,KAAK,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IACzB,IAAI,CAAC,GAAG,CAAC,CAAC"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KZm9yICh2YXIgdiBvZiBbJ2EnLCAnYicsICdjJ10pDQogICAgdmFyIHggPSB2Ow0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9RVM1Rm9yLW9mMy5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIkVTNUZvci1vZjMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLEtBQUssSUFBSSxDQUFDLElBQUksQ0FBQyxHQUFHLEVBQUUsR0FBRyxFQUFFLEdBQUcsQ0FBQztJQUN6QixJQUFJLENBQUMsR0FBRyxDQUFDLENBQUMifQ==,Zm9yICh2YXIgdiBvZiBbJ2EnLCAnYicsICdjJ10pCiAgICB2YXIgeCA9IHY7 diff --git a/tests/baselines/reference/ES5For-of3(target=es2015).sourcemap.txt b/tests/baselines/reference/ES5For-of3(target=es2015).sourcemap.txt index 997427799cd70..b665e4b6cec3d 100644 --- a/tests/baselines/reference/ES5For-of3(target=es2015).sourcemap.txt +++ b/tests/baselines/reference/ES5For-of3(target=es2015).sourcemap.txt @@ -8,6 +8,7 @@ sources: ES5For-of3.ts emittedFile:ES5For-of3.js sourceFile:ES5For-of3.ts ------------------------------------------------------------------- +>>>"use strict"; >>>for (var v of ['a', 'b', 'c']) 1 > 2 >^^^^^ @@ -33,18 +34,18 @@ sourceFile:ES5For-of3.ts 10> , 11> 'c' 12> ] -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) -7 >Emitted(1, 19) Source(1, 19) + SourceIndex(0) -8 >Emitted(1, 21) Source(1, 21) + SourceIndex(0) -9 >Emitted(1, 24) Source(1, 24) + SourceIndex(0) -10>Emitted(1, 26) Source(1, 26) + SourceIndex(0) -11>Emitted(1, 29) Source(1, 29) + SourceIndex(0) -12>Emitted(1, 30) Source(1, 30) + SourceIndex(0) +1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 6) Source(1, 6) + SourceIndex(0) +3 >Emitted(2, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(2, 11) Source(1, 11) + SourceIndex(0) +5 >Emitted(2, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(2, 16) Source(1, 16) + SourceIndex(0) +7 >Emitted(2, 19) Source(1, 19) + SourceIndex(0) +8 >Emitted(2, 21) Source(1, 21) + SourceIndex(0) +9 >Emitted(2, 24) Source(1, 24) + SourceIndex(0) +10>Emitted(2, 26) Source(1, 26) + SourceIndex(0) +11>Emitted(2, 29) Source(1, 29) + SourceIndex(0) +12>Emitted(2, 30) Source(1, 30) + SourceIndex(0) --- >>> var x = v; 1 >^^^^ @@ -61,11 +62,11 @@ sourceFile:ES5For-of3.ts 4 > = 5 > v 6 > ; -1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -2 >Emitted(2, 9) Source(2, 9) + SourceIndex(0) -3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -4 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) -5 >Emitted(2, 14) Source(2, 14) + SourceIndex(0) -6 >Emitted(2, 15) Source(2, 15) + SourceIndex(0) +1 >Emitted(3, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 9) + SourceIndex(0) +3 >Emitted(3, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(3, 13) Source(2, 13) + SourceIndex(0) +5 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) +6 >Emitted(3, 15) Source(2, 15) + SourceIndex(0) --- >>>//# sourceMappingURL=ES5For-of3.js.map \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of3(target=es5).js b/tests/baselines/reference/ES5For-of3(target=es5).js index 52cc54f782292..7e53eda0ea8b9 100644 --- a/tests/baselines/reference/ES5For-of3(target=es5).js +++ b/tests/baselines/reference/ES5For-of3(target=es5).js @@ -5,6 +5,7 @@ for (var v of ['a', 'b', 'c']) var x = v; //// [ES5For-of3.js] +"use strict"; for (var _i = 0, _a = ['a', 'b', 'c']; _i < _a.length; _i++) { var v = _a[_i]; var x = v; diff --git a/tests/baselines/reference/ES5For-of3(target=es5).js.map b/tests/baselines/reference/ES5For-of3(target=es5).js.map index 30e3849793b2f..58f19269bea2a 100644 --- a/tests/baselines/reference/ES5For-of3(target=es5).js.map +++ b/tests/baselines/reference/ES5For-of3(target=es5).js.map @@ -1,3 +1,3 @@ //// [ES5For-of3.js.map] -{"version":3,"file":"ES5For-of3.js","sourceRoot":"","sources":["ES5For-of3.ts"],"names":[],"mappings":"AAAA,KAAc,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAf,cAAe,EAAf,IAAe;IAAxB,IAAI,CAAC,SAAA;IACN,IAAI,CAAC,GAAG,CAAC,CAAC;CAAA"} -//// https://sokra.github.io/source-map-visualization#base64,Zm9yICh2YXIgX2kgPSAwLCBfYSA9IFsnYScsICdiJywgJ2MnXTsgX2kgPCBfYS5sZW5ndGg7IF9pKyspIHsNCiAgICB2YXIgdiA9IF9hW19pXTsNCiAgICB2YXIgeCA9IHY7DQp9DQovLyMgc291cmNlTWFwcGluZ1VSTD1FUzVGb3Itb2YzLmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIkVTNUZvci1vZjMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsS0FBYyxVQUFlLEVBQWYsTUFBQyxHQUFHLEVBQUUsR0FBRyxFQUFFLEdBQUcsQ0FBQyxFQUFmLGNBQWUsRUFBZixJQUFlO0lBQXhCLElBQUksQ0FBQyxTQUFBO0lBQ04sSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDO0NBQUEifQ==,Zm9yICh2YXIgdiBvZiBbJ2EnLCAnYicsICdjJ10pCiAgICB2YXIgeCA9IHY7 +{"version":3,"file":"ES5For-of3.js","sourceRoot":"","sources":["ES5For-of3.ts"],"names":[],"mappings":";AAAA,KAAc,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAf,cAAe,EAAf,IAAe;IAAxB,IAAI,CAAC,SAAA;IACN,IAAI,CAAC,GAAG,CAAC,CAAC;CAAA"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KZm9yICh2YXIgX2kgPSAwLCBfYSA9IFsnYScsICdiJywgJ2MnXTsgX2kgPCBfYS5sZW5ndGg7IF9pKyspIHsNCiAgICB2YXIgdiA9IF9hW19pXTsNCiAgICB2YXIgeCA9IHY7DQp9DQovLyMgc291cmNlTWFwcGluZ1VSTD1FUzVGb3Itb2YzLmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIkVTNUZvci1vZjMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLEtBQWMsVUFBZSxFQUFmLE1BQUMsR0FBRyxFQUFFLEdBQUcsRUFBRSxHQUFHLENBQUMsRUFBZixjQUFlLEVBQWYsSUFBZTtJQUF4QixJQUFJLENBQUMsU0FBQTtJQUNOLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQztDQUFBIn0=,Zm9yICh2YXIgdiBvZiBbJ2EnLCAnYicsICdjJ10pCiAgICB2YXIgeCA9IHY7 diff --git a/tests/baselines/reference/ES5For-of3(target=es5).sourcemap.txt b/tests/baselines/reference/ES5For-of3(target=es5).sourcemap.txt index 7eb273f86b381..dd9aecb992332 100644 --- a/tests/baselines/reference/ES5For-of3(target=es5).sourcemap.txt +++ b/tests/baselines/reference/ES5For-of3(target=es5).sourcemap.txt @@ -8,6 +8,7 @@ sources: ES5For-of3.ts emittedFile:ES5For-of3.js sourceFile:ES5For-of3.ts ------------------------------------------------------------------- +>>>"use strict"; >>>for (var _i = 0, _a = ['a', 'b', 'c']; _i < _a.length; _i++) { 1 > 2 >^^^^^ @@ -39,21 +40,21 @@ sourceFile:ES5For-of3.ts 13> ['a', 'b', 'c'] 14> 15> ['a', 'b', 'c'] -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 6) Source(1, 15) + SourceIndex(0) -3 >Emitted(1, 16) Source(1, 30) + SourceIndex(0) -4 >Emitted(1, 18) Source(1, 15) + SourceIndex(0) -5 >Emitted(1, 24) Source(1, 16) + SourceIndex(0) -6 >Emitted(1, 27) Source(1, 19) + SourceIndex(0) -7 >Emitted(1, 29) Source(1, 21) + SourceIndex(0) -8 >Emitted(1, 32) Source(1, 24) + SourceIndex(0) -9 >Emitted(1, 34) Source(1, 26) + SourceIndex(0) -10>Emitted(1, 37) Source(1, 29) + SourceIndex(0) -11>Emitted(1, 38) Source(1, 30) + SourceIndex(0) -12>Emitted(1, 40) Source(1, 15) + SourceIndex(0) -13>Emitted(1, 54) Source(1, 30) + SourceIndex(0) -14>Emitted(1, 56) Source(1, 15) + SourceIndex(0) -15>Emitted(1, 60) Source(1, 30) + SourceIndex(0) +1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 6) Source(1, 15) + SourceIndex(0) +3 >Emitted(2, 16) Source(1, 30) + SourceIndex(0) +4 >Emitted(2, 18) Source(1, 15) + SourceIndex(0) +5 >Emitted(2, 24) Source(1, 16) + SourceIndex(0) +6 >Emitted(2, 27) Source(1, 19) + SourceIndex(0) +7 >Emitted(2, 29) Source(1, 21) + SourceIndex(0) +8 >Emitted(2, 32) Source(1, 24) + SourceIndex(0) +9 >Emitted(2, 34) Source(1, 26) + SourceIndex(0) +10>Emitted(2, 37) Source(1, 29) + SourceIndex(0) +11>Emitted(2, 38) Source(1, 30) + SourceIndex(0) +12>Emitted(2, 40) Source(1, 15) + SourceIndex(0) +13>Emitted(2, 54) Source(1, 30) + SourceIndex(0) +14>Emitted(2, 56) Source(1, 15) + SourceIndex(0) +15>Emitted(2, 60) Source(1, 30) + SourceIndex(0) --- >>> var v = _a[_i]; 1 >^^^^ @@ -64,10 +65,10 @@ sourceFile:ES5For-of3.ts 2 > var 3 > v 4 > -1 >Emitted(2, 5) Source(1, 6) + SourceIndex(0) -2 >Emitted(2, 9) Source(1, 10) + SourceIndex(0) -3 >Emitted(2, 10) Source(1, 11) + SourceIndex(0) -4 >Emitted(2, 19) Source(1, 11) + SourceIndex(0) +1 >Emitted(3, 5) Source(1, 6) + SourceIndex(0) +2 >Emitted(3, 9) Source(1, 10) + SourceIndex(0) +3 >Emitted(3, 10) Source(1, 11) + SourceIndex(0) +4 >Emitted(3, 19) Source(1, 11) + SourceIndex(0) --- >>> var x = v; 1 >^^^^ @@ -83,17 +84,17 @@ sourceFile:ES5For-of3.ts 4 > = 5 > v 6 > ; -1 >Emitted(3, 5) Source(2, 5) + SourceIndex(0) -2 >Emitted(3, 9) Source(2, 9) + SourceIndex(0) -3 >Emitted(3, 10) Source(2, 10) + SourceIndex(0) -4 >Emitted(3, 13) Source(2, 13) + SourceIndex(0) -5 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) -6 >Emitted(3, 15) Source(2, 15) + SourceIndex(0) +1 >Emitted(4, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(4, 9) Source(2, 9) + SourceIndex(0) +3 >Emitted(4, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(4, 13) Source(2, 13) + SourceIndex(0) +5 >Emitted(4, 14) Source(2, 14) + SourceIndex(0) +6 >Emitted(4, 15) Source(2, 15) + SourceIndex(0) --- >>>} 1 >^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > -1 >Emitted(4, 2) Source(2, 15) + SourceIndex(0) +1 >Emitted(5, 2) Source(2, 15) + SourceIndex(0) --- >>>//# sourceMappingURL=ES5For-of3.js.map \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of30(target=es2015).js b/tests/baselines/reference/ES5For-of30(target=es2015).js index 60cb68e48134c..8f3cacca37d83 100644 --- a/tests/baselines/reference/ES5For-of30(target=es2015).js +++ b/tests/baselines/reference/ES5For-of30(target=es2015).js @@ -9,6 +9,7 @@ for ([a = 1, b = ""] of tuple) { } //// [ES5For-of30.js] +"use strict"; var a, b; var tuple = [2, "3"]; for ([a = 1, b = ""] of tuple) { diff --git a/tests/baselines/reference/ES5For-of30(target=es5).js b/tests/baselines/reference/ES5For-of30(target=es5).js index 55560203cd207..9f353c3ad5863 100644 --- a/tests/baselines/reference/ES5For-of30(target=es5).js +++ b/tests/baselines/reference/ES5For-of30(target=es5).js @@ -9,6 +9,7 @@ for ([a = 1, b = ""] of tuple) { } //// [ES5For-of30.js] +"use strict"; var _a, _b, _c; var a, b; var tuple = [2, "3"]; diff --git a/tests/baselines/reference/ES5For-of31(target=es2015).errors.txt b/tests/baselines/reference/ES5For-of31(target=es2015).errors.txt deleted file mode 100644 index 2c311153ffc35..0000000000000 --- a/tests/baselines/reference/ES5For-of31(target=es2015).errors.txt +++ /dev/null @@ -1,15 +0,0 @@ -ES5For-of31.ts(3,8): error TS2339: Property 'a' does not exist on type 'undefined'. -ES5For-of31.ts(3,18): error TS2339: Property 'b' does not exist on type 'undefined'. - - -==== ES5For-of31.ts (2 errors) ==== - var a: string, b: number; - - for ({ a: b = 1, b: a = ""} of []) { - ~ -!!! error TS2339: Property 'a' does not exist on type 'undefined'. - ~ -!!! error TS2339: Property 'b' does not exist on type 'undefined'. - a; - b; - } \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of31(target=es2015).js b/tests/baselines/reference/ES5For-of31(target=es2015).js index 0edabe9531fea..fb29c2134e9c4 100644 --- a/tests/baselines/reference/ES5For-of31(target=es2015).js +++ b/tests/baselines/reference/ES5For-of31(target=es2015).js @@ -9,6 +9,7 @@ for ({ a: b = 1, b: a = ""} of []) { } //// [ES5For-of31.js] +"use strict"; var a, b; for ({ a: b = 1, b: a = "" } of []) { a; diff --git a/tests/baselines/reference/ES5For-of31(target=es2015).types b/tests/baselines/reference/ES5For-of31(target=es2015).types index 7dc4c17850c8b..0a8da07588207 100644 --- a/tests/baselines/reference/ES5For-of31(target=es2015).types +++ b/tests/baselines/reference/ES5For-of31(target=es2015).types @@ -26,8 +26,8 @@ for ({ a: b = 1, b: a = ""} of []) { > : ^^^^^^ >"" : "" > : ^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ a; >a : string diff --git a/tests/baselines/reference/ES5For-of31(target=es5).errors.txt b/tests/baselines/reference/ES5For-of31(target=es5).errors.txt index f023f3187d960..03c749832a4cd 100644 --- a/tests/baselines/reference/ES5For-of31(target=es5).errors.txt +++ b/tests/baselines/reference/ES5For-of31(target=es5).errors.txt @@ -1,17 +1,11 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -ES5For-of31.ts(3,8): error TS2339: Property 'a' does not exist on type 'undefined'. -ES5For-of31.ts(3,18): error TS2339: Property 'b' does not exist on type 'undefined'. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== ES5For-of31.ts (2 errors) ==== +==== ES5For-of31.ts (0 errors) ==== var a: string, b: number; for ({ a: b = 1, b: a = ""} of []) { - ~ -!!! error TS2339: Property 'a' does not exist on type 'undefined'. - ~ -!!! error TS2339: Property 'b' does not exist on type 'undefined'. a; b; } \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of31(target=es5).js b/tests/baselines/reference/ES5For-of31(target=es5).js index 4a6b9536483b6..2d8a5de7c94c7 100644 --- a/tests/baselines/reference/ES5For-of31(target=es5).js +++ b/tests/baselines/reference/ES5For-of31(target=es5).js @@ -9,6 +9,7 @@ for ({ a: b = 1, b: a = ""} of []) { } //// [ES5For-of31.js] +"use strict"; var _a, _b, _c; var a, b; for (var _i = 0, _d = []; _i < _d.length; _i++) { diff --git a/tests/baselines/reference/ES5For-of31(target=es5).types b/tests/baselines/reference/ES5For-of31(target=es5).types index 7dc4c17850c8b..0a8da07588207 100644 --- a/tests/baselines/reference/ES5For-of31(target=es5).types +++ b/tests/baselines/reference/ES5For-of31(target=es5).types @@ -26,8 +26,8 @@ for ({ a: b = 1, b: a = ""} of []) { > : ^^^^^^ >"" : "" > : ^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ a; >a : string diff --git a/tests/baselines/reference/ES5For-of33(target=es2015).js b/tests/baselines/reference/ES5For-of33(target=es2015).js index fcd852d9a96e8..72e9e2fc3c8b9 100644 --- a/tests/baselines/reference/ES5For-of33(target=es2015).js +++ b/tests/baselines/reference/ES5For-of33(target=es2015).js @@ -6,6 +6,7 @@ for (var v of ['a', 'b', 'c']) { } //// [ES5For-of33.js] +"use strict"; for (var v of ['a', 'b', 'c']) { console.log(v); } diff --git a/tests/baselines/reference/ES5For-of33(target=es2015).js.map b/tests/baselines/reference/ES5For-of33(target=es2015).js.map index 1a0671a3d8b5c..d4a1e2fbc4e51 100644 --- a/tests/baselines/reference/ES5For-of33(target=es2015).js.map +++ b/tests/baselines/reference/ES5For-of33(target=es2015).js.map @@ -1,3 +1,3 @@ //// [ES5For-of33.js.map] -{"version":3,"file":"ES5For-of33.js","sourceRoot":"","sources":["ES5For-of33.ts"],"names":[],"mappings":"AAAA,KAAK,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IAC5B,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACnB,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,Zm9yICh2YXIgdiBvZiBbJ2EnLCAnYicsICdjJ10pIHsNCiAgICBjb25zb2xlLmxvZyh2KTsNCn0NCi8vIyBzb3VyY2VNYXBwaW5nVVJMPUVTNUZvci1vZjMzLmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMzMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YzMy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxLQUFLLElBQUksQ0FBQyxJQUFJLENBQUMsR0FBRyxFQUFFLEdBQUcsRUFBRSxHQUFHLENBQUMsRUFBRSxDQUFDO0lBQzVCLE9BQU8sQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDbkIsQ0FBQyJ9,Zm9yICh2YXIgdiBvZiBbJ2EnLCAnYicsICdjJ10pIHsKICAgIGNvbnNvbGUubG9nKHYpOwp9 +{"version":3,"file":"ES5For-of33.js","sourceRoot":"","sources":["ES5For-of33.ts"],"names":[],"mappings":";AAAA,KAAK,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IAC5B,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACnB,CAAC"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KZm9yICh2YXIgdiBvZiBbJ2EnLCAnYicsICdjJ10pIHsNCiAgICBjb25zb2xlLmxvZyh2KTsNCn0NCi8vIyBzb3VyY2VNYXBwaW5nVVJMPUVTNUZvci1vZjMzLmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMzMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YzMy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsS0FBSyxJQUFJLENBQUMsSUFBSSxDQUFDLEdBQUcsRUFBRSxHQUFHLEVBQUUsR0FBRyxDQUFDLEVBQUUsQ0FBQztJQUM1QixPQUFPLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ25CLENBQUMifQ==,Zm9yICh2YXIgdiBvZiBbJ2EnLCAnYicsICdjJ10pIHsKICAgIGNvbnNvbGUubG9nKHYpOwp9 diff --git a/tests/baselines/reference/ES5For-of33(target=es2015).sourcemap.txt b/tests/baselines/reference/ES5For-of33(target=es2015).sourcemap.txt index 1b33263a0705d..7a0d0f21b1473 100644 --- a/tests/baselines/reference/ES5For-of33(target=es2015).sourcemap.txt +++ b/tests/baselines/reference/ES5For-of33(target=es2015).sourcemap.txt @@ -8,6 +8,7 @@ sources: ES5For-of33.ts emittedFile:ES5For-of33.js sourceFile:ES5For-of33.ts ------------------------------------------------------------------- +>>>"use strict"; >>>for (var v of ['a', 'b', 'c']) { 1 > 2 >^^^^^ @@ -37,20 +38,20 @@ sourceFile:ES5For-of33.ts 12> ] 13> ) 14> { -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) -7 >Emitted(1, 19) Source(1, 19) + SourceIndex(0) -8 >Emitted(1, 21) Source(1, 21) + SourceIndex(0) -9 >Emitted(1, 24) Source(1, 24) + SourceIndex(0) -10>Emitted(1, 26) Source(1, 26) + SourceIndex(0) -11>Emitted(1, 29) Source(1, 29) + SourceIndex(0) -12>Emitted(1, 30) Source(1, 30) + SourceIndex(0) -13>Emitted(1, 32) Source(1, 32) + SourceIndex(0) -14>Emitted(1, 33) Source(1, 33) + SourceIndex(0) +1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 6) Source(1, 6) + SourceIndex(0) +3 >Emitted(2, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(2, 11) Source(1, 11) + SourceIndex(0) +5 >Emitted(2, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(2, 16) Source(1, 16) + SourceIndex(0) +7 >Emitted(2, 19) Source(1, 19) + SourceIndex(0) +8 >Emitted(2, 21) Source(1, 21) + SourceIndex(0) +9 >Emitted(2, 24) Source(1, 24) + SourceIndex(0) +10>Emitted(2, 26) Source(1, 26) + SourceIndex(0) +11>Emitted(2, 29) Source(1, 29) + SourceIndex(0) +12>Emitted(2, 30) Source(1, 30) + SourceIndex(0) +13>Emitted(2, 32) Source(1, 32) + SourceIndex(0) +14>Emitted(2, 33) Source(1, 33) + SourceIndex(0) --- >>> console.log(v); 1 >^^^^ @@ -70,14 +71,14 @@ sourceFile:ES5For-of33.ts 6 > v 7 > ) 8 > ; -1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -2 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -3 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) -4 >Emitted(2, 16) Source(2, 16) + SourceIndex(0) -5 >Emitted(2, 17) Source(2, 17) + SourceIndex(0) -6 >Emitted(2, 18) Source(2, 18) + SourceIndex(0) -7 >Emitted(2, 19) Source(2, 19) + SourceIndex(0) -8 >Emitted(2, 20) Source(2, 20) + SourceIndex(0) +1 >Emitted(3, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(3, 12) Source(2, 12) + SourceIndex(0) +3 >Emitted(3, 13) Source(2, 13) + SourceIndex(0) +4 >Emitted(3, 16) Source(2, 16) + SourceIndex(0) +5 >Emitted(3, 17) Source(2, 17) + SourceIndex(0) +6 >Emitted(3, 18) Source(2, 18) + SourceIndex(0) +7 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) +8 >Emitted(3, 20) Source(2, 20) + SourceIndex(0) --- >>>} 1 > @@ -86,7 +87,7 @@ sourceFile:ES5For-of33.ts 1 > > 2 >} -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 2) Source(3, 2) + SourceIndex(0) +1 >Emitted(4, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(4, 2) Source(3, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=ES5For-of33.js.map \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of33(target=es5).js b/tests/baselines/reference/ES5For-of33(target=es5).js index 87eb158b1af2b..58561a1ea060b 100644 --- a/tests/baselines/reference/ES5For-of33(target=es5).js +++ b/tests/baselines/reference/ES5For-of33(target=es5).js @@ -6,6 +6,7 @@ for (var v of ['a', 'b', 'c']) { } //// [ES5For-of33.js] +"use strict"; var __values = (this && this.__values) || function(o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); diff --git a/tests/baselines/reference/ES5For-of33(target=es5).js.map b/tests/baselines/reference/ES5For-of33(target=es5).js.map index baf12a8a190ec..076c26007c48c 100644 --- a/tests/baselines/reference/ES5For-of33(target=es5).js.map +++ b/tests/baselines/reference/ES5For-of33(target=es5).js.map @@ -1,3 +1,3 @@ //// [ES5For-of33.js.map] -{"version":3,"file":"ES5For-of33.js","sourceRoot":"","sources":["ES5For-of33.ts"],"names":[],"mappings":";;;;;;;;;;;;;IAAA,KAAc,IAAA,KAAA,SAAA,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA,gBAAA,4BAAE,CAAC;QAA3B,IAAI,CAAC,WAAA;QACN,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,dmFyIF9fdmFsdWVzID0gKHRoaXMgJiYgdGhpcy5fX3ZhbHVlcykgfHwgZnVuY3Rpb24obykgew0KICAgIHZhciBzID0gdHlwZW9mIFN5bWJvbCA9PT0gImZ1bmN0aW9uIiAmJiBTeW1ib2wuaXRlcmF0b3IsIG0gPSBzICYmIG9bc10sIGkgPSAwOw0KICAgIGlmIChtKSByZXR1cm4gbS5jYWxsKG8pOw0KICAgIGlmIChvICYmIHR5cGVvZiBvLmxlbmd0aCA9PT0gIm51bWJlciIpIHJldHVybiB7DQogICAgICAgIG5leHQ6IGZ1bmN0aW9uICgpIHsNCiAgICAgICAgICAgIGlmIChvICYmIGkgPj0gby5sZW5ndGgpIG8gPSB2b2lkIDA7DQogICAgICAgICAgICByZXR1cm4geyB2YWx1ZTogbyAmJiBvW2krK10sIGRvbmU6ICFvIH07DQogICAgICAgIH0NCiAgICB9Ow0KICAgIHRocm93IG5ldyBUeXBlRXJyb3IocyA/ICJPYmplY3QgaXMgbm90IGl0ZXJhYmxlLiIgOiAiU3ltYm9sLml0ZXJhdG9yIGlzIG5vdCBkZWZpbmVkLiIpOw0KfTsNCnZhciBlXzEsIF9hOw0KdHJ5IHsNCiAgICBmb3IgKHZhciBfYiA9IF9fdmFsdWVzKFsnYScsICdiJywgJ2MnXSksIF9jID0gX2IubmV4dCgpOyAhX2MuZG9uZTsgX2MgPSBfYi5uZXh0KCkpIHsNCiAgICAgICAgdmFyIHYgPSBfYy52YWx1ZTsNCiAgICAgICAgY29uc29sZS5sb2codik7DQogICAgfQ0KfQ0KY2F0Y2ggKGVfMV8xKSB7IGVfMSA9IHsgZXJyb3I6IGVfMV8xIH07IH0NCmZpbmFsbHkgew0KICAgIHRyeSB7DQogICAgICAgIGlmIChfYyAmJiAhX2MuZG9uZSAmJiAoX2EgPSBfYi5yZXR1cm4pKSBfYS5jYWxsKF9iKTsNCiAgICB9DQogICAgZmluYWxseSB7IGlmIChlXzEpIHRocm93IGVfMS5lcnJvcjsgfQ0KfQ0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9RVM1Rm9yLW9mMzMuanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMzMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YzMy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7O0lBQUEsS0FBYyxJQUFBLEtBQUEsU0FBQSxDQUFDLEdBQUcsRUFBRSxHQUFHLEVBQUUsR0FBRyxDQUFDLENBQUEsZ0JBQUEsNEJBQUUsQ0FBQztRQUEzQixJQUFJLENBQUMsV0FBQTtRQUNOLE9BQU8sQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUM7SUFDbkIsQ0FBQyJ9,Zm9yICh2YXIgdiBvZiBbJ2EnLCAnYicsICdjJ10pIHsKICAgIGNvbnNvbGUubG9nKHYpOwp9 +{"version":3,"file":"ES5For-of33.js","sourceRoot":"","sources":["ES5For-of33.ts"],"names":[],"mappings":";;;;;;;;;;;;;;IAAA,KAAc,IAAA,KAAA,SAAA,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA,gBAAA,4BAAE,CAAC;QAA3B,IAAI,CAAC,WAAA;QACN,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KdmFyIF9fdmFsdWVzID0gKHRoaXMgJiYgdGhpcy5fX3ZhbHVlcykgfHwgZnVuY3Rpb24obykgew0KICAgIHZhciBzID0gdHlwZW9mIFN5bWJvbCA9PT0gImZ1bmN0aW9uIiAmJiBTeW1ib2wuaXRlcmF0b3IsIG0gPSBzICYmIG9bc10sIGkgPSAwOw0KICAgIGlmIChtKSByZXR1cm4gbS5jYWxsKG8pOw0KICAgIGlmIChvICYmIHR5cGVvZiBvLmxlbmd0aCA9PT0gIm51bWJlciIpIHJldHVybiB7DQogICAgICAgIG5leHQ6IGZ1bmN0aW9uICgpIHsNCiAgICAgICAgICAgIGlmIChvICYmIGkgPj0gby5sZW5ndGgpIG8gPSB2b2lkIDA7DQogICAgICAgICAgICByZXR1cm4geyB2YWx1ZTogbyAmJiBvW2krK10sIGRvbmU6ICFvIH07DQogICAgICAgIH0NCiAgICB9Ow0KICAgIHRocm93IG5ldyBUeXBlRXJyb3IocyA/ICJPYmplY3QgaXMgbm90IGl0ZXJhYmxlLiIgOiAiU3ltYm9sLml0ZXJhdG9yIGlzIG5vdCBkZWZpbmVkLiIpOw0KfTsNCnZhciBlXzEsIF9hOw0KdHJ5IHsNCiAgICBmb3IgKHZhciBfYiA9IF9fdmFsdWVzKFsnYScsICdiJywgJ2MnXSksIF9jID0gX2IubmV4dCgpOyAhX2MuZG9uZTsgX2MgPSBfYi5uZXh0KCkpIHsNCiAgICAgICAgdmFyIHYgPSBfYy52YWx1ZTsNCiAgICAgICAgY29uc29sZS5sb2codik7DQogICAgfQ0KfQ0KY2F0Y2ggKGVfMV8xKSB7IGVfMSA9IHsgZXJyb3I6IGVfMV8xIH07IH0NCmZpbmFsbHkgew0KICAgIHRyeSB7DQogICAgICAgIGlmIChfYyAmJiAhX2MuZG9uZSAmJiAoX2EgPSBfYi5yZXR1cm4pKSBfYS5jYWxsKF9iKTsNCiAgICB9DQogICAgZmluYWxseSB7IGlmIChlXzEpIHRocm93IGVfMS5lcnJvcjsgfQ0KfQ0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9RVM1Rm9yLW9mMzMuanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMzMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YzMy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7OztJQUFBLEtBQWMsSUFBQSxLQUFBLFNBQUEsQ0FBQyxHQUFHLEVBQUUsR0FBRyxFQUFFLEdBQUcsQ0FBQyxDQUFBLGdCQUFBLDRCQUFFLENBQUM7UUFBM0IsSUFBSSxDQUFDLFdBQUE7UUFDTixPQUFPLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDO0lBQ25CLENBQUMifQ==,Zm9yICh2YXIgdiBvZiBbJ2EnLCAnYicsICdjJ10pIHsKICAgIGNvbnNvbGUubG9nKHYpOwp9 diff --git a/tests/baselines/reference/ES5For-of33(target=es5).sourcemap.txt b/tests/baselines/reference/ES5For-of33(target=es5).sourcemap.txt index dcda7cd0c6fa0..9e87f7b90f211 100644 --- a/tests/baselines/reference/ES5For-of33(target=es5).sourcemap.txt +++ b/tests/baselines/reference/ES5For-of33(target=es5).sourcemap.txt @@ -8,6 +8,7 @@ sources: ES5For-of33.ts emittedFile:ES5For-of33.js sourceFile:ES5For-of33.ts ------------------------------------------------------------------- +>>>"use strict"; >>>var __values = (this && this.__values) || function(o) { >>> var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; >>> if (m) return m.call(o); @@ -54,22 +55,22 @@ sourceFile:ES5For-of33.ts 14> 15> ) 16> { -1 >Emitted(14, 5) Source(1, 1) + SourceIndex(0) -2 >Emitted(14, 10) Source(1, 15) + SourceIndex(0) -3 >Emitted(14, 14) Source(1, 15) + SourceIndex(0) -4 >Emitted(14, 19) Source(1, 15) + SourceIndex(0) -5 >Emitted(14, 28) Source(1, 15) + SourceIndex(0) -6 >Emitted(14, 29) Source(1, 16) + SourceIndex(0) -7 >Emitted(14, 32) Source(1, 19) + SourceIndex(0) -8 >Emitted(14, 34) Source(1, 21) + SourceIndex(0) -9 >Emitted(14, 37) Source(1, 24) + SourceIndex(0) -10>Emitted(14, 39) Source(1, 26) + SourceIndex(0) -11>Emitted(14, 42) Source(1, 29) + SourceIndex(0) -12>Emitted(14, 43) Source(1, 30) + SourceIndex(0) -13>Emitted(14, 44) Source(1, 30) + SourceIndex(0) -14>Emitted(14, 60) Source(1, 30) + SourceIndex(0) -15>Emitted(14, 88) Source(1, 32) + SourceIndex(0) -16>Emitted(14, 89) Source(1, 33) + SourceIndex(0) +1 >Emitted(15, 5) Source(1, 1) + SourceIndex(0) +2 >Emitted(15, 10) Source(1, 15) + SourceIndex(0) +3 >Emitted(15, 14) Source(1, 15) + SourceIndex(0) +4 >Emitted(15, 19) Source(1, 15) + SourceIndex(0) +5 >Emitted(15, 28) Source(1, 15) + SourceIndex(0) +6 >Emitted(15, 29) Source(1, 16) + SourceIndex(0) +7 >Emitted(15, 32) Source(1, 19) + SourceIndex(0) +8 >Emitted(15, 34) Source(1, 21) + SourceIndex(0) +9 >Emitted(15, 37) Source(1, 24) + SourceIndex(0) +10>Emitted(15, 39) Source(1, 26) + SourceIndex(0) +11>Emitted(15, 42) Source(1, 29) + SourceIndex(0) +12>Emitted(15, 43) Source(1, 30) + SourceIndex(0) +13>Emitted(15, 44) Source(1, 30) + SourceIndex(0) +14>Emitted(15, 60) Source(1, 30) + SourceIndex(0) +15>Emitted(15, 88) Source(1, 32) + SourceIndex(0) +16>Emitted(15, 89) Source(1, 33) + SourceIndex(0) --- >>> var v = _c.value; 1 >^^^^^^^^ @@ -80,10 +81,10 @@ sourceFile:ES5For-of33.ts 2 > var 3 > v 4 > -1 >Emitted(15, 9) Source(1, 6) + SourceIndex(0) -2 >Emitted(15, 13) Source(1, 10) + SourceIndex(0) -3 >Emitted(15, 14) Source(1, 11) + SourceIndex(0) -4 >Emitted(15, 25) Source(1, 11) + SourceIndex(0) +1 >Emitted(16, 9) Source(1, 6) + SourceIndex(0) +2 >Emitted(16, 13) Source(1, 10) + SourceIndex(0) +3 >Emitted(16, 14) Source(1, 11) + SourceIndex(0) +4 >Emitted(16, 25) Source(1, 11) + SourceIndex(0) --- >>> console.log(v); 1 >^^^^^^^^ @@ -103,14 +104,14 @@ sourceFile:ES5For-of33.ts 6 > v 7 > ) 8 > ; -1 >Emitted(16, 9) Source(2, 5) + SourceIndex(0) -2 >Emitted(16, 16) Source(2, 12) + SourceIndex(0) -3 >Emitted(16, 17) Source(2, 13) + SourceIndex(0) -4 >Emitted(16, 20) Source(2, 16) + SourceIndex(0) -5 >Emitted(16, 21) Source(2, 17) + SourceIndex(0) -6 >Emitted(16, 22) Source(2, 18) + SourceIndex(0) -7 >Emitted(16, 23) Source(2, 19) + SourceIndex(0) -8 >Emitted(16, 24) Source(2, 20) + SourceIndex(0) +1 >Emitted(17, 9) Source(2, 5) + SourceIndex(0) +2 >Emitted(17, 16) Source(2, 12) + SourceIndex(0) +3 >Emitted(17, 17) Source(2, 13) + SourceIndex(0) +4 >Emitted(17, 20) Source(2, 16) + SourceIndex(0) +5 >Emitted(17, 21) Source(2, 17) + SourceIndex(0) +6 >Emitted(17, 22) Source(2, 18) + SourceIndex(0) +7 >Emitted(17, 23) Source(2, 19) + SourceIndex(0) +8 >Emitted(17, 24) Source(2, 20) + SourceIndex(0) --- >>> } 1 >^^^^ @@ -118,8 +119,8 @@ sourceFile:ES5For-of33.ts 1 > > 2 > } -1 >Emitted(17, 5) Source(3, 1) + SourceIndex(0) -2 >Emitted(17, 6) Source(3, 2) + SourceIndex(0) +1 >Emitted(18, 5) Source(3, 1) + SourceIndex(0) +2 >Emitted(18, 6) Source(3, 2) + SourceIndex(0) --- >>>} >>>catch (e_1_1) { e_1 = { error: e_1_1 }; } diff --git a/tests/baselines/reference/ES5For-of34(target=es2015).js b/tests/baselines/reference/ES5For-of34(target=es2015).js index 34a1923ab398f..619ce3aea26df 100644 --- a/tests/baselines/reference/ES5For-of34(target=es2015).js +++ b/tests/baselines/reference/ES5For-of34(target=es2015).js @@ -9,6 +9,7 @@ for (foo().x of ['a', 'b', 'c']) { } //// [ES5For-of34.js] +"use strict"; function foo() { return { x: 0 }; } diff --git a/tests/baselines/reference/ES5For-of34(target=es2015).js.map b/tests/baselines/reference/ES5For-of34(target=es2015).js.map index 96e6605e94f21..7b83e481ed5ed 100644 --- a/tests/baselines/reference/ES5For-of34(target=es2015).js.map +++ b/tests/baselines/reference/ES5For-of34(target=es2015).js.map @@ -1,3 +1,3 @@ //// [ES5For-of34.js.map] -{"version":3,"file":"ES5For-of34.js","sourceRoot":"","sources":["ES5For-of34.ts"],"names":[],"mappings":"AAAA,SAAS,GAAG;IACR,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACpB,CAAC;AACD,KAAK,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IAC9B,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;AACpB,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,ZnVuY3Rpb24gZm9vKCkgew0KICAgIHJldHVybiB7IHg6IDAgfTsNCn0NCmZvciAoZm9vKCkueCBvZiBbJ2EnLCAnYicsICdjJ10pIHsNCiAgICB2YXIgcCA9IGZvbygpLng7DQp9DQovLyMgc291cmNlTWFwcGluZ1VSTD1FUzVGb3Itb2YzNC5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMzQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YzNC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxTQUFTLEdBQUc7SUFDUixPQUFPLEVBQUUsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDO0FBQ3BCLENBQUM7QUFDRCxLQUFLLEdBQUcsRUFBRSxDQUFDLENBQUMsSUFBSSxDQUFDLEdBQUcsRUFBRSxHQUFHLEVBQUUsR0FBRyxDQUFDLEVBQUUsQ0FBQztJQUM5QixJQUFJLENBQUMsR0FBRyxHQUFHLEVBQUUsQ0FBQyxDQUFDLENBQUM7QUFDcEIsQ0FBQyJ9,ZnVuY3Rpb24gZm9vKCkgewogICAgcmV0dXJuIHsgeDogMCB9Owp9CmZvciAoZm9vKCkueCBvZiBbJ2EnLCAnYicsICdjJ10pIHsKICAgIHZhciBwID0gZm9vKCkueDsKfQ== +{"version":3,"file":"ES5For-of34.js","sourceRoot":"","sources":["ES5For-of34.ts"],"names":[],"mappings":";AAAA,SAAS,GAAG;IACR,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACpB,CAAC;AACD,KAAK,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IAC9B,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;AACpB,CAAC"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KZnVuY3Rpb24gZm9vKCkgew0KICAgIHJldHVybiB7IHg6IDAgfTsNCn0NCmZvciAoZm9vKCkueCBvZiBbJ2EnLCAnYicsICdjJ10pIHsNCiAgICB2YXIgcCA9IGZvbygpLng7DQp9DQovLyMgc291cmNlTWFwcGluZ1VSTD1FUzVGb3Itb2YzNC5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMzQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YzNC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsU0FBUyxHQUFHO0lBQ1IsT0FBTyxFQUFFLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQztBQUNwQixDQUFDO0FBQ0QsS0FBSyxHQUFHLEVBQUUsQ0FBQyxDQUFDLElBQUksQ0FBQyxHQUFHLEVBQUUsR0FBRyxFQUFFLEdBQUcsQ0FBQyxFQUFFLENBQUM7SUFDOUIsSUFBSSxDQUFDLEdBQUcsR0FBRyxFQUFFLENBQUMsQ0FBQyxDQUFDO0FBQ3BCLENBQUMifQ==,ZnVuY3Rpb24gZm9vKCkgewogICAgcmV0dXJuIHsgeDogMCB9Owp9CmZvciAoZm9vKCkueCBvZiBbJ2EnLCAnYicsICdjJ10pIHsKICAgIHZhciBwID0gZm9vKCkueDsKfQ== diff --git a/tests/baselines/reference/ES5For-of34(target=es2015).sourcemap.txt b/tests/baselines/reference/ES5For-of34(target=es2015).sourcemap.txt index 8e317ca4c5df9..9b513e0affa32 100644 --- a/tests/baselines/reference/ES5For-of34(target=es2015).sourcemap.txt +++ b/tests/baselines/reference/ES5For-of34(target=es2015).sourcemap.txt @@ -8,6 +8,7 @@ sources: ES5For-of34.ts emittedFile:ES5For-of34.js sourceFile:ES5For-of34.ts ------------------------------------------------------------------- +>>>"use strict"; >>>function foo() { 1 > 2 >^^^^^^^^^ @@ -16,9 +17,9 @@ sourceFile:ES5For-of34.ts 1 > 2 >function 3 > foo -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -3 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 10) Source(1, 10) + SourceIndex(0) +3 >Emitted(2, 13) Source(1, 13) + SourceIndex(0) --- >>> return { x: 0 }; 1->^^^^ @@ -38,14 +39,14 @@ sourceFile:ES5For-of34.ts 6 > 0 7 > } 8 > ; -1->Emitted(2, 5) Source(2, 5) + SourceIndex(0) -2 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -3 >Emitted(2, 14) Source(2, 14) + SourceIndex(0) -4 >Emitted(2, 15) Source(2, 15) + SourceIndex(0) -5 >Emitted(2, 17) Source(2, 17) + SourceIndex(0) -6 >Emitted(2, 18) Source(2, 18) + SourceIndex(0) -7 >Emitted(2, 20) Source(2, 20) + SourceIndex(0) -8 >Emitted(2, 21) Source(2, 21) + SourceIndex(0) +1->Emitted(3, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(3, 12) Source(2, 12) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) +4 >Emitted(3, 15) Source(2, 15) + SourceIndex(0) +5 >Emitted(3, 17) Source(2, 17) + SourceIndex(0) +6 >Emitted(3, 18) Source(2, 18) + SourceIndex(0) +7 >Emitted(3, 20) Source(2, 20) + SourceIndex(0) +8 >Emitted(3, 21) Source(2, 21) + SourceIndex(0) --- >>>} 1 > @@ -54,8 +55,8 @@ sourceFile:ES5For-of34.ts 1 > > 2 >} -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 2) Source(3, 2) + SourceIndex(0) +1 >Emitted(4, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(4, 2) Source(3, 2) + SourceIndex(0) --- >>>for (foo().x of ['a', 'b', 'c']) { 1-> @@ -91,22 +92,22 @@ sourceFile:ES5For-of34.ts 14> ] 15> ) 16> { -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 6) + SourceIndex(0) -3 >Emitted(4, 9) Source(4, 9) + SourceIndex(0) -4 >Emitted(4, 11) Source(4, 11) + SourceIndex(0) -5 >Emitted(4, 12) Source(4, 12) + SourceIndex(0) -6 >Emitted(4, 13) Source(4, 13) + SourceIndex(0) -7 >Emitted(4, 17) Source(4, 17) + SourceIndex(0) -8 >Emitted(4, 18) Source(4, 18) + SourceIndex(0) -9 >Emitted(4, 21) Source(4, 21) + SourceIndex(0) -10>Emitted(4, 23) Source(4, 23) + SourceIndex(0) -11>Emitted(4, 26) Source(4, 26) + SourceIndex(0) -12>Emitted(4, 28) Source(4, 28) + SourceIndex(0) -13>Emitted(4, 31) Source(4, 31) + SourceIndex(0) -14>Emitted(4, 32) Source(4, 32) + SourceIndex(0) -15>Emitted(4, 34) Source(4, 34) + SourceIndex(0) -16>Emitted(4, 35) Source(4, 35) + SourceIndex(0) +1->Emitted(5, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(5, 6) Source(4, 6) + SourceIndex(0) +3 >Emitted(5, 9) Source(4, 9) + SourceIndex(0) +4 >Emitted(5, 11) Source(4, 11) + SourceIndex(0) +5 >Emitted(5, 12) Source(4, 12) + SourceIndex(0) +6 >Emitted(5, 13) Source(4, 13) + SourceIndex(0) +7 >Emitted(5, 17) Source(4, 17) + SourceIndex(0) +8 >Emitted(5, 18) Source(4, 18) + SourceIndex(0) +9 >Emitted(5, 21) Source(4, 21) + SourceIndex(0) +10>Emitted(5, 23) Source(4, 23) + SourceIndex(0) +11>Emitted(5, 26) Source(4, 26) + SourceIndex(0) +12>Emitted(5, 28) Source(4, 28) + SourceIndex(0) +13>Emitted(5, 31) Source(4, 31) + SourceIndex(0) +14>Emitted(5, 32) Source(4, 32) + SourceIndex(0) +15>Emitted(5, 34) Source(4, 34) + SourceIndex(0) +16>Emitted(5, 35) Source(4, 35) + SourceIndex(0) --- >>> var p = foo().x; 1 >^^^^ @@ -128,15 +129,15 @@ sourceFile:ES5For-of34.ts 7 > . 8 > x 9 > ; -1 >Emitted(5, 5) Source(5, 5) + SourceIndex(0) -2 >Emitted(5, 9) Source(5, 9) + SourceIndex(0) -3 >Emitted(5, 10) Source(5, 10) + SourceIndex(0) -4 >Emitted(5, 13) Source(5, 13) + SourceIndex(0) -5 >Emitted(5, 16) Source(5, 16) + SourceIndex(0) -6 >Emitted(5, 18) Source(5, 18) + SourceIndex(0) -7 >Emitted(5, 19) Source(5, 19) + SourceIndex(0) -8 >Emitted(5, 20) Source(5, 20) + SourceIndex(0) -9 >Emitted(5, 21) Source(5, 21) + SourceIndex(0) +1 >Emitted(6, 5) Source(5, 5) + SourceIndex(0) +2 >Emitted(6, 9) Source(5, 9) + SourceIndex(0) +3 >Emitted(6, 10) Source(5, 10) + SourceIndex(0) +4 >Emitted(6, 13) Source(5, 13) + SourceIndex(0) +5 >Emitted(6, 16) Source(5, 16) + SourceIndex(0) +6 >Emitted(6, 18) Source(5, 18) + SourceIndex(0) +7 >Emitted(6, 19) Source(5, 19) + SourceIndex(0) +8 >Emitted(6, 20) Source(5, 20) + SourceIndex(0) +9 >Emitted(6, 21) Source(5, 21) + SourceIndex(0) --- >>>} 1 > @@ -145,7 +146,7 @@ sourceFile:ES5For-of34.ts 1 > > 2 >} -1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) +1 >Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 2) Source(6, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=ES5For-of34.js.map \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of34(target=es5).js b/tests/baselines/reference/ES5For-of34(target=es5).js index 37c6d066f6373..2201d3e179623 100644 --- a/tests/baselines/reference/ES5For-of34(target=es5).js +++ b/tests/baselines/reference/ES5For-of34(target=es5).js @@ -9,6 +9,7 @@ for (foo().x of ['a', 'b', 'c']) { } //// [ES5For-of34.js] +"use strict"; var __values = (this && this.__values) || function(o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); diff --git a/tests/baselines/reference/ES5For-of34(target=es5).js.map b/tests/baselines/reference/ES5For-of34(target=es5).js.map index 7237f72341b71..03ff12b2371fd 100644 --- a/tests/baselines/reference/ES5For-of34(target=es5).js.map +++ b/tests/baselines/reference/ES5For-of34(target=es5).js.map @@ -1,3 +1,3 @@ //// [ES5For-of34.js.map] -{"version":3,"file":"ES5For-of34.js","sourceRoot":"","sources":["ES5For-of34.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,SAAS,GAAG;IACR,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACpB,CAAC;;IACD,KAAgB,IAAA,KAAA,SAAA,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA,gBAAA,4BAAE,CAAC;QAA7B,GAAG,EAAE,CAAC,CAAC,WAAA;QACR,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;IACpB,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,dmFyIF9fdmFsdWVzID0gKHRoaXMgJiYgdGhpcy5fX3ZhbHVlcykgfHwgZnVuY3Rpb24obykgew0KICAgIHZhciBzID0gdHlwZW9mIFN5bWJvbCA9PT0gImZ1bmN0aW9uIiAmJiBTeW1ib2wuaXRlcmF0b3IsIG0gPSBzICYmIG9bc10sIGkgPSAwOw0KICAgIGlmIChtKSByZXR1cm4gbS5jYWxsKG8pOw0KICAgIGlmIChvICYmIHR5cGVvZiBvLmxlbmd0aCA9PT0gIm51bWJlciIpIHJldHVybiB7DQogICAgICAgIG5leHQ6IGZ1bmN0aW9uICgpIHsNCiAgICAgICAgICAgIGlmIChvICYmIGkgPj0gby5sZW5ndGgpIG8gPSB2b2lkIDA7DQogICAgICAgICAgICByZXR1cm4geyB2YWx1ZTogbyAmJiBvW2krK10sIGRvbmU6ICFvIH07DQogICAgICAgIH0NCiAgICB9Ow0KICAgIHRocm93IG5ldyBUeXBlRXJyb3IocyA/ICJPYmplY3QgaXMgbm90IGl0ZXJhYmxlLiIgOiAiU3ltYm9sLml0ZXJhdG9yIGlzIG5vdCBkZWZpbmVkLiIpOw0KfTsNCnZhciBlXzEsIF9hOw0KZnVuY3Rpb24gZm9vKCkgew0KICAgIHJldHVybiB7IHg6IDAgfTsNCn0NCnRyeSB7DQogICAgZm9yICh2YXIgX2IgPSBfX3ZhbHVlcyhbJ2EnLCAnYicsICdjJ10pLCBfYyA9IF9iLm5leHQoKTsgIV9jLmRvbmU7IF9jID0gX2IubmV4dCgpKSB7DQogICAgICAgIGZvbygpLnggPSBfYy52YWx1ZTsNCiAgICAgICAgdmFyIHAgPSBmb28oKS54Ow0KICAgIH0NCn0NCmNhdGNoIChlXzFfMSkgeyBlXzEgPSB7IGVycm9yOiBlXzFfMSB9OyB9DQpmaW5hbGx5IHsNCiAgICB0cnkgew0KICAgICAgICBpZiAoX2MgJiYgIV9jLmRvbmUgJiYgKF9hID0gX2IucmV0dXJuKSkgX2EuY2FsbChfYik7DQogICAgfQ0KICAgIGZpbmFsbHkgeyBpZiAoZV8xKSB0aHJvdyBlXzEuZXJyb3I7IH0NCn0NCi8vIyBzb3VyY2VNYXBwaW5nVVJMPUVTNUZvci1vZjM0LmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMzQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YzNC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7QUFBQSxTQUFTLEdBQUc7SUFDUixPQUFPLEVBQUUsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDO0FBQ3BCLENBQUM7O0lBQ0QsS0FBZ0IsSUFBQSxLQUFBLFNBQUEsQ0FBQyxHQUFHLEVBQUUsR0FBRyxFQUFFLEdBQUcsQ0FBQyxDQUFBLGdCQUFBLDRCQUFFLENBQUM7UUFBN0IsR0FBRyxFQUFFLENBQUMsQ0FBQyxXQUFBO1FBQ1IsSUFBSSxDQUFDLEdBQUcsR0FBRyxFQUFFLENBQUMsQ0FBQyxDQUFDO0lBQ3BCLENBQUMifQ==,ZnVuY3Rpb24gZm9vKCkgewogICAgcmV0dXJuIHsgeDogMCB9Owp9CmZvciAoZm9vKCkueCBvZiBbJ2EnLCAnYicsICdjJ10pIHsKICAgIHZhciBwID0gZm9vKCkueDsKfQ== +{"version":3,"file":"ES5For-of34.js","sourceRoot":"","sources":["ES5For-of34.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,SAAS,GAAG;IACR,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACpB,CAAC;;IACD,KAAgB,IAAA,KAAA,SAAA,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA,gBAAA,4BAAE,CAAC;QAA7B,GAAG,EAAE,CAAC,CAAC,WAAA;QACR,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;IACpB,CAAC"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KdmFyIF9fdmFsdWVzID0gKHRoaXMgJiYgdGhpcy5fX3ZhbHVlcykgfHwgZnVuY3Rpb24obykgew0KICAgIHZhciBzID0gdHlwZW9mIFN5bWJvbCA9PT0gImZ1bmN0aW9uIiAmJiBTeW1ib2wuaXRlcmF0b3IsIG0gPSBzICYmIG9bc10sIGkgPSAwOw0KICAgIGlmIChtKSByZXR1cm4gbS5jYWxsKG8pOw0KICAgIGlmIChvICYmIHR5cGVvZiBvLmxlbmd0aCA9PT0gIm51bWJlciIpIHJldHVybiB7DQogICAgICAgIG5leHQ6IGZ1bmN0aW9uICgpIHsNCiAgICAgICAgICAgIGlmIChvICYmIGkgPj0gby5sZW5ndGgpIG8gPSB2b2lkIDA7DQogICAgICAgICAgICByZXR1cm4geyB2YWx1ZTogbyAmJiBvW2krK10sIGRvbmU6ICFvIH07DQogICAgICAgIH0NCiAgICB9Ow0KICAgIHRocm93IG5ldyBUeXBlRXJyb3IocyA/ICJPYmplY3QgaXMgbm90IGl0ZXJhYmxlLiIgOiAiU3ltYm9sLml0ZXJhdG9yIGlzIG5vdCBkZWZpbmVkLiIpOw0KfTsNCnZhciBlXzEsIF9hOw0KZnVuY3Rpb24gZm9vKCkgew0KICAgIHJldHVybiB7IHg6IDAgfTsNCn0NCnRyeSB7DQogICAgZm9yICh2YXIgX2IgPSBfX3ZhbHVlcyhbJ2EnLCAnYicsICdjJ10pLCBfYyA9IF9iLm5leHQoKTsgIV9jLmRvbmU7IF9jID0gX2IubmV4dCgpKSB7DQogICAgICAgIGZvbygpLnggPSBfYy52YWx1ZTsNCiAgICAgICAgdmFyIHAgPSBmb28oKS54Ow0KICAgIH0NCn0NCmNhdGNoIChlXzFfMSkgeyBlXzEgPSB7IGVycm9yOiBlXzFfMSB9OyB9DQpmaW5hbGx5IHsNCiAgICB0cnkgew0KICAgICAgICBpZiAoX2MgJiYgIV9jLmRvbmUgJiYgKF9hID0gX2IucmV0dXJuKSkgX2EuY2FsbChfYik7DQogICAgfQ0KICAgIGZpbmFsbHkgeyBpZiAoZV8xKSB0aHJvdyBlXzEuZXJyb3I7IH0NCn0NCi8vIyBzb3VyY2VNYXBwaW5nVVJMPUVTNUZvci1vZjM0LmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMzQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YzNC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7O0FBQUEsU0FBUyxHQUFHO0lBQ1IsT0FBTyxFQUFFLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQztBQUNwQixDQUFDOztJQUNELEtBQWdCLElBQUEsS0FBQSxTQUFBLENBQUMsR0FBRyxFQUFFLEdBQUcsRUFBRSxHQUFHLENBQUMsQ0FBQSxnQkFBQSw0QkFBRSxDQUFDO1FBQTdCLEdBQUcsRUFBRSxDQUFDLENBQUMsV0FBQTtRQUNSLElBQUksQ0FBQyxHQUFHLEdBQUcsRUFBRSxDQUFDLENBQUMsQ0FBQztJQUNwQixDQUFDIn0=,ZnVuY3Rpb24gZm9vKCkgewogICAgcmV0dXJuIHsgeDogMCB9Owp9CmZvciAoZm9vKCkueCBvZiBbJ2EnLCAnYicsICdjJ10pIHsKICAgIHZhciBwID0gZm9vKCkueDsKfQ== diff --git a/tests/baselines/reference/ES5For-of34(target=es5).sourcemap.txt b/tests/baselines/reference/ES5For-of34(target=es5).sourcemap.txt index 0579e2166a302..b50ba84f6ded6 100644 --- a/tests/baselines/reference/ES5For-of34(target=es5).sourcemap.txt +++ b/tests/baselines/reference/ES5For-of34(target=es5).sourcemap.txt @@ -8,6 +8,7 @@ sources: ES5For-of34.ts emittedFile:ES5For-of34.js sourceFile:ES5For-of34.ts ------------------------------------------------------------------- +>>>"use strict"; >>>var __values = (this && this.__values) || function(o) { >>> var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; >>> if (m) return m.call(o); @@ -28,9 +29,9 @@ sourceFile:ES5For-of34.ts 1 > 2 >function 3 > foo -1 >Emitted(13, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(13, 10) Source(1, 10) + SourceIndex(0) -3 >Emitted(13, 13) Source(1, 13) + SourceIndex(0) +1 >Emitted(14, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(14, 10) Source(1, 10) + SourceIndex(0) +3 >Emitted(14, 13) Source(1, 13) + SourceIndex(0) --- >>> return { x: 0 }; 1->^^^^ @@ -50,14 +51,14 @@ sourceFile:ES5For-of34.ts 6 > 0 7 > } 8 > ; -1->Emitted(14, 5) Source(2, 5) + SourceIndex(0) -2 >Emitted(14, 12) Source(2, 12) + SourceIndex(0) -3 >Emitted(14, 14) Source(2, 14) + SourceIndex(0) -4 >Emitted(14, 15) Source(2, 15) + SourceIndex(0) -5 >Emitted(14, 17) Source(2, 17) + SourceIndex(0) -6 >Emitted(14, 18) Source(2, 18) + SourceIndex(0) -7 >Emitted(14, 20) Source(2, 20) + SourceIndex(0) -8 >Emitted(14, 21) Source(2, 21) + SourceIndex(0) +1->Emitted(15, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(15, 12) Source(2, 12) + SourceIndex(0) +3 >Emitted(15, 14) Source(2, 14) + SourceIndex(0) +4 >Emitted(15, 15) Source(2, 15) + SourceIndex(0) +5 >Emitted(15, 17) Source(2, 17) + SourceIndex(0) +6 >Emitted(15, 18) Source(2, 18) + SourceIndex(0) +7 >Emitted(15, 20) Source(2, 20) + SourceIndex(0) +8 >Emitted(15, 21) Source(2, 21) + SourceIndex(0) --- >>>} 1 > @@ -66,8 +67,8 @@ sourceFile:ES5For-of34.ts 1 > > 2 >} -1 >Emitted(15, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(15, 2) Source(3, 2) + SourceIndex(0) +1 >Emitted(16, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(16, 2) Source(3, 2) + SourceIndex(0) --- >>>try { >>> for (var _b = __values(['a', 'b', 'c']), _c = _b.next(); !_c.done; _c = _b.next()) { @@ -104,22 +105,22 @@ sourceFile:ES5For-of34.ts 14> 15> ) 16> { -1->Emitted(17, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(17, 10) Source(4, 17) + SourceIndex(0) -3 >Emitted(17, 14) Source(4, 17) + SourceIndex(0) -4 >Emitted(17, 19) Source(4, 17) + SourceIndex(0) -5 >Emitted(17, 28) Source(4, 17) + SourceIndex(0) -6 >Emitted(17, 29) Source(4, 18) + SourceIndex(0) -7 >Emitted(17, 32) Source(4, 21) + SourceIndex(0) -8 >Emitted(17, 34) Source(4, 23) + SourceIndex(0) -9 >Emitted(17, 37) Source(4, 26) + SourceIndex(0) -10>Emitted(17, 39) Source(4, 28) + SourceIndex(0) -11>Emitted(17, 42) Source(4, 31) + SourceIndex(0) -12>Emitted(17, 43) Source(4, 32) + SourceIndex(0) -13>Emitted(17, 44) Source(4, 32) + SourceIndex(0) -14>Emitted(17, 60) Source(4, 32) + SourceIndex(0) -15>Emitted(17, 88) Source(4, 34) + SourceIndex(0) -16>Emitted(17, 89) Source(4, 35) + SourceIndex(0) +1->Emitted(18, 5) Source(4, 1) + SourceIndex(0) +2 >Emitted(18, 10) Source(4, 17) + SourceIndex(0) +3 >Emitted(18, 14) Source(4, 17) + SourceIndex(0) +4 >Emitted(18, 19) Source(4, 17) + SourceIndex(0) +5 >Emitted(18, 28) Source(4, 17) + SourceIndex(0) +6 >Emitted(18, 29) Source(4, 18) + SourceIndex(0) +7 >Emitted(18, 32) Source(4, 21) + SourceIndex(0) +8 >Emitted(18, 34) Source(4, 23) + SourceIndex(0) +9 >Emitted(18, 37) Source(4, 26) + SourceIndex(0) +10>Emitted(18, 39) Source(4, 28) + SourceIndex(0) +11>Emitted(18, 42) Source(4, 31) + SourceIndex(0) +12>Emitted(18, 43) Source(4, 32) + SourceIndex(0) +13>Emitted(18, 44) Source(4, 32) + SourceIndex(0) +14>Emitted(18, 60) Source(4, 32) + SourceIndex(0) +15>Emitted(18, 88) Source(4, 34) + SourceIndex(0) +16>Emitted(18, 89) Source(4, 35) + SourceIndex(0) --- >>> foo().x = _c.value; 1 >^^^^^^^^ @@ -134,12 +135,12 @@ sourceFile:ES5For-of34.ts 4 > . 5 > x 6 > -1 >Emitted(18, 9) Source(4, 6) + SourceIndex(0) -2 >Emitted(18, 12) Source(4, 9) + SourceIndex(0) -3 >Emitted(18, 14) Source(4, 11) + SourceIndex(0) -4 >Emitted(18, 15) Source(4, 12) + SourceIndex(0) -5 >Emitted(18, 16) Source(4, 13) + SourceIndex(0) -6 >Emitted(18, 27) Source(4, 13) + SourceIndex(0) +1 >Emitted(19, 9) Source(4, 6) + SourceIndex(0) +2 >Emitted(19, 12) Source(4, 9) + SourceIndex(0) +3 >Emitted(19, 14) Source(4, 11) + SourceIndex(0) +4 >Emitted(19, 15) Source(4, 12) + SourceIndex(0) +5 >Emitted(19, 16) Source(4, 13) + SourceIndex(0) +6 >Emitted(19, 27) Source(4, 13) + SourceIndex(0) --- >>> var p = foo().x; 1 >^^^^^^^^ @@ -161,15 +162,15 @@ sourceFile:ES5For-of34.ts 7 > . 8 > x 9 > ; -1 >Emitted(19, 9) Source(5, 5) + SourceIndex(0) -2 >Emitted(19, 13) Source(5, 9) + SourceIndex(0) -3 >Emitted(19, 14) Source(5, 10) + SourceIndex(0) -4 >Emitted(19, 17) Source(5, 13) + SourceIndex(0) -5 >Emitted(19, 20) Source(5, 16) + SourceIndex(0) -6 >Emitted(19, 22) Source(5, 18) + SourceIndex(0) -7 >Emitted(19, 23) Source(5, 19) + SourceIndex(0) -8 >Emitted(19, 24) Source(5, 20) + SourceIndex(0) -9 >Emitted(19, 25) Source(5, 21) + SourceIndex(0) +1 >Emitted(20, 9) Source(5, 5) + SourceIndex(0) +2 >Emitted(20, 13) Source(5, 9) + SourceIndex(0) +3 >Emitted(20, 14) Source(5, 10) + SourceIndex(0) +4 >Emitted(20, 17) Source(5, 13) + SourceIndex(0) +5 >Emitted(20, 20) Source(5, 16) + SourceIndex(0) +6 >Emitted(20, 22) Source(5, 18) + SourceIndex(0) +7 >Emitted(20, 23) Source(5, 19) + SourceIndex(0) +8 >Emitted(20, 24) Source(5, 20) + SourceIndex(0) +9 >Emitted(20, 25) Source(5, 21) + SourceIndex(0) --- >>> } 1 >^^^^ @@ -177,8 +178,8 @@ sourceFile:ES5For-of34.ts 1 > > 2 > } -1 >Emitted(20, 5) Source(6, 1) + SourceIndex(0) -2 >Emitted(20, 6) Source(6, 2) + SourceIndex(0) +1 >Emitted(21, 5) Source(6, 1) + SourceIndex(0) +2 >Emitted(21, 6) Source(6, 2) + SourceIndex(0) --- >>>} >>>catch (e_1_1) { e_1 = { error: e_1_1 }; } diff --git a/tests/baselines/reference/ES5For-of35(target=es2015).js b/tests/baselines/reference/ES5For-of35(target=es2015).js index c60f3294b6d66..efe54ffb61cfa 100644 --- a/tests/baselines/reference/ES5For-of35(target=es2015).js +++ b/tests/baselines/reference/ES5For-of35(target=es2015).js @@ -7,6 +7,7 @@ for (const {x: a = 0, y: b = 1} of [2, 3]) { } //// [ES5For-of35.js] +"use strict"; for (const { x: a = 0, y: b = 1 } of [2, 3]) { a; b; diff --git a/tests/baselines/reference/ES5For-of35(target=es2015).js.map b/tests/baselines/reference/ES5For-of35(target=es2015).js.map index c0106e63e4e96..97e36b718a8e9 100644 --- a/tests/baselines/reference/ES5For-of35(target=es2015).js.map +++ b/tests/baselines/reference/ES5For-of35(target=es2015).js.map @@ -1,3 +1,3 @@ //// [ES5For-of35.js.map] -{"version":3,"file":"ES5For-of35.js","sourceRoot":"","sources":["ES5For-of35.ts"],"names":[],"mappings":"AAAA,KAAK,MAAM,EAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,EAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;IACxC,CAAC,CAAC;IACF,CAAC,CAAC;AACN,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,Zm9yIChjb25zdCB7IHg6IGEgPSAwLCB5OiBiID0gMSB9IG9mIFsyLCAzXSkgew0KICAgIGE7DQogICAgYjsNCn0NCi8vIyBzb3VyY2VNYXBwaW5nVVJMPUVTNUZvci1vZjM1LmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMzUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YzNS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxLQUFLLE1BQU0sRUFBQyxDQUFDLEVBQUUsQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxHQUFHLENBQUMsRUFBQyxJQUFJLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxFQUFFLENBQUM7SUFDeEMsQ0FBQyxDQUFDO0lBQ0YsQ0FBQyxDQUFDO0FBQ04sQ0FBQyJ9,Zm9yIChjb25zdCB7eDogYSA9IDAsIHk6IGIgPSAxfSBvZiBbMiwgM10pIHsKICAgIGE7CiAgICBiOwp9 +{"version":3,"file":"ES5For-of35.js","sourceRoot":"","sources":["ES5For-of35.ts"],"names":[],"mappings":";AAAA,KAAK,MAAM,EAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,EAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;IACxC,CAAC,CAAC;IACF,CAAC,CAAC;AACN,CAAC"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KZm9yIChjb25zdCB7IHg6IGEgPSAwLCB5OiBiID0gMSB9IG9mIFsyLCAzXSkgew0KICAgIGE7DQogICAgYjsNCn0NCi8vIyBzb3VyY2VNYXBwaW5nVVJMPUVTNUZvci1vZjM1LmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMzUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YzNS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsS0FBSyxNQUFNLEVBQUMsQ0FBQyxFQUFFLENBQUMsR0FBRyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsR0FBRyxDQUFDLEVBQUMsSUFBSSxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsRUFBRSxDQUFDO0lBQ3hDLENBQUMsQ0FBQztJQUNGLENBQUMsQ0FBQztBQUNOLENBQUMifQ==,Zm9yIChjb25zdCB7eDogYSA9IDAsIHk6IGIgPSAxfSBvZiBbMiwgM10pIHsKICAgIGE7CiAgICBiOwp9 diff --git a/tests/baselines/reference/ES5For-of35(target=es2015).sourcemap.txt b/tests/baselines/reference/ES5For-of35(target=es2015).sourcemap.txt index f096b11328b9a..d82f2294f2b15 100644 --- a/tests/baselines/reference/ES5For-of35(target=es2015).sourcemap.txt +++ b/tests/baselines/reference/ES5For-of35(target=es2015).sourcemap.txt @@ -8,6 +8,7 @@ sources: ES5For-of35.ts emittedFile:ES5For-of35.js sourceFile:ES5For-of35.ts ------------------------------------------------------------------- +>>>"use strict"; >>>for (const { x: a = 0, y: b = 1 } of [2, 3]) { 1 > 2 >^^^^^ @@ -57,30 +58,30 @@ sourceFile:ES5For-of35.ts 22> ] 23> ) 24> { -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) -3 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -4 >Emitted(1, 14) Source(1, 13) + SourceIndex(0) -5 >Emitted(1, 15) Source(1, 14) + SourceIndex(0) -6 >Emitted(1, 17) Source(1, 16) + SourceIndex(0) -7 >Emitted(1, 18) Source(1, 17) + SourceIndex(0) -8 >Emitted(1, 21) Source(1, 20) + SourceIndex(0) -9 >Emitted(1, 22) Source(1, 21) + SourceIndex(0) -10>Emitted(1, 24) Source(1, 23) + SourceIndex(0) -11>Emitted(1, 25) Source(1, 24) + SourceIndex(0) -12>Emitted(1, 27) Source(1, 26) + SourceIndex(0) -13>Emitted(1, 28) Source(1, 27) + SourceIndex(0) -14>Emitted(1, 31) Source(1, 30) + SourceIndex(0) -15>Emitted(1, 32) Source(1, 31) + SourceIndex(0) -16>Emitted(1, 34) Source(1, 32) + SourceIndex(0) -17>Emitted(1, 38) Source(1, 36) + SourceIndex(0) -18>Emitted(1, 39) Source(1, 37) + SourceIndex(0) -19>Emitted(1, 40) Source(1, 38) + SourceIndex(0) -20>Emitted(1, 42) Source(1, 40) + SourceIndex(0) -21>Emitted(1, 43) Source(1, 41) + SourceIndex(0) -22>Emitted(1, 44) Source(1, 42) + SourceIndex(0) -23>Emitted(1, 46) Source(1, 44) + SourceIndex(0) -24>Emitted(1, 47) Source(1, 45) + SourceIndex(0) +1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 6) Source(1, 6) + SourceIndex(0) +3 >Emitted(2, 12) Source(1, 12) + SourceIndex(0) +4 >Emitted(2, 14) Source(1, 13) + SourceIndex(0) +5 >Emitted(2, 15) Source(1, 14) + SourceIndex(0) +6 >Emitted(2, 17) Source(1, 16) + SourceIndex(0) +7 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +8 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +9 >Emitted(2, 22) Source(1, 21) + SourceIndex(0) +10>Emitted(2, 24) Source(1, 23) + SourceIndex(0) +11>Emitted(2, 25) Source(1, 24) + SourceIndex(0) +12>Emitted(2, 27) Source(1, 26) + SourceIndex(0) +13>Emitted(2, 28) Source(1, 27) + SourceIndex(0) +14>Emitted(2, 31) Source(1, 30) + SourceIndex(0) +15>Emitted(2, 32) Source(1, 31) + SourceIndex(0) +16>Emitted(2, 34) Source(1, 32) + SourceIndex(0) +17>Emitted(2, 38) Source(1, 36) + SourceIndex(0) +18>Emitted(2, 39) Source(1, 37) + SourceIndex(0) +19>Emitted(2, 40) Source(1, 38) + SourceIndex(0) +20>Emitted(2, 42) Source(1, 40) + SourceIndex(0) +21>Emitted(2, 43) Source(1, 41) + SourceIndex(0) +22>Emitted(2, 44) Source(1, 42) + SourceIndex(0) +23>Emitted(2, 46) Source(1, 44) + SourceIndex(0) +24>Emitted(2, 47) Source(1, 45) + SourceIndex(0) --- >>> a; 1 >^^^^ @@ -91,9 +92,9 @@ sourceFile:ES5For-of35.ts > 2 > a 3 > ; -1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -2 >Emitted(2, 6) Source(2, 6) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +1 >Emitted(3, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(3, 6) Source(2, 6) + SourceIndex(0) +3 >Emitted(3, 7) Source(2, 7) + SourceIndex(0) --- >>> b; 1->^^^^ @@ -103,9 +104,9 @@ sourceFile:ES5For-of35.ts > 2 > b 3 > ; -1->Emitted(3, 5) Source(3, 5) + SourceIndex(0) -2 >Emitted(3, 6) Source(3, 6) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +1->Emitted(4, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(4, 6) Source(3, 6) + SourceIndex(0) +3 >Emitted(4, 7) Source(3, 7) + SourceIndex(0) --- >>>} 1 > @@ -114,7 +115,7 @@ sourceFile:ES5For-of35.ts 1 > > 2 >} -1 >Emitted(4, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 2) Source(4, 2) + SourceIndex(0) +1 >Emitted(5, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(5, 2) Source(4, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=ES5For-of35.js.map \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of35(target=es5).js b/tests/baselines/reference/ES5For-of35(target=es5).js index b7feda58ce1e4..7850e0a6d703c 100644 --- a/tests/baselines/reference/ES5For-of35(target=es5).js +++ b/tests/baselines/reference/ES5For-of35(target=es5).js @@ -7,6 +7,7 @@ for (const {x: a = 0, y: b = 1} of [2, 3]) { } //// [ES5For-of35.js] +"use strict"; var __values = (this && this.__values) || function(o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); diff --git a/tests/baselines/reference/ES5For-of35(target=es5).js.map b/tests/baselines/reference/ES5For-of35(target=es5).js.map index ef2198fce7606..5a2e2bdb7a42e 100644 --- a/tests/baselines/reference/ES5For-of35(target=es5).js.map +++ b/tests/baselines/reference/ES5For-of35(target=es5).js.map @@ -1,3 +1,3 @@ //// [ES5For-of35.js.map] -{"version":3,"file":"ES5For-of35.js","sourceRoot":"","sources":["ES5For-of35.ts"],"names":[],"mappings":";;;;;;;;;;;;;IAAA,KAAmC,IAAA,KAAA,SAAA,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,gBAAA,4BAAE,CAAC;QAAjC,IAAA,aAAoB,EAAnB,SAAQ,EAAL,CAAC,mBAAG,CAAC,KAAA,EAAE,SAAQ,EAAL,CAAC,mBAAG,CAAC,KAAA;QAC1B,CAAC,CAAC;QACF,CAAC,CAAC;IACN,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,dmFyIF9fdmFsdWVzID0gKHRoaXMgJiYgdGhpcy5fX3ZhbHVlcykgfHwgZnVuY3Rpb24obykgew0KICAgIHZhciBzID0gdHlwZW9mIFN5bWJvbCA9PT0gImZ1bmN0aW9uIiAmJiBTeW1ib2wuaXRlcmF0b3IsIG0gPSBzICYmIG9bc10sIGkgPSAwOw0KICAgIGlmIChtKSByZXR1cm4gbS5jYWxsKG8pOw0KICAgIGlmIChvICYmIHR5cGVvZiBvLmxlbmd0aCA9PT0gIm51bWJlciIpIHJldHVybiB7DQogICAgICAgIG5leHQ6IGZ1bmN0aW9uICgpIHsNCiAgICAgICAgICAgIGlmIChvICYmIGkgPj0gby5sZW5ndGgpIG8gPSB2b2lkIDA7DQogICAgICAgICAgICByZXR1cm4geyB2YWx1ZTogbyAmJiBvW2krK10sIGRvbmU6ICFvIH07DQogICAgICAgIH0NCiAgICB9Ow0KICAgIHRocm93IG5ldyBUeXBlRXJyb3IocyA/ICJPYmplY3QgaXMgbm90IGl0ZXJhYmxlLiIgOiAiU3ltYm9sLml0ZXJhdG9yIGlzIG5vdCBkZWZpbmVkLiIpOw0KfTsNCnZhciBlXzEsIF9hOw0KdHJ5IHsNCiAgICBmb3IgKHZhciBfYiA9IF9fdmFsdWVzKFsyLCAzXSksIF9jID0gX2IubmV4dCgpOyAhX2MuZG9uZTsgX2MgPSBfYi5uZXh0KCkpIHsNCiAgICAgICAgdmFyIF9kID0gX2MudmFsdWUsIF9lID0gX2QueCwgYSA9IF9lID09PSB2b2lkIDAgPyAwIDogX2UsIF9mID0gX2QueSwgYiA9IF9mID09PSB2b2lkIDAgPyAxIDogX2Y7DQogICAgICAgIGE7DQogICAgICAgIGI7DQogICAgfQ0KfQ0KY2F0Y2ggKGVfMV8xKSB7IGVfMSA9IHsgZXJyb3I6IGVfMV8xIH07IH0NCmZpbmFsbHkgew0KICAgIHRyeSB7DQogICAgICAgIGlmIChfYyAmJiAhX2MuZG9uZSAmJiAoX2EgPSBfYi5yZXR1cm4pKSBfYS5jYWxsKF9iKTsNCiAgICB9DQogICAgZmluYWxseSB7IGlmIChlXzEpIHRocm93IGVfMS5lcnJvcjsgfQ0KfQ0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9RVM1Rm9yLW9mMzUuanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMzUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YzNS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7O0lBQUEsS0FBbUMsSUFBQSxLQUFBLFNBQUEsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUEsZ0JBQUEsNEJBQUUsQ0FBQztRQUFqQyxJQUFBLGFBQW9CLEVBQW5CLFNBQVEsRUFBTCxDQUFDLG1CQUFHLENBQUMsS0FBQSxFQUFFLFNBQVEsRUFBTCxDQUFDLG1CQUFHLENBQUMsS0FBQTtRQUMxQixDQUFDLENBQUM7UUFDRixDQUFDLENBQUM7SUFDTixDQUFDIn0=,Zm9yIChjb25zdCB7eDogYSA9IDAsIHk6IGIgPSAxfSBvZiBbMiwgM10pIHsKICAgIGE7CiAgICBiOwp9 +{"version":3,"file":"ES5For-of35.js","sourceRoot":"","sources":["ES5For-of35.ts"],"names":[],"mappings":";;;;;;;;;;;;;;IAAA,KAAmC,IAAA,KAAA,SAAA,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,gBAAA,4BAAE,CAAC;QAAjC,IAAA,aAAoB,EAAnB,SAAQ,EAAL,CAAC,mBAAG,CAAC,KAAA,EAAE,SAAQ,EAAL,CAAC,mBAAG,CAAC,KAAA;QAC1B,CAAC,CAAC;QACF,CAAC,CAAC;IACN,CAAC"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KdmFyIF9fdmFsdWVzID0gKHRoaXMgJiYgdGhpcy5fX3ZhbHVlcykgfHwgZnVuY3Rpb24obykgew0KICAgIHZhciBzID0gdHlwZW9mIFN5bWJvbCA9PT0gImZ1bmN0aW9uIiAmJiBTeW1ib2wuaXRlcmF0b3IsIG0gPSBzICYmIG9bc10sIGkgPSAwOw0KICAgIGlmIChtKSByZXR1cm4gbS5jYWxsKG8pOw0KICAgIGlmIChvICYmIHR5cGVvZiBvLmxlbmd0aCA9PT0gIm51bWJlciIpIHJldHVybiB7DQogICAgICAgIG5leHQ6IGZ1bmN0aW9uICgpIHsNCiAgICAgICAgICAgIGlmIChvICYmIGkgPj0gby5sZW5ndGgpIG8gPSB2b2lkIDA7DQogICAgICAgICAgICByZXR1cm4geyB2YWx1ZTogbyAmJiBvW2krK10sIGRvbmU6ICFvIH07DQogICAgICAgIH0NCiAgICB9Ow0KICAgIHRocm93IG5ldyBUeXBlRXJyb3IocyA/ICJPYmplY3QgaXMgbm90IGl0ZXJhYmxlLiIgOiAiU3ltYm9sLml0ZXJhdG9yIGlzIG5vdCBkZWZpbmVkLiIpOw0KfTsNCnZhciBlXzEsIF9hOw0KdHJ5IHsNCiAgICBmb3IgKHZhciBfYiA9IF9fdmFsdWVzKFsyLCAzXSksIF9jID0gX2IubmV4dCgpOyAhX2MuZG9uZTsgX2MgPSBfYi5uZXh0KCkpIHsNCiAgICAgICAgdmFyIF9kID0gX2MudmFsdWUsIF9lID0gX2QueCwgYSA9IF9lID09PSB2b2lkIDAgPyAwIDogX2UsIF9mID0gX2QueSwgYiA9IF9mID09PSB2b2lkIDAgPyAxIDogX2Y7DQogICAgICAgIGE7DQogICAgICAgIGI7DQogICAgfQ0KfQ0KY2F0Y2ggKGVfMV8xKSB7IGVfMSA9IHsgZXJyb3I6IGVfMV8xIH07IH0NCmZpbmFsbHkgew0KICAgIHRyeSB7DQogICAgICAgIGlmIChfYyAmJiAhX2MuZG9uZSAmJiAoX2EgPSBfYi5yZXR1cm4pKSBfYS5jYWxsKF9iKTsNCiAgICB9DQogICAgZmluYWxseSB7IGlmIChlXzEpIHRocm93IGVfMS5lcnJvcjsgfQ0KfQ0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9RVM1Rm9yLW9mMzUuanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMzUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YzNS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7OztJQUFBLEtBQW1DLElBQUEsS0FBQSxTQUFBLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFBLGdCQUFBLDRCQUFFLENBQUM7UUFBakMsSUFBQSxhQUFvQixFQUFuQixTQUFRLEVBQUwsQ0FBQyxtQkFBRyxDQUFDLEtBQUEsRUFBRSxTQUFRLEVBQUwsQ0FBQyxtQkFBRyxDQUFDLEtBQUE7UUFDMUIsQ0FBQyxDQUFDO1FBQ0YsQ0FBQyxDQUFDO0lBQ04sQ0FBQyJ9,Zm9yIChjb25zdCB7eDogYSA9IDAsIHk6IGIgPSAxfSBvZiBbMiwgM10pIHsKICAgIGE7CiAgICBiOwp9 diff --git a/tests/baselines/reference/ES5For-of35(target=es5).sourcemap.txt b/tests/baselines/reference/ES5For-of35(target=es5).sourcemap.txt index addd7a80176bf..8daaf41919c1c 100644 --- a/tests/baselines/reference/ES5For-of35(target=es5).sourcemap.txt +++ b/tests/baselines/reference/ES5For-of35(target=es5).sourcemap.txt @@ -8,6 +8,7 @@ sources: ES5For-of35.ts emittedFile:ES5For-of35.js sourceFile:ES5For-of35.ts ------------------------------------------------------------------- +>>>"use strict"; >>>var __values = (this && this.__values) || function(o) { >>> var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; >>> if (m) return m.call(o); @@ -51,20 +52,20 @@ sourceFile:ES5For-of35.ts 12> 13> ) 14> { -1 >Emitted(14, 5) Source(1, 1) + SourceIndex(0) -2 >Emitted(14, 10) Source(1, 36) + SourceIndex(0) -3 >Emitted(14, 14) Source(1, 36) + SourceIndex(0) -4 >Emitted(14, 19) Source(1, 36) + SourceIndex(0) -5 >Emitted(14, 28) Source(1, 36) + SourceIndex(0) -6 >Emitted(14, 29) Source(1, 37) + SourceIndex(0) -7 >Emitted(14, 30) Source(1, 38) + SourceIndex(0) -8 >Emitted(14, 32) Source(1, 40) + SourceIndex(0) -9 >Emitted(14, 33) Source(1, 41) + SourceIndex(0) -10>Emitted(14, 34) Source(1, 42) + SourceIndex(0) -11>Emitted(14, 35) Source(1, 42) + SourceIndex(0) -12>Emitted(14, 51) Source(1, 42) + SourceIndex(0) -13>Emitted(14, 79) Source(1, 44) + SourceIndex(0) -14>Emitted(14, 80) Source(1, 45) + SourceIndex(0) +1 >Emitted(15, 5) Source(1, 1) + SourceIndex(0) +2 >Emitted(15, 10) Source(1, 36) + SourceIndex(0) +3 >Emitted(15, 14) Source(1, 36) + SourceIndex(0) +4 >Emitted(15, 19) Source(1, 36) + SourceIndex(0) +5 >Emitted(15, 28) Source(1, 36) + SourceIndex(0) +6 >Emitted(15, 29) Source(1, 37) + SourceIndex(0) +7 >Emitted(15, 30) Source(1, 38) + SourceIndex(0) +8 >Emitted(15, 32) Source(1, 40) + SourceIndex(0) +9 >Emitted(15, 33) Source(1, 41) + SourceIndex(0) +10>Emitted(15, 34) Source(1, 42) + SourceIndex(0) +11>Emitted(15, 35) Source(1, 42) + SourceIndex(0) +12>Emitted(15, 51) Source(1, 42) + SourceIndex(0) +13>Emitted(15, 79) Source(1, 44) + SourceIndex(0) +14>Emitted(15, 80) Source(1, 45) + SourceIndex(0) --- >>> var _d = _c.value, _e = _d.x, a = _e === void 0 ? 0 : _e, _f = _d.y, b = _f === void 0 ? 1 : _f; 1->^^^^^^^^ @@ -101,23 +102,23 @@ sourceFile:ES5For-of35.ts 15> = 16> 1 17> -1->Emitted(15, 9) Source(1, 12) + SourceIndex(0) -2 >Emitted(15, 13) Source(1, 12) + SourceIndex(0) -3 >Emitted(15, 26) Source(1, 32) + SourceIndex(0) -4 >Emitted(15, 28) Source(1, 13) + SourceIndex(0) -5 >Emitted(15, 37) Source(1, 21) + SourceIndex(0) -6 >Emitted(15, 39) Source(1, 16) + SourceIndex(0) -7 >Emitted(15, 40) Source(1, 17) + SourceIndex(0) -8 >Emitted(15, 59) Source(1, 20) + SourceIndex(0) -9 >Emitted(15, 60) Source(1, 21) + SourceIndex(0) -10>Emitted(15, 65) Source(1, 21) + SourceIndex(0) -11>Emitted(15, 67) Source(1, 23) + SourceIndex(0) -12>Emitted(15, 76) Source(1, 31) + SourceIndex(0) -13>Emitted(15, 78) Source(1, 26) + SourceIndex(0) -14>Emitted(15, 79) Source(1, 27) + SourceIndex(0) -15>Emitted(15, 98) Source(1, 30) + SourceIndex(0) -16>Emitted(15, 99) Source(1, 31) + SourceIndex(0) -17>Emitted(15, 104) Source(1, 31) + SourceIndex(0) +1->Emitted(16, 9) Source(1, 12) + SourceIndex(0) +2 >Emitted(16, 13) Source(1, 12) + SourceIndex(0) +3 >Emitted(16, 26) Source(1, 32) + SourceIndex(0) +4 >Emitted(16, 28) Source(1, 13) + SourceIndex(0) +5 >Emitted(16, 37) Source(1, 21) + SourceIndex(0) +6 >Emitted(16, 39) Source(1, 16) + SourceIndex(0) +7 >Emitted(16, 40) Source(1, 17) + SourceIndex(0) +8 >Emitted(16, 59) Source(1, 20) + SourceIndex(0) +9 >Emitted(16, 60) Source(1, 21) + SourceIndex(0) +10>Emitted(16, 65) Source(1, 21) + SourceIndex(0) +11>Emitted(16, 67) Source(1, 23) + SourceIndex(0) +12>Emitted(16, 76) Source(1, 31) + SourceIndex(0) +13>Emitted(16, 78) Source(1, 26) + SourceIndex(0) +14>Emitted(16, 79) Source(1, 27) + SourceIndex(0) +15>Emitted(16, 98) Source(1, 30) + SourceIndex(0) +16>Emitted(16, 99) Source(1, 31) + SourceIndex(0) +17>Emitted(16, 104) Source(1, 31) + SourceIndex(0) --- >>> a; 1 >^^^^^^^^ @@ -128,9 +129,9 @@ sourceFile:ES5For-of35.ts > 2 > a 3 > ; -1 >Emitted(16, 9) Source(2, 5) + SourceIndex(0) -2 >Emitted(16, 10) Source(2, 6) + SourceIndex(0) -3 >Emitted(16, 11) Source(2, 7) + SourceIndex(0) +1 >Emitted(17, 9) Source(2, 5) + SourceIndex(0) +2 >Emitted(17, 10) Source(2, 6) + SourceIndex(0) +3 >Emitted(17, 11) Source(2, 7) + SourceIndex(0) --- >>> b; 1->^^^^^^^^ @@ -140,9 +141,9 @@ sourceFile:ES5For-of35.ts > 2 > b 3 > ; -1->Emitted(17, 9) Source(3, 5) + SourceIndex(0) -2 >Emitted(17, 10) Source(3, 6) + SourceIndex(0) -3 >Emitted(17, 11) Source(3, 7) + SourceIndex(0) +1->Emitted(18, 9) Source(3, 5) + SourceIndex(0) +2 >Emitted(18, 10) Source(3, 6) + SourceIndex(0) +3 >Emitted(18, 11) Source(3, 7) + SourceIndex(0) --- >>> } 1 >^^^^ @@ -150,8 +151,8 @@ sourceFile:ES5For-of35.ts 1 > > 2 > } -1 >Emitted(18, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(18, 6) Source(4, 2) + SourceIndex(0) +1 >Emitted(19, 5) Source(4, 1) + SourceIndex(0) +2 >Emitted(19, 6) Source(4, 2) + SourceIndex(0) --- >>>} >>>catch (e_1_1) { e_1 = { error: e_1_1 }; } diff --git a/tests/baselines/reference/ES5For-of36(target=es2015).js b/tests/baselines/reference/ES5For-of36(target=es2015).js index dd91fc95a43ce..dde2cc8ec5440 100644 --- a/tests/baselines/reference/ES5For-of36(target=es2015).js +++ b/tests/baselines/reference/ES5For-of36(target=es2015).js @@ -7,6 +7,7 @@ for (let [a = 0, b = 1] of [2, 3]) { } //// [ES5For-of36.js] +"use strict"; for (let [a = 0, b = 1] of [2, 3]) { a; b; diff --git a/tests/baselines/reference/ES5For-of36(target=es2015).js.map b/tests/baselines/reference/ES5For-of36(target=es2015).js.map index cfe267605f3e3..a5125e9ba6967 100644 --- a/tests/baselines/reference/ES5For-of36(target=es2015).js.map +++ b/tests/baselines/reference/ES5For-of36(target=es2015).js.map @@ -1,3 +1,3 @@ //// [ES5For-of36.js.map] -{"version":3,"file":"ES5For-of36.js","sourceRoot":"","sources":["ES5For-of36.ts"],"names":[],"mappings":"AAAA,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;IAChC,CAAC,CAAC;IACF,CAAC,CAAC;AACN,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,Zm9yIChsZXQgW2EgPSAwLCBiID0gMV0gb2YgWzIsIDNdKSB7DQogICAgYTsNCiAgICBiOw0KfQ0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9RVM1Rm9yLW9mMzYuanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMzYuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YzNi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxLQUFLLElBQUksQ0FBQyxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsR0FBRyxDQUFDLENBQUMsSUFBSSxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsRUFBRSxDQUFDO0lBQ2hDLENBQUMsQ0FBQztJQUNGLENBQUMsQ0FBQztBQUNOLENBQUMifQ==,Zm9yIChsZXQgW2EgPSAwLCBiID0gMV0gb2YgWzIsIDNdKSB7CiAgICBhOwogICAgYjsKfQ== +{"version":3,"file":"ES5For-of36.js","sourceRoot":"","sources":["ES5For-of36.ts"],"names":[],"mappings":";AAAA,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;IAChC,CAAC,CAAC;IACF,CAAC,CAAC;AACN,CAAC"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KZm9yIChsZXQgW2EgPSAwLCBiID0gMV0gb2YgWzIsIDNdKSB7DQogICAgYTsNCiAgICBiOw0KfQ0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9RVM1Rm9yLW9mMzYuanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMzYuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YzNi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsS0FBSyxJQUFJLENBQUMsQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEdBQUcsQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLEVBQUUsQ0FBQztJQUNoQyxDQUFDLENBQUM7SUFDRixDQUFDLENBQUM7QUFDTixDQUFDIn0=,Zm9yIChsZXQgW2EgPSAwLCBiID0gMV0gb2YgWzIsIDNdKSB7CiAgICBhOwogICAgYjsKfQ== diff --git a/tests/baselines/reference/ES5For-of36(target=es2015).sourcemap.txt b/tests/baselines/reference/ES5For-of36(target=es2015).sourcemap.txt index 03acfa9fab6ff..ee613c44d6d73 100644 --- a/tests/baselines/reference/ES5For-of36(target=es2015).sourcemap.txt +++ b/tests/baselines/reference/ES5For-of36(target=es2015).sourcemap.txt @@ -8,6 +8,7 @@ sources: ES5For-of36.ts emittedFile:ES5For-of36.js sourceFile:ES5For-of36.ts ------------------------------------------------------------------- +>>>"use strict"; >>>for (let [a = 0, b = 1] of [2, 3]) { 1 > 2 >^^^^^ @@ -49,26 +50,26 @@ sourceFile:ES5For-of36.ts 18> ] 19> ) 20> { -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) -3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -7 >Emitted(1, 16) Source(1, 16) + SourceIndex(0) -8 >Emitted(1, 18) Source(1, 18) + SourceIndex(0) -9 >Emitted(1, 19) Source(1, 19) + SourceIndex(0) -10>Emitted(1, 22) Source(1, 22) + SourceIndex(0) -11>Emitted(1, 23) Source(1, 23) + SourceIndex(0) -12>Emitted(1, 24) Source(1, 24) + SourceIndex(0) -13>Emitted(1, 28) Source(1, 28) + SourceIndex(0) -14>Emitted(1, 29) Source(1, 29) + SourceIndex(0) -15>Emitted(1, 30) Source(1, 30) + SourceIndex(0) -16>Emitted(1, 32) Source(1, 32) + SourceIndex(0) -17>Emitted(1, 33) Source(1, 33) + SourceIndex(0) -18>Emitted(1, 34) Source(1, 34) + SourceIndex(0) -19>Emitted(1, 36) Source(1, 36) + SourceIndex(0) -20>Emitted(1, 37) Source(1, 37) + SourceIndex(0) +1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 6) Source(1, 6) + SourceIndex(0) +3 >Emitted(2, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(2, 11) Source(1, 11) + SourceIndex(0) +5 >Emitted(2, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(2, 15) Source(1, 15) + SourceIndex(0) +7 >Emitted(2, 16) Source(1, 16) + SourceIndex(0) +8 >Emitted(2, 18) Source(1, 18) + SourceIndex(0) +9 >Emitted(2, 19) Source(1, 19) + SourceIndex(0) +10>Emitted(2, 22) Source(1, 22) + SourceIndex(0) +11>Emitted(2, 23) Source(1, 23) + SourceIndex(0) +12>Emitted(2, 24) Source(1, 24) + SourceIndex(0) +13>Emitted(2, 28) Source(1, 28) + SourceIndex(0) +14>Emitted(2, 29) Source(1, 29) + SourceIndex(0) +15>Emitted(2, 30) Source(1, 30) + SourceIndex(0) +16>Emitted(2, 32) Source(1, 32) + SourceIndex(0) +17>Emitted(2, 33) Source(1, 33) + SourceIndex(0) +18>Emitted(2, 34) Source(1, 34) + SourceIndex(0) +19>Emitted(2, 36) Source(1, 36) + SourceIndex(0) +20>Emitted(2, 37) Source(1, 37) + SourceIndex(0) --- >>> a; 1 >^^^^ @@ -79,9 +80,9 @@ sourceFile:ES5For-of36.ts > 2 > a 3 > ; -1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -2 >Emitted(2, 6) Source(2, 6) + SourceIndex(0) -3 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) +1 >Emitted(3, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(3, 6) Source(2, 6) + SourceIndex(0) +3 >Emitted(3, 7) Source(2, 7) + SourceIndex(0) --- >>> b; 1->^^^^ @@ -91,9 +92,9 @@ sourceFile:ES5For-of36.ts > 2 > b 3 > ; -1->Emitted(3, 5) Source(3, 5) + SourceIndex(0) -2 >Emitted(3, 6) Source(3, 6) + SourceIndex(0) -3 >Emitted(3, 7) Source(3, 7) + SourceIndex(0) +1->Emitted(4, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(4, 6) Source(3, 6) + SourceIndex(0) +3 >Emitted(4, 7) Source(3, 7) + SourceIndex(0) --- >>>} 1 > @@ -102,7 +103,7 @@ sourceFile:ES5For-of36.ts 1 > > 2 >} -1 >Emitted(4, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 2) Source(4, 2) + SourceIndex(0) +1 >Emitted(5, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(5, 2) Source(4, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=ES5For-of36.js.map \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of36(target=es5).js b/tests/baselines/reference/ES5For-of36(target=es5).js index be5150ce8f928..1d6c27c2ae508 100644 --- a/tests/baselines/reference/ES5For-of36(target=es5).js +++ b/tests/baselines/reference/ES5For-of36(target=es5).js @@ -7,6 +7,7 @@ for (let [a = 0, b = 1] of [2, 3]) { } //// [ES5For-of36.js] +"use strict"; var __values = (this && this.__values) || function(o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); diff --git a/tests/baselines/reference/ES5For-of36(target=es5).js.map b/tests/baselines/reference/ES5For-of36(target=es5).js.map index 989da082d8011..10515f9b273a5 100644 --- a/tests/baselines/reference/ES5For-of36(target=es5).js.map +++ b/tests/baselines/reference/ES5For-of36(target=es5).js.map @@ -1,3 +1,3 @@ //// [ES5For-of36.js.map] -{"version":3,"file":"ES5For-of36.js","sourceRoot":"","sources":["ES5For-of36.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA,KAA2B,IAAA,KAAA,SAAA,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,gBAAA,4BAAE,CAAC;QAA3B,IAAA,KAAA,mBAAc,EAAb,UAAK,EAAL,CAAC,mBAAG,CAAC,KAAA,EAAE,UAAK,EAAL,CAAC,mBAAG,CAAC,KAAA;QAClB,CAAC,CAAC;QACF,CAAC,CAAC;IACN,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,dmFyIF9fdmFsdWVzID0gKHRoaXMgJiYgdGhpcy5fX3ZhbHVlcykgfHwgZnVuY3Rpb24obykgew0KICAgIHZhciBzID0gdHlwZW9mIFN5bWJvbCA9PT0gImZ1bmN0aW9uIiAmJiBTeW1ib2wuaXRlcmF0b3IsIG0gPSBzICYmIG9bc10sIGkgPSAwOw0KICAgIGlmIChtKSByZXR1cm4gbS5jYWxsKG8pOw0KICAgIGlmIChvICYmIHR5cGVvZiBvLmxlbmd0aCA9PT0gIm51bWJlciIpIHJldHVybiB7DQogICAgICAgIG5leHQ6IGZ1bmN0aW9uICgpIHsNCiAgICAgICAgICAgIGlmIChvICYmIGkgPj0gby5sZW5ndGgpIG8gPSB2b2lkIDA7DQogICAgICAgICAgICByZXR1cm4geyB2YWx1ZTogbyAmJiBvW2krK10sIGRvbmU6ICFvIH07DQogICAgICAgIH0NCiAgICB9Ow0KICAgIHRocm93IG5ldyBUeXBlRXJyb3IocyA/ICJPYmplY3QgaXMgbm90IGl0ZXJhYmxlLiIgOiAiU3ltYm9sLml0ZXJhdG9yIGlzIG5vdCBkZWZpbmVkLiIpOw0KfTsNCnZhciBfX3JlYWQgPSAodGhpcyAmJiB0aGlzLl9fcmVhZCkgfHwgZnVuY3Rpb24gKG8sIG4pIHsNCiAgICB2YXIgbSA9IHR5cGVvZiBTeW1ib2wgPT09ICJmdW5jdGlvbiIgJiYgb1tTeW1ib2wuaXRlcmF0b3JdOw0KICAgIGlmICghbSkgcmV0dXJuIG87DQogICAgdmFyIGkgPSBtLmNhbGwobyksIHIsIGFyID0gW10sIGU7DQogICAgdHJ5IHsNCiAgICAgICAgd2hpbGUgKChuID09PSB2b2lkIDAgfHwgbi0tID4gMCkgJiYgIShyID0gaS5uZXh0KCkpLmRvbmUpIGFyLnB1c2goci52YWx1ZSk7DQogICAgfQ0KICAgIGNhdGNoIChlcnJvcikgeyBlID0geyBlcnJvcjogZXJyb3IgfTsgfQ0KICAgIGZpbmFsbHkgew0KICAgICAgICB0cnkgew0KICAgICAgICAgICAgaWYgKHIgJiYgIXIuZG9uZSAmJiAobSA9IGlbInJldHVybiJdKSkgbS5jYWxsKGkpOw0KICAgICAgICB9DQogICAgICAgIGZpbmFsbHkgeyBpZiAoZSkgdGhyb3cgZS5lcnJvcjsgfQ0KICAgIH0NCiAgICByZXR1cm4gYXI7DQp9Ow0KdmFyIGVfMSwgX2E7DQp0cnkgew0KICAgIGZvciAodmFyIF9iID0gX192YWx1ZXMoWzIsIDNdKSwgX2MgPSBfYi5uZXh0KCk7ICFfYy5kb25lOyBfYyA9IF9iLm5leHQoKSkgew0KICAgICAgICB2YXIgX2QgPSBfX3JlYWQoX2MudmFsdWUsIDIpLCBfZSA9IF9kWzBdLCBhID0gX2UgPT09IHZvaWQgMCA/IDAgOiBfZSwgX2YgPSBfZFsxXSwgYiA9IF9mID09PSB2b2lkIDAgPyAxIDogX2Y7DQogICAgICAgIGE7DQogICAgICAgIGI7DQogICAgfQ0KfQ0KY2F0Y2ggKGVfMV8xKSB7IGVfMSA9IHsgZXJyb3I6IGVfMV8xIH07IH0NCmZpbmFsbHkgew0KICAgIHRyeSB7DQogICAgICAgIGlmIChfYyAmJiAhX2MuZG9uZSAmJiAoX2EgPSBfYi5yZXR1cm4pKSBfYS5jYWxsKF9iKTsNCiAgICB9DQogICAgZmluYWxseSB7IGlmIChlXzEpIHRocm93IGVfMS5lcnJvcjsgfQ0KfQ0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9RVM1Rm9yLW9mMzYuanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMzYuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YzNi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztJQUFBLEtBQTJCLElBQUEsS0FBQSxTQUFBLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFBLGdCQUFBLDRCQUFFLENBQUM7UUFBM0IsSUFBQSxLQUFBLG1CQUFjLEVBQWIsVUFBSyxFQUFMLENBQUMsbUJBQUcsQ0FBQyxLQUFBLEVBQUUsVUFBSyxFQUFMLENBQUMsbUJBQUcsQ0FBQyxLQUFBO1FBQ2xCLENBQUMsQ0FBQztRQUNGLENBQUMsQ0FBQztJQUNOLENBQUMifQ==,Zm9yIChsZXQgW2EgPSAwLCBiID0gMV0gb2YgWzIsIDNdKSB7CiAgICBhOwogICAgYjsKfQ== +{"version":3,"file":"ES5For-of36.js","sourceRoot":"","sources":["ES5For-of36.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA,KAA2B,IAAA,KAAA,SAAA,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,gBAAA,4BAAE,CAAC;QAA3B,IAAA,KAAA,mBAAc,EAAb,UAAK,EAAL,CAAC,mBAAG,CAAC,KAAA,EAAE,UAAK,EAAL,CAAC,mBAAG,CAAC,KAAA;QAClB,CAAC,CAAC;QACF,CAAC,CAAC;IACN,CAAC"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KdmFyIF9fdmFsdWVzID0gKHRoaXMgJiYgdGhpcy5fX3ZhbHVlcykgfHwgZnVuY3Rpb24obykgew0KICAgIHZhciBzID0gdHlwZW9mIFN5bWJvbCA9PT0gImZ1bmN0aW9uIiAmJiBTeW1ib2wuaXRlcmF0b3IsIG0gPSBzICYmIG9bc10sIGkgPSAwOw0KICAgIGlmIChtKSByZXR1cm4gbS5jYWxsKG8pOw0KICAgIGlmIChvICYmIHR5cGVvZiBvLmxlbmd0aCA9PT0gIm51bWJlciIpIHJldHVybiB7DQogICAgICAgIG5leHQ6IGZ1bmN0aW9uICgpIHsNCiAgICAgICAgICAgIGlmIChvICYmIGkgPj0gby5sZW5ndGgpIG8gPSB2b2lkIDA7DQogICAgICAgICAgICByZXR1cm4geyB2YWx1ZTogbyAmJiBvW2krK10sIGRvbmU6ICFvIH07DQogICAgICAgIH0NCiAgICB9Ow0KICAgIHRocm93IG5ldyBUeXBlRXJyb3IocyA/ICJPYmplY3QgaXMgbm90IGl0ZXJhYmxlLiIgOiAiU3ltYm9sLml0ZXJhdG9yIGlzIG5vdCBkZWZpbmVkLiIpOw0KfTsNCnZhciBfX3JlYWQgPSAodGhpcyAmJiB0aGlzLl9fcmVhZCkgfHwgZnVuY3Rpb24gKG8sIG4pIHsNCiAgICB2YXIgbSA9IHR5cGVvZiBTeW1ib2wgPT09ICJmdW5jdGlvbiIgJiYgb1tTeW1ib2wuaXRlcmF0b3JdOw0KICAgIGlmICghbSkgcmV0dXJuIG87DQogICAgdmFyIGkgPSBtLmNhbGwobyksIHIsIGFyID0gW10sIGU7DQogICAgdHJ5IHsNCiAgICAgICAgd2hpbGUgKChuID09PSB2b2lkIDAgfHwgbi0tID4gMCkgJiYgIShyID0gaS5uZXh0KCkpLmRvbmUpIGFyLnB1c2goci52YWx1ZSk7DQogICAgfQ0KICAgIGNhdGNoIChlcnJvcikgeyBlID0geyBlcnJvcjogZXJyb3IgfTsgfQ0KICAgIGZpbmFsbHkgew0KICAgICAgICB0cnkgew0KICAgICAgICAgICAgaWYgKHIgJiYgIXIuZG9uZSAmJiAobSA9IGlbInJldHVybiJdKSkgbS5jYWxsKGkpOw0KICAgICAgICB9DQogICAgICAgIGZpbmFsbHkgeyBpZiAoZSkgdGhyb3cgZS5lcnJvcjsgfQ0KICAgIH0NCiAgICByZXR1cm4gYXI7DQp9Ow0KdmFyIGVfMSwgX2E7DQp0cnkgew0KICAgIGZvciAodmFyIF9iID0gX192YWx1ZXMoWzIsIDNdKSwgX2MgPSBfYi5uZXh0KCk7ICFfYy5kb25lOyBfYyA9IF9iLm5leHQoKSkgew0KICAgICAgICB2YXIgX2QgPSBfX3JlYWQoX2MudmFsdWUsIDIpLCBfZSA9IF9kWzBdLCBhID0gX2UgPT09IHZvaWQgMCA/IDAgOiBfZSwgX2YgPSBfZFsxXSwgYiA9IF9mID09PSB2b2lkIDAgPyAxIDogX2Y7DQogICAgICAgIGE7DQogICAgICAgIGI7DQogICAgfQ0KfQ0KY2F0Y2ggKGVfMV8xKSB7IGVfMSA9IHsgZXJyb3I6IGVfMV8xIH07IH0NCmZpbmFsbHkgew0KICAgIHRyeSB7DQogICAgICAgIGlmIChfYyAmJiAhX2MuZG9uZSAmJiAoX2EgPSBfYi5yZXR1cm4pKSBfYS5jYWxsKF9iKTsNCiAgICB9DQogICAgZmluYWxseSB7IGlmIChlXzEpIHRocm93IGVfMS5lcnJvcjsgfQ0KfQ0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9RVM1Rm9yLW9mMzYuanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMzYuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YzNi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7SUFBQSxLQUEyQixJQUFBLEtBQUEsU0FBQSxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQSxnQkFBQSw0QkFBRSxDQUFDO1FBQTNCLElBQUEsS0FBQSxtQkFBYyxFQUFiLFVBQUssRUFBTCxDQUFDLG1CQUFHLENBQUMsS0FBQSxFQUFFLFVBQUssRUFBTCxDQUFDLG1CQUFHLENBQUMsS0FBQTtRQUNsQixDQUFDLENBQUM7UUFDRixDQUFDLENBQUM7SUFDTixDQUFDIn0=,Zm9yIChsZXQgW2EgPSAwLCBiID0gMV0gb2YgWzIsIDNdKSB7CiAgICBhOwogICAgYjsKfQ== diff --git a/tests/baselines/reference/ES5For-of36(target=es5).sourcemap.txt b/tests/baselines/reference/ES5For-of36(target=es5).sourcemap.txt index a15d71e2a08e8..9121ed080850d 100644 --- a/tests/baselines/reference/ES5For-of36(target=es5).sourcemap.txt +++ b/tests/baselines/reference/ES5For-of36(target=es5).sourcemap.txt @@ -8,6 +8,7 @@ sources: ES5For-of36.ts emittedFile:ES5For-of36.js sourceFile:ES5For-of36.ts ------------------------------------------------------------------- +>>>"use strict"; >>>var __values = (this && this.__values) || function(o) { >>> var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; >>> if (m) return m.call(o); @@ -67,20 +68,20 @@ sourceFile:ES5For-of36.ts 12> 13> ) 14> { -1 >Emitted(30, 5) Source(1, 1) + SourceIndex(0) -2 >Emitted(30, 10) Source(1, 28) + SourceIndex(0) -3 >Emitted(30, 14) Source(1, 28) + SourceIndex(0) -4 >Emitted(30, 19) Source(1, 28) + SourceIndex(0) -5 >Emitted(30, 28) Source(1, 28) + SourceIndex(0) -6 >Emitted(30, 29) Source(1, 29) + SourceIndex(0) -7 >Emitted(30, 30) Source(1, 30) + SourceIndex(0) -8 >Emitted(30, 32) Source(1, 32) + SourceIndex(0) -9 >Emitted(30, 33) Source(1, 33) + SourceIndex(0) -10>Emitted(30, 34) Source(1, 34) + SourceIndex(0) -11>Emitted(30, 35) Source(1, 34) + SourceIndex(0) -12>Emitted(30, 51) Source(1, 34) + SourceIndex(0) -13>Emitted(30, 79) Source(1, 36) + SourceIndex(0) -14>Emitted(30, 80) Source(1, 37) + SourceIndex(0) +1 >Emitted(31, 5) Source(1, 1) + SourceIndex(0) +2 >Emitted(31, 10) Source(1, 28) + SourceIndex(0) +3 >Emitted(31, 14) Source(1, 28) + SourceIndex(0) +4 >Emitted(31, 19) Source(1, 28) + SourceIndex(0) +5 >Emitted(31, 28) Source(1, 28) + SourceIndex(0) +6 >Emitted(31, 29) Source(1, 29) + SourceIndex(0) +7 >Emitted(31, 30) Source(1, 30) + SourceIndex(0) +8 >Emitted(31, 32) Source(1, 32) + SourceIndex(0) +9 >Emitted(31, 33) Source(1, 33) + SourceIndex(0) +10>Emitted(31, 34) Source(1, 34) + SourceIndex(0) +11>Emitted(31, 35) Source(1, 34) + SourceIndex(0) +12>Emitted(31, 51) Source(1, 34) + SourceIndex(0) +13>Emitted(31, 79) Source(1, 36) + SourceIndex(0) +14>Emitted(31, 80) Source(1, 37) + SourceIndex(0) --- >>> var _d = __read(_c.value, 2), _e = _d[0], a = _e === void 0 ? 0 : _e, _f = _d[1], b = _f === void 0 ? 1 : _f; 1->^^^^^^^^ @@ -119,24 +120,24 @@ sourceFile:ES5For-of36.ts 16> = 17> 1 18> -1->Emitted(31, 9) Source(1, 10) + SourceIndex(0) -2 >Emitted(31, 13) Source(1, 10) + SourceIndex(0) -3 >Emitted(31, 18) Source(1, 10) + SourceIndex(0) -4 >Emitted(31, 37) Source(1, 24) + SourceIndex(0) -5 >Emitted(31, 39) Source(1, 11) + SourceIndex(0) -6 >Emitted(31, 49) Source(1, 16) + SourceIndex(0) -7 >Emitted(31, 51) Source(1, 11) + SourceIndex(0) -8 >Emitted(31, 52) Source(1, 12) + SourceIndex(0) -9 >Emitted(31, 71) Source(1, 15) + SourceIndex(0) -10>Emitted(31, 72) Source(1, 16) + SourceIndex(0) -11>Emitted(31, 77) Source(1, 16) + SourceIndex(0) -12>Emitted(31, 79) Source(1, 18) + SourceIndex(0) -13>Emitted(31, 89) Source(1, 23) + SourceIndex(0) -14>Emitted(31, 91) Source(1, 18) + SourceIndex(0) -15>Emitted(31, 92) Source(1, 19) + SourceIndex(0) -16>Emitted(31, 111) Source(1, 22) + SourceIndex(0) -17>Emitted(31, 112) Source(1, 23) + SourceIndex(0) -18>Emitted(31, 117) Source(1, 23) + SourceIndex(0) +1->Emitted(32, 9) Source(1, 10) + SourceIndex(0) +2 >Emitted(32, 13) Source(1, 10) + SourceIndex(0) +3 >Emitted(32, 18) Source(1, 10) + SourceIndex(0) +4 >Emitted(32, 37) Source(1, 24) + SourceIndex(0) +5 >Emitted(32, 39) Source(1, 11) + SourceIndex(0) +6 >Emitted(32, 49) Source(1, 16) + SourceIndex(0) +7 >Emitted(32, 51) Source(1, 11) + SourceIndex(0) +8 >Emitted(32, 52) Source(1, 12) + SourceIndex(0) +9 >Emitted(32, 71) Source(1, 15) + SourceIndex(0) +10>Emitted(32, 72) Source(1, 16) + SourceIndex(0) +11>Emitted(32, 77) Source(1, 16) + SourceIndex(0) +12>Emitted(32, 79) Source(1, 18) + SourceIndex(0) +13>Emitted(32, 89) Source(1, 23) + SourceIndex(0) +14>Emitted(32, 91) Source(1, 18) + SourceIndex(0) +15>Emitted(32, 92) Source(1, 19) + SourceIndex(0) +16>Emitted(32, 111) Source(1, 22) + SourceIndex(0) +17>Emitted(32, 112) Source(1, 23) + SourceIndex(0) +18>Emitted(32, 117) Source(1, 23) + SourceIndex(0) --- >>> a; 1 >^^^^^^^^ @@ -147,9 +148,9 @@ sourceFile:ES5For-of36.ts > 2 > a 3 > ; -1 >Emitted(32, 9) Source(2, 5) + SourceIndex(0) -2 >Emitted(32, 10) Source(2, 6) + SourceIndex(0) -3 >Emitted(32, 11) Source(2, 7) + SourceIndex(0) +1 >Emitted(33, 9) Source(2, 5) + SourceIndex(0) +2 >Emitted(33, 10) Source(2, 6) + SourceIndex(0) +3 >Emitted(33, 11) Source(2, 7) + SourceIndex(0) --- >>> b; 1->^^^^^^^^ @@ -159,9 +160,9 @@ sourceFile:ES5For-of36.ts > 2 > b 3 > ; -1->Emitted(33, 9) Source(3, 5) + SourceIndex(0) -2 >Emitted(33, 10) Source(3, 6) + SourceIndex(0) -3 >Emitted(33, 11) Source(3, 7) + SourceIndex(0) +1->Emitted(34, 9) Source(3, 5) + SourceIndex(0) +2 >Emitted(34, 10) Source(3, 6) + SourceIndex(0) +3 >Emitted(34, 11) Source(3, 7) + SourceIndex(0) --- >>> } 1 >^^^^ @@ -169,8 +170,8 @@ sourceFile:ES5For-of36.ts 1 > > 2 > } -1 >Emitted(34, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(34, 6) Source(4, 2) + SourceIndex(0) +1 >Emitted(35, 5) Source(4, 1) + SourceIndex(0) +2 >Emitted(35, 6) Source(4, 2) + SourceIndex(0) --- >>>} >>>catch (e_1_1) { e_1 = { error: e_1_1 }; } diff --git a/tests/baselines/reference/ES5For-of37(target=es2015).js b/tests/baselines/reference/ES5For-of37(target=es2015).js index 4bf3af2c37343..44111f96ab7cd 100644 --- a/tests/baselines/reference/ES5For-of37(target=es2015).js +++ b/tests/baselines/reference/ES5For-of37(target=es2015).js @@ -18,6 +18,7 @@ for (const i of [0, 1, 2, 3, 4]) { } //// [ES5For-of37.js] +"use strict"; // https://github.com/microsoft/TypeScript/issues/30083 for (const i of [0, 1, 2, 3, 4]) { try { diff --git a/tests/baselines/reference/ES5For-of37(target=es2015).types b/tests/baselines/reference/ES5For-of37(target=es2015).types index 58c2d9689f3f5..547dd69989e1d 100644 --- a/tests/baselines/reference/ES5For-of37(target=es2015).types +++ b/tests/baselines/reference/ES5For-of37(target=es2015).types @@ -63,7 +63,8 @@ for (const i of [0, 1, 2, 3, 4]) { > : ^^^^^^ } catch (err) { ->err : any +>err : unknown +> : ^^^^^^^ console.log('E %s %s', i, err); >console.log('E %s %s', i, err) : void @@ -78,6 +79,7 @@ for (const i of [0, 1, 2, 3, 4]) { > : ^^^^^^^^^ >i : number > : ^^^^^^ ->err : any +>err : unknown +> : ^^^^^^^ } } diff --git a/tests/baselines/reference/ES5For-of37(target=es5).js b/tests/baselines/reference/ES5For-of37(target=es5).js index 5f388c3ae482d..b5f60068d3a9a 100644 --- a/tests/baselines/reference/ES5For-of37(target=es5).js +++ b/tests/baselines/reference/ES5For-of37(target=es5).js @@ -18,6 +18,7 @@ for (const i of [0, 1, 2, 3, 4]) { } //// [ES5For-of37.js] +"use strict"; // https://github.com/microsoft/TypeScript/issues/30083 var __values = (this && this.__values) || function(o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; diff --git a/tests/baselines/reference/ES5For-of37(target=es5).types b/tests/baselines/reference/ES5For-of37(target=es5).types index 232bb657472a6..547dd69989e1d 100644 --- a/tests/baselines/reference/ES5For-of37(target=es5).types +++ b/tests/baselines/reference/ES5For-of37(target=es5).types @@ -63,8 +63,8 @@ for (const i of [0, 1, 2, 3, 4]) { > : ^^^^^^ } catch (err) { ->err : any -> : ^^^ +>err : unknown +> : ^^^^^^^ console.log('E %s %s', i, err); >console.log('E %s %s', i, err) : void @@ -79,7 +79,7 @@ for (const i of [0, 1, 2, 3, 4]) { > : ^^^^^^^^^ >i : number > : ^^^^^^ ->err : any -> : ^^^ +>err : unknown +> : ^^^^^^^ } } diff --git a/tests/baselines/reference/ES5For-of4(target=es2015).js b/tests/baselines/reference/ES5For-of4(target=es2015).js index 497507bb4f7b0..a6557f370f252 100644 --- a/tests/baselines/reference/ES5For-of4(target=es2015).js +++ b/tests/baselines/reference/ES5For-of4(target=es2015).js @@ -6,6 +6,7 @@ for (var v of []) var y = v; //// [ES5For-of4.js] +"use strict"; for (var v of []) var x = v; var y = v; diff --git a/tests/baselines/reference/ES5For-of4(target=es5).js b/tests/baselines/reference/ES5For-of4(target=es5).js index f9966ad370998..d1d45ef9b7daf 100644 --- a/tests/baselines/reference/ES5For-of4(target=es5).js +++ b/tests/baselines/reference/ES5For-of4(target=es5).js @@ -6,6 +6,7 @@ for (var v of []) var y = v; //// [ES5For-of4.js] +"use strict"; for (var _i = 0, _a = []; _i < _a.length; _i++) { var v = _a[_i]; var x = v; diff --git a/tests/baselines/reference/ES5For-of5(target=es2015).js b/tests/baselines/reference/ES5For-of5(target=es2015).js index 795cd99365c42..cffb5f8cbe14b 100644 --- a/tests/baselines/reference/ES5For-of5(target=es2015).js +++ b/tests/baselines/reference/ES5For-of5(target=es2015).js @@ -6,6 +6,7 @@ for (var _a of []) { } //// [ES5For-of5.js] +"use strict"; for (var _a of []) { var x = _a; } diff --git a/tests/baselines/reference/ES5For-of5(target=es5).js b/tests/baselines/reference/ES5For-of5(target=es5).js index 42dc8a621accb..211b3f2733ddc 100644 --- a/tests/baselines/reference/ES5For-of5(target=es5).js +++ b/tests/baselines/reference/ES5For-of5(target=es5).js @@ -6,6 +6,7 @@ for (var _a of []) { } //// [ES5For-of5.js] +"use strict"; for (var _i = 0, _b = []; _i < _b.length; _i++) { var _a = _b[_i]; var x = _a; diff --git a/tests/baselines/reference/ES5For-of6(target=es2015).js b/tests/baselines/reference/ES5For-of6(target=es2015).js index e734734077bf1..c9047090c4f74 100644 --- a/tests/baselines/reference/ES5For-of6(target=es2015).js +++ b/tests/baselines/reference/ES5For-of6(target=es2015).js @@ -8,6 +8,7 @@ for (var w of []) { } //// [ES5For-of6.js] +"use strict"; for (var w of []) { for (var v of []) { var x = [w, v]; diff --git a/tests/baselines/reference/ES5For-of6(target=es5).js b/tests/baselines/reference/ES5For-of6(target=es5).js index 1023bbf09269c..fdef5f97f199d 100644 --- a/tests/baselines/reference/ES5For-of6(target=es5).js +++ b/tests/baselines/reference/ES5For-of6(target=es5).js @@ -8,6 +8,7 @@ for (var w of []) { } //// [ES5For-of6.js] +"use strict"; for (var _i = 0, _a = []; _i < _a.length; _i++) { var w = _a[_i]; for (var _b = 0, _c = []; _b < _c.length; _b++) { diff --git a/tests/baselines/reference/ES5For-of7(target=es2015).errors.txt b/tests/baselines/reference/ES5For-of7(target=es2015).errors.txt index 321726f9e2572..b7acf085b96c1 100644 --- a/tests/baselines/reference/ES5For-of7(target=es2015).errors.txt +++ b/tests/baselines/reference/ES5For-of7(target=es2015).errors.txt @@ -1,7 +1,8 @@ -ES5For-of7.ts(6,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'any[]'. +ES5For-of7.ts(6,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'never', but here has type 'never[]'. +ES5For-of7.ts(6,14): error TS2454: Variable 'w' is used before being assigned. -==== ES5For-of7.ts (1 errors) ==== +==== ES5For-of7.ts (2 errors) ==== for (var w of []) { var x = w; } @@ -9,6 +10,8 @@ ES5For-of7.ts(6,9): error TS2403: Subsequent variable declarations must have the for (var v of []) { var x = [w, v]; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'any[]'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'never', but here has type 'never[]'. !!! related TS6203 ES5For-of7.ts:2:9: 'x' was also declared here. + ~ +!!! error TS2454: Variable 'w' is used before being assigned. } \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of7(target=es2015).js b/tests/baselines/reference/ES5For-of7(target=es2015).js index 2cb31ac52e2fa..bf605434ecac0 100644 --- a/tests/baselines/reference/ES5For-of7(target=es2015).js +++ b/tests/baselines/reference/ES5For-of7(target=es2015).js @@ -10,6 +10,7 @@ for (var v of []) { } //// [ES5For-of7.js] +"use strict"; for (var w of []) { var x = w; } diff --git a/tests/baselines/reference/ES5For-of7(target=es2015).types b/tests/baselines/reference/ES5For-of7(target=es2015).types index 5c3d6231b8457..383c139bf9ec3 100644 --- a/tests/baselines/reference/ES5For-of7(target=es2015).types +++ b/tests/baselines/reference/ES5For-of7(target=es2015).types @@ -2,31 +2,31 @@ === ES5For-of7.ts === for (var w of []) { ->w : any -> : ^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>w : never +> : ^^^^^ +>[] : never[] +> : ^^^^^^^ var x = w; ->x : any -> : ^^^ ->w : any -> : ^^^ +>x : never +> : ^^^^^ +>w : never +> : ^^^^^ } for (var v of []) { ->v : any -> : ^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>v : never +> : ^^^^^ +>[] : never[] +> : ^^^^^^^ var x = [w, v]; ->x : any -> : ^^^ ->[w, v] : any[] -> : ^^^^^ ->w : any -> : ^^^ ->v : any -> : ^^^ +>x : never +> : ^^^^^ +>[w, v] : never[] +> : ^^^^^^^ +>w : never +> : ^^^^^ +>v : never +> : ^^^^^ } diff --git a/tests/baselines/reference/ES5For-of7(target=es5).errors.txt b/tests/baselines/reference/ES5For-of7(target=es5).errors.txt index edb709bd4ea5f..4161c08e730c5 100644 --- a/tests/baselines/reference/ES5For-of7(target=es5).errors.txt +++ b/tests/baselines/reference/ES5For-of7(target=es5).errors.txt @@ -1,9 +1,10 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -ES5For-of7.ts(6,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'any[]'. +ES5For-of7.ts(6,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'never', but here has type 'never[]'. +ES5For-of7.ts(6,14): error TS2454: Variable 'w' is used before being assigned. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== ES5For-of7.ts (1 errors) ==== +==== ES5For-of7.ts (2 errors) ==== for (var w of []) { var x = w; } @@ -11,6 +12,8 @@ ES5For-of7.ts(6,9): error TS2403: Subsequent variable declarations must have the for (var v of []) { var x = [w, v]; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'any[]'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'never', but here has type 'never[]'. !!! related TS6203 ES5For-of7.ts:2:9: 'x' was also declared here. + ~ +!!! error TS2454: Variable 'w' is used before being assigned. } \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of7(target=es5).js b/tests/baselines/reference/ES5For-of7(target=es5).js index b51417005045a..9febbfcc477aa 100644 --- a/tests/baselines/reference/ES5For-of7(target=es5).js +++ b/tests/baselines/reference/ES5For-of7(target=es5).js @@ -10,6 +10,7 @@ for (var v of []) { } //// [ES5For-of7.js] +"use strict"; for (var _i = 0, _a = []; _i < _a.length; _i++) { var w = _a[_i]; var x = w; diff --git a/tests/baselines/reference/ES5For-of7(target=es5).types b/tests/baselines/reference/ES5For-of7(target=es5).types index 5c3d6231b8457..383c139bf9ec3 100644 --- a/tests/baselines/reference/ES5For-of7(target=es5).types +++ b/tests/baselines/reference/ES5For-of7(target=es5).types @@ -2,31 +2,31 @@ === ES5For-of7.ts === for (var w of []) { ->w : any -> : ^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>w : never +> : ^^^^^ +>[] : never[] +> : ^^^^^^^ var x = w; ->x : any -> : ^^^ ->w : any -> : ^^^ +>x : never +> : ^^^^^ +>w : never +> : ^^^^^ } for (var v of []) { ->v : any -> : ^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>v : never +> : ^^^^^ +>[] : never[] +> : ^^^^^^^ var x = [w, v]; ->x : any -> : ^^^ ->[w, v] : any[] -> : ^^^^^ ->w : any -> : ^^^ ->v : any -> : ^^^ +>x : never +> : ^^^^^ +>[w, v] : never[] +> : ^^^^^^^ +>w : never +> : ^^^^^ +>v : never +> : ^^^^^ } diff --git a/tests/baselines/reference/ES5For-of8(target=es2015).js b/tests/baselines/reference/ES5For-of8(target=es2015).js index d70a3fada883f..50dc4a0849476 100644 --- a/tests/baselines/reference/ES5For-of8(target=es2015).js +++ b/tests/baselines/reference/ES5For-of8(target=es2015).js @@ -9,6 +9,7 @@ for (foo().x of ['a', 'b', 'c']) { } //// [ES5For-of8.js] +"use strict"; function foo() { return { x: 0 }; } diff --git a/tests/baselines/reference/ES5For-of8(target=es2015).js.map b/tests/baselines/reference/ES5For-of8(target=es2015).js.map index 97760cd0f5f7c..d9b589eca672a 100644 --- a/tests/baselines/reference/ES5For-of8(target=es2015).js.map +++ b/tests/baselines/reference/ES5For-of8(target=es2015).js.map @@ -1,3 +1,3 @@ //// [ES5For-of8.js.map] -{"version":3,"file":"ES5For-of8.js","sourceRoot":"","sources":["ES5For-of8.ts"],"names":[],"mappings":"AAAA,SAAS,GAAG;IACR,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACpB,CAAC;AACD,KAAK,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IAC9B,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;AACpB,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,ZnVuY3Rpb24gZm9vKCkgew0KICAgIHJldHVybiB7IHg6IDAgfTsNCn0NCmZvciAoZm9vKCkueCBvZiBbJ2EnLCAnYicsICdjJ10pIHsNCiAgICB2YXIgcCA9IGZvbygpLng7DQp9DQovLyMgc291cmNlTWFwcGluZ1VSTD1FUzVGb3Itb2Y4LmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mOC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIkVTNUZvci1vZjgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsU0FBUyxHQUFHO0lBQ1IsT0FBTyxFQUFFLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQztBQUNwQixDQUFDO0FBQ0QsS0FBSyxHQUFHLEVBQUUsQ0FBQyxDQUFDLElBQUksQ0FBQyxHQUFHLEVBQUUsR0FBRyxFQUFFLEdBQUcsQ0FBQyxFQUFFLENBQUM7SUFDOUIsSUFBSSxDQUFDLEdBQUcsR0FBRyxFQUFFLENBQUMsQ0FBQyxDQUFDO0FBQ3BCLENBQUMifQ==,ZnVuY3Rpb24gZm9vKCkgewogICAgcmV0dXJuIHsgeDogMCB9Owp9CmZvciAoZm9vKCkueCBvZiBbJ2EnLCAnYicsICdjJ10pIHsKICAgIHZhciBwID0gZm9vKCkueDsKfQ== +{"version":3,"file":"ES5For-of8.js","sourceRoot":"","sources":["ES5For-of8.ts"],"names":[],"mappings":";AAAA,SAAS,GAAG;IACR,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACpB,CAAC;AACD,KAAK,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IAC9B,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;AACpB,CAAC"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KZnVuY3Rpb24gZm9vKCkgew0KICAgIHJldHVybiB7IHg6IDAgfTsNCn0NCmZvciAoZm9vKCkueCBvZiBbJ2EnLCAnYicsICdjJ10pIHsNCiAgICB2YXIgcCA9IGZvbygpLng7DQp9DQovLyMgc291cmNlTWFwcGluZ1VSTD1FUzVGb3Itb2Y4LmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mOC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIkVTNUZvci1vZjgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFNBQVMsR0FBRztJQUNSLE9BQU8sRUFBRSxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUM7QUFDcEIsQ0FBQztBQUNELEtBQUssR0FBRyxFQUFFLENBQUMsQ0FBQyxJQUFJLENBQUMsR0FBRyxFQUFFLEdBQUcsRUFBRSxHQUFHLENBQUMsRUFBRSxDQUFDO0lBQzlCLElBQUksQ0FBQyxHQUFHLEdBQUcsRUFBRSxDQUFDLENBQUMsQ0FBQztBQUNwQixDQUFDIn0=,ZnVuY3Rpb24gZm9vKCkgewogICAgcmV0dXJuIHsgeDogMCB9Owp9CmZvciAoZm9vKCkueCBvZiBbJ2EnLCAnYicsICdjJ10pIHsKICAgIHZhciBwID0gZm9vKCkueDsKfQ== diff --git a/tests/baselines/reference/ES5For-of8(target=es2015).sourcemap.txt b/tests/baselines/reference/ES5For-of8(target=es2015).sourcemap.txt index db2c386850e74..5164dceacce06 100644 --- a/tests/baselines/reference/ES5For-of8(target=es2015).sourcemap.txt +++ b/tests/baselines/reference/ES5For-of8(target=es2015).sourcemap.txt @@ -8,6 +8,7 @@ sources: ES5For-of8.ts emittedFile:ES5For-of8.js sourceFile:ES5For-of8.ts ------------------------------------------------------------------- +>>>"use strict"; >>>function foo() { 1 > 2 >^^^^^^^^^ @@ -16,9 +17,9 @@ sourceFile:ES5For-of8.ts 1 > 2 >function 3 > foo -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -3 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 10) Source(1, 10) + SourceIndex(0) +3 >Emitted(2, 13) Source(1, 13) + SourceIndex(0) --- >>> return { x: 0 }; 1->^^^^ @@ -38,14 +39,14 @@ sourceFile:ES5For-of8.ts 6 > 0 7 > } 8 > ; -1->Emitted(2, 5) Source(2, 5) + SourceIndex(0) -2 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -3 >Emitted(2, 14) Source(2, 14) + SourceIndex(0) -4 >Emitted(2, 15) Source(2, 15) + SourceIndex(0) -5 >Emitted(2, 17) Source(2, 17) + SourceIndex(0) -6 >Emitted(2, 18) Source(2, 18) + SourceIndex(0) -7 >Emitted(2, 20) Source(2, 20) + SourceIndex(0) -8 >Emitted(2, 21) Source(2, 21) + SourceIndex(0) +1->Emitted(3, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(3, 12) Source(2, 12) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) +4 >Emitted(3, 15) Source(2, 15) + SourceIndex(0) +5 >Emitted(3, 17) Source(2, 17) + SourceIndex(0) +6 >Emitted(3, 18) Source(2, 18) + SourceIndex(0) +7 >Emitted(3, 20) Source(2, 20) + SourceIndex(0) +8 >Emitted(3, 21) Source(2, 21) + SourceIndex(0) --- >>>} 1 > @@ -54,8 +55,8 @@ sourceFile:ES5For-of8.ts 1 > > 2 >} -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 2) Source(3, 2) + SourceIndex(0) +1 >Emitted(4, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(4, 2) Source(3, 2) + SourceIndex(0) --- >>>for (foo().x of ['a', 'b', 'c']) { 1-> @@ -91,22 +92,22 @@ sourceFile:ES5For-of8.ts 14> ] 15> ) 16> { -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 6) + SourceIndex(0) -3 >Emitted(4, 9) Source(4, 9) + SourceIndex(0) -4 >Emitted(4, 11) Source(4, 11) + SourceIndex(0) -5 >Emitted(4, 12) Source(4, 12) + SourceIndex(0) -6 >Emitted(4, 13) Source(4, 13) + SourceIndex(0) -7 >Emitted(4, 17) Source(4, 17) + SourceIndex(0) -8 >Emitted(4, 18) Source(4, 18) + SourceIndex(0) -9 >Emitted(4, 21) Source(4, 21) + SourceIndex(0) -10>Emitted(4, 23) Source(4, 23) + SourceIndex(0) -11>Emitted(4, 26) Source(4, 26) + SourceIndex(0) -12>Emitted(4, 28) Source(4, 28) + SourceIndex(0) -13>Emitted(4, 31) Source(4, 31) + SourceIndex(0) -14>Emitted(4, 32) Source(4, 32) + SourceIndex(0) -15>Emitted(4, 34) Source(4, 34) + SourceIndex(0) -16>Emitted(4, 35) Source(4, 35) + SourceIndex(0) +1->Emitted(5, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(5, 6) Source(4, 6) + SourceIndex(0) +3 >Emitted(5, 9) Source(4, 9) + SourceIndex(0) +4 >Emitted(5, 11) Source(4, 11) + SourceIndex(0) +5 >Emitted(5, 12) Source(4, 12) + SourceIndex(0) +6 >Emitted(5, 13) Source(4, 13) + SourceIndex(0) +7 >Emitted(5, 17) Source(4, 17) + SourceIndex(0) +8 >Emitted(5, 18) Source(4, 18) + SourceIndex(0) +9 >Emitted(5, 21) Source(4, 21) + SourceIndex(0) +10>Emitted(5, 23) Source(4, 23) + SourceIndex(0) +11>Emitted(5, 26) Source(4, 26) + SourceIndex(0) +12>Emitted(5, 28) Source(4, 28) + SourceIndex(0) +13>Emitted(5, 31) Source(4, 31) + SourceIndex(0) +14>Emitted(5, 32) Source(4, 32) + SourceIndex(0) +15>Emitted(5, 34) Source(4, 34) + SourceIndex(0) +16>Emitted(5, 35) Source(4, 35) + SourceIndex(0) --- >>> var p = foo().x; 1 >^^^^ @@ -128,15 +129,15 @@ sourceFile:ES5For-of8.ts 7 > . 8 > x 9 > ; -1 >Emitted(5, 5) Source(5, 5) + SourceIndex(0) -2 >Emitted(5, 9) Source(5, 9) + SourceIndex(0) -3 >Emitted(5, 10) Source(5, 10) + SourceIndex(0) -4 >Emitted(5, 13) Source(5, 13) + SourceIndex(0) -5 >Emitted(5, 16) Source(5, 16) + SourceIndex(0) -6 >Emitted(5, 18) Source(5, 18) + SourceIndex(0) -7 >Emitted(5, 19) Source(5, 19) + SourceIndex(0) -8 >Emitted(5, 20) Source(5, 20) + SourceIndex(0) -9 >Emitted(5, 21) Source(5, 21) + SourceIndex(0) +1 >Emitted(6, 5) Source(5, 5) + SourceIndex(0) +2 >Emitted(6, 9) Source(5, 9) + SourceIndex(0) +3 >Emitted(6, 10) Source(5, 10) + SourceIndex(0) +4 >Emitted(6, 13) Source(5, 13) + SourceIndex(0) +5 >Emitted(6, 16) Source(5, 16) + SourceIndex(0) +6 >Emitted(6, 18) Source(5, 18) + SourceIndex(0) +7 >Emitted(6, 19) Source(5, 19) + SourceIndex(0) +8 >Emitted(6, 20) Source(5, 20) + SourceIndex(0) +9 >Emitted(6, 21) Source(5, 21) + SourceIndex(0) --- >>>} 1 > @@ -145,7 +146,7 @@ sourceFile:ES5For-of8.ts 1 > > 2 >} -1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) +1 >Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 2) Source(6, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=ES5For-of8.js.map \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of8(target=es5).js b/tests/baselines/reference/ES5For-of8(target=es5).js index 72badc560ca64..0ec762a8de970 100644 --- a/tests/baselines/reference/ES5For-of8(target=es5).js +++ b/tests/baselines/reference/ES5For-of8(target=es5).js @@ -9,6 +9,7 @@ for (foo().x of ['a', 'b', 'c']) { } //// [ES5For-of8.js] +"use strict"; function foo() { return { x: 0 }; } diff --git a/tests/baselines/reference/ES5For-of8(target=es5).js.map b/tests/baselines/reference/ES5For-of8(target=es5).js.map index 488728ccce276..05a93dd5b1da0 100644 --- a/tests/baselines/reference/ES5For-of8(target=es5).js.map +++ b/tests/baselines/reference/ES5For-of8(target=es5).js.map @@ -1,3 +1,3 @@ //// [ES5For-of8.js.map] -{"version":3,"file":"ES5For-of8.js","sourceRoot":"","sources":["ES5For-of8.ts"],"names":[],"mappings":"AAAA,SAAS,GAAG;IACR,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACpB,CAAC;AACD,KAAgB,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAf,cAAe,EAAf,IAAe,EAAE,CAAC;IAA7B,GAAG,EAAE,CAAC,CAAC,SAAA;IACR,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;AACpB,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,ZnVuY3Rpb24gZm9vKCkgew0KICAgIHJldHVybiB7IHg6IDAgfTsNCn0NCmZvciAodmFyIF9pID0gMCwgX2EgPSBbJ2EnLCAnYicsICdjJ107IF9pIDwgX2EubGVuZ3RoOyBfaSsrKSB7DQogICAgZm9vKCkueCA9IF9hW19pXTsNCiAgICB2YXIgcCA9IGZvbygpLng7DQp9DQovLyMgc291cmNlTWFwcGluZ1VSTD1FUzVGb3Itb2Y4LmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mOC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIkVTNUZvci1vZjgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsU0FBUyxHQUFHO0lBQ1IsT0FBTyxFQUFFLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQztBQUNwQixDQUFDO0FBQ0QsS0FBZ0IsVUFBZSxFQUFmLE1BQUMsR0FBRyxFQUFFLEdBQUcsRUFBRSxHQUFHLENBQUMsRUFBZixjQUFlLEVBQWYsSUFBZSxFQUFFLENBQUM7SUFBN0IsR0FBRyxFQUFFLENBQUMsQ0FBQyxTQUFBO0lBQ1IsSUFBSSxDQUFDLEdBQUcsR0FBRyxFQUFFLENBQUMsQ0FBQyxDQUFDO0FBQ3BCLENBQUMifQ==,ZnVuY3Rpb24gZm9vKCkgewogICAgcmV0dXJuIHsgeDogMCB9Owp9CmZvciAoZm9vKCkueCBvZiBbJ2EnLCAnYicsICdjJ10pIHsKICAgIHZhciBwID0gZm9vKCkueDsKfQ== +{"version":3,"file":"ES5For-of8.js","sourceRoot":"","sources":["ES5For-of8.ts"],"names":[],"mappings":";AAAA,SAAS,GAAG;IACR,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACpB,CAAC;AACD,KAAgB,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAf,cAAe,EAAf,IAAe,EAAE,CAAC;IAA7B,GAAG,EAAE,CAAC,CAAC,SAAA;IACR,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;AACpB,CAAC"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KZnVuY3Rpb24gZm9vKCkgew0KICAgIHJldHVybiB7IHg6IDAgfTsNCn0NCmZvciAodmFyIF9pID0gMCwgX2EgPSBbJ2EnLCAnYicsICdjJ107IF9pIDwgX2EubGVuZ3RoOyBfaSsrKSB7DQogICAgZm9vKCkueCA9IF9hW19pXTsNCiAgICB2YXIgcCA9IGZvbygpLng7DQp9DQovLyMgc291cmNlTWFwcGluZ1VSTD1FUzVGb3Itb2Y4LmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mOC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIkVTNUZvci1vZjgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFNBQVMsR0FBRztJQUNSLE9BQU8sRUFBRSxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUM7QUFDcEIsQ0FBQztBQUNELEtBQWdCLFVBQWUsRUFBZixNQUFDLEdBQUcsRUFBRSxHQUFHLEVBQUUsR0FBRyxDQUFDLEVBQWYsY0FBZSxFQUFmLElBQWUsRUFBRSxDQUFDO0lBQTdCLEdBQUcsRUFBRSxDQUFDLENBQUMsU0FBQTtJQUNSLElBQUksQ0FBQyxHQUFHLEdBQUcsRUFBRSxDQUFDLENBQUMsQ0FBQztBQUNwQixDQUFDIn0=,ZnVuY3Rpb24gZm9vKCkgewogICAgcmV0dXJuIHsgeDogMCB9Owp9CmZvciAoZm9vKCkueCBvZiBbJ2EnLCAnYicsICdjJ10pIHsKICAgIHZhciBwID0gZm9vKCkueDsKfQ== diff --git a/tests/baselines/reference/ES5For-of8(target=es5).sourcemap.txt b/tests/baselines/reference/ES5For-of8(target=es5).sourcemap.txt index 498313f9828b4..049e2ecef9fd5 100644 --- a/tests/baselines/reference/ES5For-of8(target=es5).sourcemap.txt +++ b/tests/baselines/reference/ES5For-of8(target=es5).sourcemap.txt @@ -8,6 +8,7 @@ sources: ES5For-of8.ts emittedFile:ES5For-of8.js sourceFile:ES5For-of8.ts ------------------------------------------------------------------- +>>>"use strict"; >>>function foo() { 1 > 2 >^^^^^^^^^ @@ -16,9 +17,9 @@ sourceFile:ES5For-of8.ts 1 > 2 >function 3 > foo -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -3 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 10) Source(1, 10) + SourceIndex(0) +3 >Emitted(2, 13) Source(1, 13) + SourceIndex(0) --- >>> return { x: 0 }; 1->^^^^ @@ -38,14 +39,14 @@ sourceFile:ES5For-of8.ts 6 > 0 7 > } 8 > ; -1->Emitted(2, 5) Source(2, 5) + SourceIndex(0) -2 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -3 >Emitted(2, 14) Source(2, 14) + SourceIndex(0) -4 >Emitted(2, 15) Source(2, 15) + SourceIndex(0) -5 >Emitted(2, 17) Source(2, 17) + SourceIndex(0) -6 >Emitted(2, 18) Source(2, 18) + SourceIndex(0) -7 >Emitted(2, 20) Source(2, 20) + SourceIndex(0) -8 >Emitted(2, 21) Source(2, 21) + SourceIndex(0) +1->Emitted(3, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(3, 12) Source(2, 12) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) +4 >Emitted(3, 15) Source(2, 15) + SourceIndex(0) +5 >Emitted(3, 17) Source(2, 17) + SourceIndex(0) +6 >Emitted(3, 18) Source(2, 18) + SourceIndex(0) +7 >Emitted(3, 20) Source(2, 20) + SourceIndex(0) +8 >Emitted(3, 21) Source(2, 21) + SourceIndex(0) --- >>>} 1 > @@ -54,8 +55,8 @@ sourceFile:ES5For-of8.ts 1 > > 2 >} -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 2) Source(3, 2) + SourceIndex(0) +1 >Emitted(4, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(4, 2) Source(3, 2) + SourceIndex(0) --- >>>for (var _i = 0, _a = ['a', 'b', 'c']; _i < _a.length; _i++) { 1-> @@ -93,23 +94,23 @@ sourceFile:ES5For-of8.ts 15> ['a', 'b', 'c'] 16> ) 17> { -1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 17) + SourceIndex(0) -3 >Emitted(4, 16) Source(4, 32) + SourceIndex(0) -4 >Emitted(4, 18) Source(4, 17) + SourceIndex(0) -5 >Emitted(4, 24) Source(4, 18) + SourceIndex(0) -6 >Emitted(4, 27) Source(4, 21) + SourceIndex(0) -7 >Emitted(4, 29) Source(4, 23) + SourceIndex(0) -8 >Emitted(4, 32) Source(4, 26) + SourceIndex(0) -9 >Emitted(4, 34) Source(4, 28) + SourceIndex(0) -10>Emitted(4, 37) Source(4, 31) + SourceIndex(0) -11>Emitted(4, 38) Source(4, 32) + SourceIndex(0) -12>Emitted(4, 40) Source(4, 17) + SourceIndex(0) -13>Emitted(4, 54) Source(4, 32) + SourceIndex(0) -14>Emitted(4, 56) Source(4, 17) + SourceIndex(0) -15>Emitted(4, 60) Source(4, 32) + SourceIndex(0) -16>Emitted(4, 62) Source(4, 34) + SourceIndex(0) -17>Emitted(4, 63) Source(4, 35) + SourceIndex(0) +1->Emitted(5, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(5, 6) Source(4, 17) + SourceIndex(0) +3 >Emitted(5, 16) Source(4, 32) + SourceIndex(0) +4 >Emitted(5, 18) Source(4, 17) + SourceIndex(0) +5 >Emitted(5, 24) Source(4, 18) + SourceIndex(0) +6 >Emitted(5, 27) Source(4, 21) + SourceIndex(0) +7 >Emitted(5, 29) Source(4, 23) + SourceIndex(0) +8 >Emitted(5, 32) Source(4, 26) + SourceIndex(0) +9 >Emitted(5, 34) Source(4, 28) + SourceIndex(0) +10>Emitted(5, 37) Source(4, 31) + SourceIndex(0) +11>Emitted(5, 38) Source(4, 32) + SourceIndex(0) +12>Emitted(5, 40) Source(4, 17) + SourceIndex(0) +13>Emitted(5, 54) Source(4, 32) + SourceIndex(0) +14>Emitted(5, 56) Source(4, 17) + SourceIndex(0) +15>Emitted(5, 60) Source(4, 32) + SourceIndex(0) +16>Emitted(5, 62) Source(4, 34) + SourceIndex(0) +17>Emitted(5, 63) Source(4, 35) + SourceIndex(0) --- >>> foo().x = _a[_i]; 1 >^^^^ @@ -125,12 +126,12 @@ sourceFile:ES5For-of8.ts 4 > . 5 > x 6 > -1 >Emitted(5, 5) Source(4, 6) + SourceIndex(0) -2 >Emitted(5, 8) Source(4, 9) + SourceIndex(0) -3 >Emitted(5, 10) Source(4, 11) + SourceIndex(0) -4 >Emitted(5, 11) Source(4, 12) + SourceIndex(0) -5 >Emitted(5, 12) Source(4, 13) + SourceIndex(0) -6 >Emitted(5, 21) Source(4, 13) + SourceIndex(0) +1 >Emitted(6, 5) Source(4, 6) + SourceIndex(0) +2 >Emitted(6, 8) Source(4, 9) + SourceIndex(0) +3 >Emitted(6, 10) Source(4, 11) + SourceIndex(0) +4 >Emitted(6, 11) Source(4, 12) + SourceIndex(0) +5 >Emitted(6, 12) Source(4, 13) + SourceIndex(0) +6 >Emitted(6, 21) Source(4, 13) + SourceIndex(0) --- >>> var p = foo().x; 1->^^^^ @@ -152,15 +153,15 @@ sourceFile:ES5For-of8.ts 7 > . 8 > x 9 > ; -1->Emitted(6, 5) Source(5, 5) + SourceIndex(0) -2 >Emitted(6, 9) Source(5, 9) + SourceIndex(0) -3 >Emitted(6, 10) Source(5, 10) + SourceIndex(0) -4 >Emitted(6, 13) Source(5, 13) + SourceIndex(0) -5 >Emitted(6, 16) Source(5, 16) + SourceIndex(0) -6 >Emitted(6, 18) Source(5, 18) + SourceIndex(0) -7 >Emitted(6, 19) Source(5, 19) + SourceIndex(0) -8 >Emitted(6, 20) Source(5, 20) + SourceIndex(0) -9 >Emitted(6, 21) Source(5, 21) + SourceIndex(0) +1->Emitted(7, 5) Source(5, 5) + SourceIndex(0) +2 >Emitted(7, 9) Source(5, 9) + SourceIndex(0) +3 >Emitted(7, 10) Source(5, 10) + SourceIndex(0) +4 >Emitted(7, 13) Source(5, 13) + SourceIndex(0) +5 >Emitted(7, 16) Source(5, 16) + SourceIndex(0) +6 >Emitted(7, 18) Source(5, 18) + SourceIndex(0) +7 >Emitted(7, 19) Source(5, 19) + SourceIndex(0) +8 >Emitted(7, 20) Source(5, 20) + SourceIndex(0) +9 >Emitted(7, 21) Source(5, 21) + SourceIndex(0) --- >>>} 1 > @@ -169,7 +170,7 @@ sourceFile:ES5For-of8.ts 1 > > 2 >} -1 >Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(6, 2) + SourceIndex(0) +1 >Emitted(8, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(8, 2) Source(6, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=ES5For-of8.js.map \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of9(target=es2015).js b/tests/baselines/reference/ES5For-of9(target=es2015).js index d95adfed513e8..640cf241fefd5 100644 --- a/tests/baselines/reference/ES5For-of9(target=es2015).js +++ b/tests/baselines/reference/ES5For-of9(target=es2015).js @@ -11,6 +11,7 @@ for (foo().x of []) { } //// [ES5For-of9.js] +"use strict"; function foo() { return { x: 0 }; } diff --git a/tests/baselines/reference/ES5For-of9(target=es2015).types b/tests/baselines/reference/ES5For-of9(target=es2015).types index 699d2a7d41363..867706c051d52 100644 --- a/tests/baselines/reference/ES5For-of9(target=es2015).types +++ b/tests/baselines/reference/ES5For-of9(target=es2015).types @@ -22,8 +22,8 @@ for (foo().x of []) { > : ^^^^^^^^^^^^^^^^^^^^ >x : number > : ^^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ for (foo().x of []) { >foo().x : number @@ -34,8 +34,8 @@ for (foo().x of []) { > : ^^^^^^^^^^^^^^^^^^^^ >x : number > : ^^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ var p = foo().x; >p : number diff --git a/tests/baselines/reference/ES5For-of9(target=es5).js b/tests/baselines/reference/ES5For-of9(target=es5).js index 79c18f4c7421a..0e1d20a864552 100644 --- a/tests/baselines/reference/ES5For-of9(target=es5).js +++ b/tests/baselines/reference/ES5For-of9(target=es5).js @@ -11,6 +11,7 @@ for (foo().x of []) { } //// [ES5For-of9.js] +"use strict"; function foo() { return { x: 0 }; } diff --git a/tests/baselines/reference/ES5For-of9(target=es5).types b/tests/baselines/reference/ES5For-of9(target=es5).types index 699d2a7d41363..867706c051d52 100644 --- a/tests/baselines/reference/ES5For-of9(target=es5).types +++ b/tests/baselines/reference/ES5For-of9(target=es5).types @@ -22,8 +22,8 @@ for (foo().x of []) { > : ^^^^^^^^^^^^^^^^^^^^ >x : number > : ^^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ for (foo().x of []) { >foo().x : number @@ -34,8 +34,8 @@ for (foo().x of []) { > : ^^^^^^^^^^^^^^^^^^^^ >x : number > : ^^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ var p = foo().x; >p : number diff --git a/tests/baselines/reference/ES5For-ofTypeCheck1(target=es2015).js b/tests/baselines/reference/ES5For-ofTypeCheck1(target=es2015).js index f32d5caec8dee..46639a917f39a 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck1(target=es2015).js +++ b/tests/baselines/reference/ES5For-ofTypeCheck1(target=es2015).js @@ -4,4 +4,5 @@ for (var v of "") { } //// [ES5For-ofTypeCheck1.js] +"use strict"; for (var v of "") { } diff --git a/tests/baselines/reference/ES5For-ofTypeCheck1(target=es5).js b/tests/baselines/reference/ES5For-ofTypeCheck1(target=es5).js index 3c675ab41b9d7..2670b3c206d36 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck1(target=es5).js +++ b/tests/baselines/reference/ES5For-ofTypeCheck1(target=es5).js @@ -4,6 +4,7 @@ for (var v of "") { } //// [ES5For-ofTypeCheck1.js] +"use strict"; for (var _i = 0, _a = ""; _i < _a.length; _i++) { var v = _a[_i]; } diff --git a/tests/baselines/reference/ES5For-ofTypeCheck10(target=es2015).js b/tests/baselines/reference/ES5For-ofTypeCheck10(target=es2015).js index 97194c0d63a90..dd23bc7e093f5 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck10(target=es2015).js +++ b/tests/baselines/reference/ES5For-ofTypeCheck10(target=es2015).js @@ -17,6 +17,7 @@ class MyStringIterator { for (var v of new MyStringIterator) { } //// [ES5For-ofTypeCheck10.js] +"use strict"; // In ES3/5, you cannot for...of over an arbitrary iterable. class MyStringIterator { next() { diff --git a/tests/baselines/reference/ES5For-ofTypeCheck10(target=es5).js b/tests/baselines/reference/ES5For-ofTypeCheck10(target=es5).js index 2537d78d12f63..20a8150c3c4d4 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck10(target=es5).js +++ b/tests/baselines/reference/ES5For-ofTypeCheck10(target=es5).js @@ -17,6 +17,7 @@ class MyStringIterator { for (var v of new MyStringIterator) { } //// [ES5For-ofTypeCheck10.js] +"use strict"; // In ES3/5, you cannot for...of over an arbitrary iterable. var MyStringIterator = /** @class */ (function () { function MyStringIterator() { diff --git a/tests/baselines/reference/ES5For-ofTypeCheck11(target=es2015).js b/tests/baselines/reference/ES5For-ofTypeCheck11(target=es2015).js index f229a61c8f484..095384cbf43ca 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck11(target=es2015).js +++ b/tests/baselines/reference/ES5For-ofTypeCheck11(target=es2015).js @@ -6,5 +6,6 @@ var v: string; for (v of union) { } //// [ES5For-ofTypeCheck11.js] +"use strict"; var v; for (v of union) { } diff --git a/tests/baselines/reference/ES5For-ofTypeCheck11(target=es5).js b/tests/baselines/reference/ES5For-ofTypeCheck11(target=es5).js index 3f1e87cd7050b..c4e3d07efe099 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck11(target=es5).js +++ b/tests/baselines/reference/ES5For-ofTypeCheck11(target=es5).js @@ -6,6 +6,7 @@ var v: string; for (v of union) { } //// [ES5For-ofTypeCheck11.js] +"use strict"; var v; for (var _i = 0, union_1 = union; _i < union_1.length; _i++) { v = union_1[_i]; diff --git a/tests/baselines/reference/ES5For-ofTypeCheck12(target=es2015).js b/tests/baselines/reference/ES5For-ofTypeCheck12(target=es2015).js index 08ef9bfaddc82..820e176c78752 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck12(target=es2015).js +++ b/tests/baselines/reference/ES5For-ofTypeCheck12(target=es2015).js @@ -4,4 +4,5 @@ for (const v of 0) { } //// [ES5For-ofTypeCheck12.js] +"use strict"; for (const v of 0) { } diff --git a/tests/baselines/reference/ES5For-ofTypeCheck12(target=es5).js b/tests/baselines/reference/ES5For-ofTypeCheck12(target=es5).js index 6b3a16973f301..1078666a5d4ac 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck12(target=es5).js +++ b/tests/baselines/reference/ES5For-ofTypeCheck12(target=es5).js @@ -4,6 +4,7 @@ for (const v of 0) { } //// [ES5For-ofTypeCheck12.js] +"use strict"; for (var _i = 0, _a = 0; _i < _a.length; _i++) { var v = _a[_i]; } diff --git a/tests/baselines/reference/ES5For-ofTypeCheck13(target=es2015).js b/tests/baselines/reference/ES5For-ofTypeCheck13(target=es2015).js index a87f0b48390d4..be6bafcd3c8e2 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck13(target=es2015).js +++ b/tests/baselines/reference/ES5For-ofTypeCheck13(target=es2015).js @@ -7,6 +7,7 @@ strSet.add('World') for (const str of strSet) { } //// [ES5For-ofTypeCheck13.js] +"use strict"; const strSet = new Set(); strSet.add('Hello'); strSet.add('World'); diff --git a/tests/baselines/reference/ES5For-ofTypeCheck13(target=es5).js b/tests/baselines/reference/ES5For-ofTypeCheck13(target=es5).js index b2a0b7bfcfbf4..634c679e88f15 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck13(target=es5).js +++ b/tests/baselines/reference/ES5For-ofTypeCheck13(target=es5).js @@ -7,6 +7,7 @@ strSet.add('World') for (const str of strSet) { } //// [ES5For-ofTypeCheck13.js] +"use strict"; var strSet = new Set(); strSet.add('Hello'); strSet.add('World'); diff --git a/tests/baselines/reference/ES5For-ofTypeCheck14(target=es2015).js b/tests/baselines/reference/ES5For-ofTypeCheck14(target=es2015).js index 1bfb17228f4fe..b3fd2b036b2b1 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck14(target=es2015).js +++ b/tests/baselines/reference/ES5For-ofTypeCheck14(target=es2015).js @@ -5,4 +5,5 @@ declare var union: string | Set for (const e of union) { } //// [ES5For-ofTypeCheck14.js] +"use strict"; for (const e of union) { } diff --git a/tests/baselines/reference/ES5For-ofTypeCheck14(target=es5).js b/tests/baselines/reference/ES5For-ofTypeCheck14(target=es5).js index 3dd6049bc315d..0cb00b44fdcd3 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck14(target=es5).js +++ b/tests/baselines/reference/ES5For-ofTypeCheck14(target=es5).js @@ -5,6 +5,7 @@ declare var union: string | Set for (const e of union) { } //// [ES5For-ofTypeCheck14.js] +"use strict"; for (var _i = 0, union_1 = union; _i < union_1.length; _i++) { var e = union_1[_i]; } diff --git a/tests/baselines/reference/ES5For-ofTypeCheck2(target=es2015).js b/tests/baselines/reference/ES5For-ofTypeCheck2(target=es2015).js index 64e31173c7eb0..6d5c2a8b58de0 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck2(target=es2015).js +++ b/tests/baselines/reference/ES5For-ofTypeCheck2(target=es2015).js @@ -4,4 +4,5 @@ for (var v of [true]) { } //// [ES5For-ofTypeCheck2.js] +"use strict"; for (var v of [true]) { } diff --git a/tests/baselines/reference/ES5For-ofTypeCheck2(target=es5).js b/tests/baselines/reference/ES5For-ofTypeCheck2(target=es5).js index ba855f712c725..67dbc0d419d04 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck2(target=es5).js +++ b/tests/baselines/reference/ES5For-ofTypeCheck2(target=es5).js @@ -4,6 +4,7 @@ for (var v of [true]) { } //// [ES5For-ofTypeCheck2.js] +"use strict"; for (var _i = 0, _a = [true]; _i < _a.length; _i++) { var v = _a[_i]; } diff --git a/tests/baselines/reference/ES5For-ofTypeCheck3(target=es2015).js b/tests/baselines/reference/ES5For-ofTypeCheck3(target=es2015).js index 9d5ed68694b1a..b2bd2599d9a58 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck3(target=es2015).js +++ b/tests/baselines/reference/ES5For-ofTypeCheck3(target=es2015).js @@ -5,5 +5,6 @@ var tuple: [string, number] = ["", 0]; for (var v of tuple) { } //// [ES5For-ofTypeCheck3.js] +"use strict"; var tuple = ["", 0]; for (var v of tuple) { } diff --git a/tests/baselines/reference/ES5For-ofTypeCheck3(target=es5).js b/tests/baselines/reference/ES5For-ofTypeCheck3(target=es5).js index 91f78c704b6bb..b0354bb4b45ef 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck3(target=es5).js +++ b/tests/baselines/reference/ES5For-ofTypeCheck3(target=es5).js @@ -5,6 +5,7 @@ var tuple: [string, number] = ["", 0]; for (var v of tuple) { } //// [ES5For-ofTypeCheck3.js] +"use strict"; var tuple = ["", 0]; for (var _i = 0, tuple_1 = tuple; _i < tuple_1.length; _i++) { var v = tuple_1[_i]; diff --git a/tests/baselines/reference/ES5For-ofTypeCheck4(target=es2015).errors.txt b/tests/baselines/reference/ES5For-ofTypeCheck4(target=es2015).errors.txt new file mode 100644 index 0000000000000..42b5da4b2a90b --- /dev/null +++ b/tests/baselines/reference/ES5For-ofTypeCheck4(target=es2015).errors.txt @@ -0,0 +1,8 @@ +ES5For-ofTypeCheck4.ts(2,17): error TS2454: Variable 'union' is used before being assigned. + + +==== ES5For-ofTypeCheck4.ts (1 errors) ==== + var union: string | string[]; + for (const v of union) { } + ~~~~~ +!!! error TS2454: Variable 'union' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-ofTypeCheck4(target=es2015).js b/tests/baselines/reference/ES5For-ofTypeCheck4(target=es2015).js index 0551df0328a21..0a974dba763b0 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck4(target=es2015).js +++ b/tests/baselines/reference/ES5For-ofTypeCheck4(target=es2015).js @@ -5,5 +5,6 @@ var union: string | string[]; for (const v of union) { } //// [ES5For-ofTypeCheck4.js] +"use strict"; var union; for (const v of union) { } diff --git a/tests/baselines/reference/ES5For-ofTypeCheck4(target=es5).errors.txt b/tests/baselines/reference/ES5For-ofTypeCheck4(target=es5).errors.txt index 6193118ee4c0b..f64cb77ace3cc 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck4(target=es5).errors.txt +++ b/tests/baselines/reference/ES5For-ofTypeCheck4(target=es5).errors.txt @@ -1,7 +1,10 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +ES5For-ofTypeCheck4.ts(2,17): error TS2454: Variable 'union' is used before being assigned. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== ES5For-ofTypeCheck4.ts (0 errors) ==== +==== ES5For-ofTypeCheck4.ts (1 errors) ==== var union: string | string[]; - for (const v of union) { } \ No newline at end of file + for (const v of union) { } + ~~~~~ +!!! error TS2454: Variable 'union' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-ofTypeCheck4(target=es5).js b/tests/baselines/reference/ES5For-ofTypeCheck4(target=es5).js index 6ee223b523698..578ee570600c5 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck4(target=es5).js +++ b/tests/baselines/reference/ES5For-ofTypeCheck4(target=es5).js @@ -5,6 +5,7 @@ var union: string | string[]; for (const v of union) { } //// [ES5For-ofTypeCheck4.js] +"use strict"; var union; for (var _i = 0, union_1 = union; _i < union_1.length; _i++) { var v = union_1[_i]; diff --git a/tests/baselines/reference/ES5For-ofTypeCheck5(target=es2015).errors.txt b/tests/baselines/reference/ES5For-ofTypeCheck5(target=es2015).errors.txt new file mode 100644 index 0000000000000..a2c5fe2e045bb --- /dev/null +++ b/tests/baselines/reference/ES5For-ofTypeCheck5(target=es2015).errors.txt @@ -0,0 +1,8 @@ +ES5For-ofTypeCheck5.ts(2,15): error TS2454: Variable 'union' is used before being assigned. + + +==== ES5For-ofTypeCheck5.ts (1 errors) ==== + var union: string | number[]; + for (var v of union) { } + ~~~~~ +!!! error TS2454: Variable 'union' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-ofTypeCheck5(target=es2015).js b/tests/baselines/reference/ES5For-ofTypeCheck5(target=es2015).js index 8b99c7eaffef1..88637803bcf05 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck5(target=es2015).js +++ b/tests/baselines/reference/ES5For-ofTypeCheck5(target=es2015).js @@ -5,5 +5,6 @@ var union: string | number[]; for (var v of union) { } //// [ES5For-ofTypeCheck5.js] +"use strict"; var union; for (var v of union) { } diff --git a/tests/baselines/reference/ES5For-ofTypeCheck5(target=es5).errors.txt b/tests/baselines/reference/ES5For-ofTypeCheck5(target=es5).errors.txt index 5103a55a99ede..74b6b282e8047 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck5(target=es5).errors.txt +++ b/tests/baselines/reference/ES5For-ofTypeCheck5(target=es5).errors.txt @@ -1,7 +1,10 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +ES5For-ofTypeCheck5.ts(2,15): error TS2454: Variable 'union' is used before being assigned. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== ES5For-ofTypeCheck5.ts (0 errors) ==== +==== ES5For-ofTypeCheck5.ts (1 errors) ==== var union: string | number[]; - for (var v of union) { } \ No newline at end of file + for (var v of union) { } + ~~~~~ +!!! error TS2454: Variable 'union' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-ofTypeCheck5(target=es5).js b/tests/baselines/reference/ES5For-ofTypeCheck5(target=es5).js index 143f3508758aa..8fbea3f4dd0ef 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck5(target=es5).js +++ b/tests/baselines/reference/ES5For-ofTypeCheck5(target=es5).js @@ -5,6 +5,7 @@ var union: string | number[]; for (var v of union) { } //// [ES5For-ofTypeCheck5.js] +"use strict"; var union; for (var _i = 0, union_1 = union; _i < union_1.length; _i++) { var v = union_1[_i]; diff --git a/tests/baselines/reference/ES5For-ofTypeCheck6(target=es2015).errors.txt b/tests/baselines/reference/ES5For-ofTypeCheck6(target=es2015).errors.txt new file mode 100644 index 0000000000000..56c26bd7b019c --- /dev/null +++ b/tests/baselines/reference/ES5For-ofTypeCheck6(target=es2015).errors.txt @@ -0,0 +1,8 @@ +ES5For-ofTypeCheck6.ts(2,15): error TS2454: Variable 'union' is used before being assigned. + + +==== ES5For-ofTypeCheck6.ts (1 errors) ==== + var union: string[] | number[]; + for (var v of union) { } + ~~~~~ +!!! error TS2454: Variable 'union' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-ofTypeCheck6(target=es2015).js b/tests/baselines/reference/ES5For-ofTypeCheck6(target=es2015).js index 508f9d7e1c5b4..b6a0edcb6c2bc 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck6(target=es2015).js +++ b/tests/baselines/reference/ES5For-ofTypeCheck6(target=es2015).js @@ -5,5 +5,6 @@ var union: string[] | number[]; for (var v of union) { } //// [ES5For-ofTypeCheck6.js] +"use strict"; var union; for (var v of union) { } diff --git a/tests/baselines/reference/ES5For-ofTypeCheck6(target=es5).errors.txt b/tests/baselines/reference/ES5For-ofTypeCheck6(target=es5).errors.txt index a052beb63f032..3154d92946d17 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck6(target=es5).errors.txt +++ b/tests/baselines/reference/ES5For-ofTypeCheck6(target=es5).errors.txt @@ -1,7 +1,10 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +ES5For-ofTypeCheck6.ts(2,15): error TS2454: Variable 'union' is used before being assigned. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== ES5For-ofTypeCheck6.ts (0 errors) ==== +==== ES5For-ofTypeCheck6.ts (1 errors) ==== var union: string[] | number[]; - for (var v of union) { } \ No newline at end of file + for (var v of union) { } + ~~~~~ +!!! error TS2454: Variable 'union' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-ofTypeCheck6(target=es5).js b/tests/baselines/reference/ES5For-ofTypeCheck6(target=es5).js index 0a7fbd19a15c5..2d5c3545e031e 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck6(target=es5).js +++ b/tests/baselines/reference/ES5For-ofTypeCheck6(target=es5).js @@ -5,6 +5,7 @@ var union: string[] | number[]; for (var v of union) { } //// [ES5For-ofTypeCheck6.js] +"use strict"; var union; for (var _i = 0, union_1 = union; _i < union_1.length; _i++) { var v = union_1[_i]; diff --git a/tests/baselines/reference/ES5For-ofTypeCheck7(target=es2015).js b/tests/baselines/reference/ES5For-ofTypeCheck7(target=es2015).js index 61ba335fa56d1..a316402f74889 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck7(target=es2015).js +++ b/tests/baselines/reference/ES5For-ofTypeCheck7(target=es2015).js @@ -5,4 +5,5 @@ declare var union: string | number; for (var v of union) { } //// [ES5For-ofTypeCheck7.js] +"use strict"; for (var v of union) { } diff --git a/tests/baselines/reference/ES5For-ofTypeCheck7(target=es5).js b/tests/baselines/reference/ES5For-ofTypeCheck7(target=es5).js index 517422a33ab57..3cb3ec98d4b96 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck7(target=es5).js +++ b/tests/baselines/reference/ES5For-ofTypeCheck7(target=es5).js @@ -5,6 +5,7 @@ declare var union: string | number; for (var v of union) { } //// [ES5For-ofTypeCheck7.js] +"use strict"; for (var _i = 0, union_1 = union; _i < union_1.length; _i++) { var v = union_1[_i]; } diff --git a/tests/baselines/reference/ES5For-ofTypeCheck8(target=es2015).js b/tests/baselines/reference/ES5For-ofTypeCheck8(target=es2015).js index 9650d247a14e4..caad62af92e64 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck8(target=es2015).js +++ b/tests/baselines/reference/ES5For-ofTypeCheck8(target=es2015).js @@ -6,5 +6,6 @@ var v: symbol; for (v of union) { } //// [ES5For-ofTypeCheck8.js] +"use strict"; var v; for (v of union) { } diff --git a/tests/baselines/reference/ES5For-ofTypeCheck8(target=es5).js b/tests/baselines/reference/ES5For-ofTypeCheck8(target=es5).js index 04d929fbcb014..4347c8a710b4f 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck8(target=es5).js +++ b/tests/baselines/reference/ES5For-ofTypeCheck8(target=es5).js @@ -6,6 +6,7 @@ var v: symbol; for (v of union) { } //// [ES5For-ofTypeCheck8.js] +"use strict"; var v; for (var _i = 0, union_1 = union; _i < union_1.length; _i++) { v = union_1[_i]; diff --git a/tests/baselines/reference/ES5For-ofTypeCheck9(target=es2015).js b/tests/baselines/reference/ES5For-ofTypeCheck9(target=es2015).js index 2b614ef7a75be..c4eb82a9e0c42 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck9(target=es2015).js +++ b/tests/baselines/reference/ES5For-ofTypeCheck9(target=es2015).js @@ -5,4 +5,5 @@ declare var union: string | string[] | number | symbol; for (let v of union) { } //// [ES5For-ofTypeCheck9.js] +"use strict"; for (let v of union) { } diff --git a/tests/baselines/reference/ES5For-ofTypeCheck9(target=es5).js b/tests/baselines/reference/ES5For-ofTypeCheck9(target=es5).js index fc66bb2967db7..815ee3645bf1a 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck9(target=es5).js +++ b/tests/baselines/reference/ES5For-ofTypeCheck9(target=es5).js @@ -5,6 +5,7 @@ declare var union: string | string[] | number | symbol; for (let v of union) { } //// [ES5For-ofTypeCheck9.js] +"use strict"; for (var _i = 0, union_1 = union; _i < union_1.length; _i++) { var v = union_1[_i]; } diff --git a/tests/baselines/reference/ES5SymbolProperty1(target=es2015).js b/tests/baselines/reference/ES5SymbolProperty1(target=es2015).js index ea2f9fc33d176..af15084702df9 100644 --- a/tests/baselines/reference/ES5SymbolProperty1(target=es2015).js +++ b/tests/baselines/reference/ES5SymbolProperty1(target=es2015).js @@ -13,6 +13,7 @@ var obj = { obj[Symbol.foo]; //// [ES5SymbolProperty1.js] +"use strict"; var Symbol; var obj = { [Symbol.foo]: 0 diff --git a/tests/baselines/reference/ES5SymbolProperty1(target=es5).js b/tests/baselines/reference/ES5SymbolProperty1(target=es5).js index 6e0979c35a64d..591288ab68f48 100644 --- a/tests/baselines/reference/ES5SymbolProperty1(target=es5).js +++ b/tests/baselines/reference/ES5SymbolProperty1(target=es5).js @@ -13,6 +13,7 @@ var obj = { obj[Symbol.foo]; //// [ES5SymbolProperty1.js] +"use strict"; var _a; var Symbol; var obj = (_a = {}, diff --git a/tests/baselines/reference/ES5SymbolProperty2(target=es2015).js b/tests/baselines/reference/ES5SymbolProperty2(target=es2015).js index 97b6ce5bdbe62..9a8f82d1632c2 100644 --- a/tests/baselines/reference/ES5SymbolProperty2(target=es2015).js +++ b/tests/baselines/reference/ES5SymbolProperty2(target=es2015).js @@ -13,6 +13,7 @@ namespace M { (new M.C)[Symbol.iterator]; //// [ES5SymbolProperty2.js] +"use strict"; var M; (function (M) { var Symbol; diff --git a/tests/baselines/reference/ES5SymbolProperty2(target=es5).js b/tests/baselines/reference/ES5SymbolProperty2(target=es5).js index 2bb2480bd32ef..6cf2d9889afd4 100644 --- a/tests/baselines/reference/ES5SymbolProperty2(target=es5).js +++ b/tests/baselines/reference/ES5SymbolProperty2(target=es5).js @@ -13,6 +13,7 @@ namespace M { (new M.C)[Symbol.iterator]; //// [ES5SymbolProperty2.js] +"use strict"; var M; (function (M) { var Symbol; diff --git a/tests/baselines/reference/ES5SymbolProperty3(target=es2015).js b/tests/baselines/reference/ES5SymbolProperty3(target=es2015).js index f30919700ea48..8786fb387c409 100644 --- a/tests/baselines/reference/ES5SymbolProperty3(target=es2015).js +++ b/tests/baselines/reference/ES5SymbolProperty3(target=es2015).js @@ -10,6 +10,7 @@ class C { (new C)[Symbol.iterator] //// [ES5SymbolProperty3.js] +"use strict"; var Symbol; class C { [Symbol.iterator]() { } diff --git a/tests/baselines/reference/ES5SymbolProperty3(target=es5).js b/tests/baselines/reference/ES5SymbolProperty3(target=es5).js index 1f8e9732f5ac4..22a188366d832 100644 --- a/tests/baselines/reference/ES5SymbolProperty3(target=es5).js +++ b/tests/baselines/reference/ES5SymbolProperty3(target=es5).js @@ -10,6 +10,7 @@ class C { (new C)[Symbol.iterator] //// [ES5SymbolProperty3.js] +"use strict"; var Symbol; var C = /** @class */ (function () { function C() { diff --git a/tests/baselines/reference/ES5SymbolProperty4(target=es2015).js b/tests/baselines/reference/ES5SymbolProperty4(target=es2015).js index 942255c915d4e..c5953c1db7ab7 100644 --- a/tests/baselines/reference/ES5SymbolProperty4(target=es2015).js +++ b/tests/baselines/reference/ES5SymbolProperty4(target=es2015).js @@ -10,6 +10,7 @@ class C { (new C)[Symbol.iterator] //// [ES5SymbolProperty4.js] +"use strict"; var Symbol; class C { [Symbol.iterator]() { } diff --git a/tests/baselines/reference/ES5SymbolProperty4(target=es5).js b/tests/baselines/reference/ES5SymbolProperty4(target=es5).js index d772f7c2364cb..c786996c2b019 100644 --- a/tests/baselines/reference/ES5SymbolProperty4(target=es5).js +++ b/tests/baselines/reference/ES5SymbolProperty4(target=es5).js @@ -10,6 +10,7 @@ class C { (new C)[Symbol.iterator] //// [ES5SymbolProperty4.js] +"use strict"; var Symbol; var C = /** @class */ (function () { function C() { diff --git a/tests/baselines/reference/ES5SymbolProperty5(target=es2015).js b/tests/baselines/reference/ES5SymbolProperty5(target=es2015).js index 17445f237dc9c..ab212ee768712 100644 --- a/tests/baselines/reference/ES5SymbolProperty5(target=es2015).js +++ b/tests/baselines/reference/ES5SymbolProperty5(target=es2015).js @@ -10,6 +10,7 @@ class C { (new C)[Symbol.iterator](0) // Should error //// [ES5SymbolProperty5.js] +"use strict"; class C { [Symbol.iterator]() { } } diff --git a/tests/baselines/reference/ES5SymbolProperty5(target=es5).js b/tests/baselines/reference/ES5SymbolProperty5(target=es5).js index 45ff6b9e56199..41f98c9619e45 100644 --- a/tests/baselines/reference/ES5SymbolProperty5(target=es5).js +++ b/tests/baselines/reference/ES5SymbolProperty5(target=es5).js @@ -10,6 +10,7 @@ class C { (new C)[Symbol.iterator](0) // Should error //// [ES5SymbolProperty5.js] +"use strict"; var C = /** @class */ (function () { function C() { } diff --git a/tests/baselines/reference/ES5SymbolProperty6(target=es2015).js b/tests/baselines/reference/ES5SymbolProperty6(target=es2015).js index ddc5d58ccb2f7..1b4402c650e3b 100644 --- a/tests/baselines/reference/ES5SymbolProperty6(target=es2015).js +++ b/tests/baselines/reference/ES5SymbolProperty6(target=es2015).js @@ -8,6 +8,7 @@ class C { (new C)[Symbol.iterator] //// [ES5SymbolProperty6.js] +"use strict"; class C { [Symbol.iterator]() { } } diff --git a/tests/baselines/reference/ES5SymbolProperty6(target=es5).js b/tests/baselines/reference/ES5SymbolProperty6(target=es5).js index d167efaa059f2..a1a4e3103cb63 100644 --- a/tests/baselines/reference/ES5SymbolProperty6(target=es5).js +++ b/tests/baselines/reference/ES5SymbolProperty6(target=es5).js @@ -8,6 +8,7 @@ class C { (new C)[Symbol.iterator] //// [ES5SymbolProperty6.js] +"use strict"; var C = /** @class */ (function () { function C() { } diff --git a/tests/baselines/reference/ES5SymbolProperty7(target=es2015).js b/tests/baselines/reference/ES5SymbolProperty7(target=es2015).js index abf0d00799513..a7242de0ceac1 100644 --- a/tests/baselines/reference/ES5SymbolProperty7(target=es2015).js +++ b/tests/baselines/reference/ES5SymbolProperty7(target=es2015).js @@ -10,6 +10,7 @@ class C { (new C)[Symbol.iterator] //// [ES5SymbolProperty7.js] +"use strict"; var Symbol; class C { [Symbol.iterator]() { } diff --git a/tests/baselines/reference/ES5SymbolProperty7(target=es5).js b/tests/baselines/reference/ES5SymbolProperty7(target=es5).js index 4921c9eeb1af6..27759951b27df 100644 --- a/tests/baselines/reference/ES5SymbolProperty7(target=es5).js +++ b/tests/baselines/reference/ES5SymbolProperty7(target=es5).js @@ -10,6 +10,7 @@ class C { (new C)[Symbol.iterator] //// [ES5SymbolProperty7.js] +"use strict"; var Symbol; var C = /** @class */ (function () { function C() { diff --git a/tests/baselines/reference/ES5SymbolType1(target=es2015).errors.txt b/tests/baselines/reference/ES5SymbolType1(target=es2015).errors.txt new file mode 100644 index 0000000000000..c0f9f60fb58e9 --- /dev/null +++ b/tests/baselines/reference/ES5SymbolType1(target=es2015).errors.txt @@ -0,0 +1,8 @@ +ES5SymbolType1.ts(2,1): error TS2454: Variable 's' is used before being assigned. + + +==== ES5SymbolType1.ts (1 errors) ==== + var s: symbol; + s.toString(); + ~ +!!! error TS2454: Variable 's' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/ES5SymbolType1(target=es2015).js b/tests/baselines/reference/ES5SymbolType1(target=es2015).js index 0709bb89a8d27..b711bee62aea3 100644 --- a/tests/baselines/reference/ES5SymbolType1(target=es2015).js +++ b/tests/baselines/reference/ES5SymbolType1(target=es2015).js @@ -5,5 +5,6 @@ var s: symbol; s.toString(); //// [ES5SymbolType1.js] +"use strict"; var s; s.toString(); diff --git a/tests/baselines/reference/ES5SymbolType1(target=es5).errors.txt b/tests/baselines/reference/ES5SymbolType1(target=es5).errors.txt index 50844097eeca0..13efcd5ed43b7 100644 --- a/tests/baselines/reference/ES5SymbolType1(target=es5).errors.txt +++ b/tests/baselines/reference/ES5SymbolType1(target=es5).errors.txt @@ -1,7 +1,10 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +ES5SymbolType1.ts(2,1): error TS2454: Variable 's' is used before being assigned. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== ES5SymbolType1.ts (0 errors) ==== +==== ES5SymbolType1.ts (1 errors) ==== var s: symbol; - s.toString(); \ No newline at end of file + s.toString(); + ~ +!!! error TS2454: Variable 's' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/ES5SymbolType1(target=es5).js b/tests/baselines/reference/ES5SymbolType1(target=es5).js index 0709bb89a8d27..b711bee62aea3 100644 --- a/tests/baselines/reference/ES5SymbolType1(target=es5).js +++ b/tests/baselines/reference/ES5SymbolType1(target=es5).js @@ -5,5 +5,6 @@ var s: symbol; s.toString(); //// [ES5SymbolType1.js] +"use strict"; var s; s.toString(); diff --git a/tests/baselines/reference/ES5for-of32(target=es2015).js b/tests/baselines/reference/ES5for-of32(target=es2015).js index 052ffa24567c1..4515d8ba90b93 100644 --- a/tests/baselines/reference/ES5for-of32(target=es2015).js +++ b/tests/baselines/reference/ES5for-of32(target=es2015).js @@ -13,6 +13,7 @@ for (let num of array) { } //// [ES5for-of32.js] +"use strict"; var array = [1, 2, 3]; var sum = 0; for (let num of array) { diff --git a/tests/baselines/reference/ES5for-of32(target=es5).js b/tests/baselines/reference/ES5for-of32(target=es5).js index 044002ebe8ccd..05abaa16aa56c 100644 --- a/tests/baselines/reference/ES5for-of32(target=es5).js +++ b/tests/baselines/reference/ES5for-of32(target=es5).js @@ -13,6 +13,7 @@ for (let num of array) { } //// [ES5for-of32.js] +"use strict"; var array = [1, 2, 3]; var sum = 0; for (var _i = 0, array_1 = array; _i < array_1.length; _i++) { diff --git a/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.js b/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.js index b40350403e36a..4170205e0703d 100644 --- a/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.js +++ b/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.js @@ -19,6 +19,7 @@ var y: { x: number; y: number }; var y = new enumdule.Point(0, 0); //// [EnumAndModuleWithSameNameAndCommonRoot.js] +"use strict"; var enumdule; (function (enumdule) { enumdule[enumdule["Red"] = 0] = "Red"; diff --git a/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.js b/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.js index cfb8f415a6125..c828eea3a2263 100644 --- a/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.js +++ b/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.js @@ -22,6 +22,7 @@ namespace A { //// [ExportClassWhichExtendsInterfaceWithInaccessibleType.js] +"use strict"; var A; (function (A) { class Point2d { diff --git a/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.errors.txt b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.errors.txt new file mode 100644 index 0000000000000..bcc3427607bf3 --- /dev/null +++ b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.errors.txt @@ -0,0 +1,32 @@ +ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts(4,9): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. +ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts(5,9): error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. +ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts(11,9): error TS2564: Property 'z' has no initializer and is not definitely assigned in the constructor. + + +==== ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts (3 errors) ==== + namespace A { + + export class Point { + x: number; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. + y: number; + ~ +!!! error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. + } + + export var Origin: Point = { x: 0, y: 0 }; + + export class Point3d extends Point { + z: number; + ~ +!!! error TS2564: Property 'z' has no initializer and is not definitely assigned in the constructor. + } + + export var Origin3d: Point3d = { x: 0, y: 0, z: 0 }; + + export class Line{ + constructor(public start: TPoint, public end: TPoint) { } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js index 5bc5f88617903..f57cb6d8aacfa 100644 --- a/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js +++ b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js @@ -23,6 +23,7 @@ namespace A { //// [ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js] +"use strict"; var A; (function (A) { class Point { diff --git a/tests/baselines/reference/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.errors.txt b/tests/baselines/reference/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.errors.txt new file mode 100644 index 0000000000000..69bfc1833b38d --- /dev/null +++ b/tests/baselines/reference/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.errors.txt @@ -0,0 +1,24 @@ +ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts(4,9): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. +ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts(5,9): error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. + + +==== ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts (2 errors) ==== + namespace A { + + class Point { + x: number; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. + y: number; + ~ +!!! error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. + } + + export class points { + + [idx: number]: Point; + [idx: string]: Point; + } + } + + \ No newline at end of file diff --git a/tests/baselines/reference/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.js b/tests/baselines/reference/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.js index b8dde61f184f7..62675138f81d3 100644 --- a/tests/baselines/reference/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.js +++ b/tests/baselines/reference/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.js @@ -18,6 +18,7 @@ namespace A { //// [ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.js] +"use strict"; var A; (function (A) { class Point { diff --git a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.errors.txt b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.errors.txt new file mode 100644 index 0000000000000..e56ce977c3a86 --- /dev/null +++ b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.errors.txt @@ -0,0 +1,39 @@ +ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts(4,9): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. +ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts(5,9): error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. +ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts(11,9): error TS2564: Property 'z' has no initializer and is not definitely assigned in the constructor. +ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts(20,13): error TS2322: Type 'null' is not assignable to type 'Line'. + + +==== ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts (4 errors) ==== + namespace A { + + class Point { + x: number; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. + y: number; + ~ +!!! error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. + } + + export var Origin: Point = { x: 0, y: 0 }; + + export class Point3d extends Point { + z: number; + ~ +!!! error TS2564: Property 'z' has no initializer and is not definitely assigned in the constructor. + } + + export var Origin3d: Point3d = { x: 0, y: 0, z: 0 }; + + export class Line{ + constructor(public start: TPoint, public end: TPoint) { } + + static fromorigin2d(p: Point): Line{ + return null; + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'Line'. + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js index ed4d8fcd03c5a..446100cc01a17 100644 --- a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js +++ b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js @@ -27,6 +27,7 @@ namespace A { //// [ExportClassWithInaccessibleTypeInTypeParameterConstraint.js] +"use strict"; var A; (function (A) { class Point { diff --git a/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.errors.txt b/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.errors.txt new file mode 100644 index 0000000000000..471172f82810e --- /dev/null +++ b/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.errors.txt @@ -0,0 +1,24 @@ +ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts(4,9): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. +ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts(5,9): error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. + + +==== ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts (2 errors) ==== + namespace A { + + export class Point { + x: number; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. + y: number; + ~ +!!! error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. + } + + export class Line { + constructor(public start: Point, public end: Point) { } + } + + export function fromOrigin(p: Point): Line { + return new Line({ x: 0, y: 0 }, p); + } + } \ No newline at end of file diff --git a/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.js b/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.js index 4593cc08e5e2c..99d5456aa5701 100644 --- a/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.js +++ b/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.js @@ -18,6 +18,7 @@ namespace A { } //// [ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.js] +"use strict"; var A; (function (A) { class Point { diff --git a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.errors.txt b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.errors.txt new file mode 100644 index 0000000000000..c5cec6df2d97f --- /dev/null +++ b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.errors.txt @@ -0,0 +1,24 @@ +ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts(4,9): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. +ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts(5,9): error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. + + +==== ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts (2 errors) ==== + namespace A { + + class Point { + x: number; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. + y: number; + ~ +!!! error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. + } + + export class Line { + constructor(public start: Point, public end: Point) { } + } + + export function fromOrigin(p: Point): Line { + return new Line({ x: 0, y: 0 }, p); + } + } \ No newline at end of file diff --git a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.js b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.js index 0ed1326e526b2..cd7e7b40cb046 100644 --- a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.js +++ b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.js @@ -18,6 +18,7 @@ namespace A { } //// [ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.js] +"use strict"; var A; (function (A) { class Point { diff --git a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.errors.txt b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.errors.txt new file mode 100644 index 0000000000000..ec3ab860378d5 --- /dev/null +++ b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.errors.txt @@ -0,0 +1,24 @@ +ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts(4,9): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. +ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts(5,9): error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. + + +==== ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts (2 errors) ==== + namespace A { + + export class Point { + x: number; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. + y: number; + ~ +!!! error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. + } + + class Line { + constructor(public start: Point, public end: Point) { } + } + + export function fromOrigin(p: Point): Line { + return new Line({ x: 0, y: 0 }, p); + } + } \ No newline at end of file diff --git a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.js b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.js index 2971123fa6da6..8d04b17f18b22 100644 --- a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.js +++ b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.js @@ -18,6 +18,7 @@ namespace A { } //// [ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.js] +"use strict"; var A; (function (A) { class Point { diff --git a/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js b/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js index 10b640014b997..183a15cde2640 100644 --- a/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js +++ b/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js @@ -25,6 +25,7 @@ namespace A { //// [ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js] +"use strict"; var A; (function (A) { A.Origin = { x: 0, y: 0 }; diff --git a/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.js b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.js index 28905bae6926b..806a419d90ee6 100644 --- a/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.js +++ b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.js @@ -18,3 +18,4 @@ namespace A { //// [ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.js] +"use strict"; diff --git a/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.js b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.js index c2a40862fc35f..36c4e2f891502 100644 --- a/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.js +++ b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.js @@ -26,6 +26,7 @@ namespace A { //// [ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.js] +"use strict"; var A; (function (A) { A.Origin = { x: 0, y: 0 }; diff --git a/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.js b/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.js index 7b5e31c8d3353..107fd2c646869 100644 --- a/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.js +++ b/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.js @@ -23,6 +23,7 @@ namespace A { } //// [ExportModuleWithAccessibleTypesOnItsExportedMembers.js] +"use strict"; var A; (function (A) { class Point { diff --git a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.js b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.js index 2f3630539aaa0..052393e1a8871 100644 --- a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.js +++ b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.js @@ -14,6 +14,7 @@ namespace A { //// [ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.js] +"use strict"; var A; (function (A) { class Point { diff --git a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.errors.txt b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.errors.txt new file mode 100644 index 0000000000000..4c6138d25a9ed --- /dev/null +++ b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.errors.txt @@ -0,0 +1,17 @@ +ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts(7,16): error TS2322: Type 'null' is not assignable to type '{ top: { left: Point; right: Point; }; bottom: { left: Point; right: Point; }; }'. + + +==== ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts (1 errors) ==== + namespace A { + + class Point { + constructor(public x: number, public y: number) { } + } + + export var UnitSquare : { + ~~~~~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type '{ top: { left: Point; right: Point; }; bottom: { left: Point; right: Point; }; }'. + top: { left: Point, right: Point }, + bottom: { left: Point, right: Point } + } = null; + } \ No newline at end of file diff --git a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.js b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.js index e89b61ccb7e12..37db389152c2e 100644 --- a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.js +++ b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.js @@ -14,6 +14,7 @@ namespace A { } //// [ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.js] +"use strict"; var A; (function (A) { class Point { diff --git a/tests/baselines/reference/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.errors.txt b/tests/baselines/reference/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.errors.txt new file mode 100644 index 0000000000000..ed5e918ee26be --- /dev/null +++ b/tests/baselines/reference/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.errors.txt @@ -0,0 +1,14 @@ +ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts(3,9): error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. + + +==== ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts (1 errors) ==== + namespace A { + class B { + id: number; + ~~ +!!! error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. + } + + export var beez: Array; + export var beez2 = new Array(); + } \ No newline at end of file diff --git a/tests/baselines/reference/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.js b/tests/baselines/reference/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.js index c7fdf2060f47e..3b5268e5c16f0 100644 --- a/tests/baselines/reference/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.js +++ b/tests/baselines/reference/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.js @@ -11,6 +11,7 @@ namespace A { } //// [ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.js] +"use strict"; var A; (function (A) { class B { diff --git a/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.js b/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.js index d9d0454085ee7..fc25237f58c55 100644 --- a/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.js +++ b/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.js @@ -14,6 +14,7 @@ namespace A { //// [ExportVariableWithAccessibleTypeInTypeAnnotation.js] +"use strict"; var A; (function (A) { // valid since Point is exported diff --git a/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.js b/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.js index a7915c1caee7c..bae1576a1c4b2 100644 --- a/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.js +++ b/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.js @@ -21,6 +21,7 @@ namespace A { //// [ExportVariableWithInaccessibleTypeInTypeAnnotation.js] +"use strict"; var A; (function (A) { // valid since Point is exported diff --git a/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.js b/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.js index b41f9abb29659..125eec06c9586 100644 --- a/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.js +++ b/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.js @@ -44,6 +44,7 @@ var cl = B.Point.Origin; //// [function.js] +"use strict"; var A; (function (A) { function Point() { @@ -52,6 +53,7 @@ var A; A.Point = Point; })(A || (A = {})); //// [module.js] +"use strict"; var A; (function (A) { let Point; @@ -60,12 +62,14 @@ var A; })(Point = A.Point || (A.Point = {})); })(A || (A = {})); //// [test.js] +"use strict"; var fn; var fn = A.Point; var cl; var cl = A.Point(); var cl = A.Point.Origin; // not expected to be an error. //// [simple.js] +"use strict"; var B; (function (B) { function Point() { diff --git a/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.js b/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.js index 73ca62dcd88f1..63b6e45a3991f 100644 --- a/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.js +++ b/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.js @@ -23,6 +23,7 @@ var cl = B.Point.Origin; //// [function.js] +"use strict"; var A; (function (A) { function Point() { @@ -31,6 +32,7 @@ var A; A.Point = Point; })(A || (A = {})); //// [module.js] +"use strict"; var B; (function (B) { let Point; @@ -39,6 +41,7 @@ var B; })(Point = B.Point || (B.Point = {})); })(B || (B = {})); //// [test.js] +"use strict"; var fn; var fn = A.Point; var cl; diff --git a/tests/baselines/reference/FunctionDeclaration10_es6.js b/tests/baselines/reference/FunctionDeclaration10_es6.js index 4f7af9e24be2f..105fd29af269f 100644 --- a/tests/baselines/reference/FunctionDeclaration10_es6.js +++ b/tests/baselines/reference/FunctionDeclaration10_es6.js @@ -5,5 +5,6 @@ function * foo(a = yield => yield) { } //// [FunctionDeclaration10_es6.js] +"use strict"; function* foo(a = yield, yield) { } diff --git a/tests/baselines/reference/FunctionDeclaration11_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration11_es6.errors.txt new file mode 100644 index 0000000000000..ed6c795761e21 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration11_es6.errors.txt @@ -0,0 +1,8 @@ +FunctionDeclaration11_es6.ts(1,12): error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. + + +==== FunctionDeclaration11_es6.ts (1 errors) ==== + function * yield() { + ~~~~~ +!!! error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. + } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration11_es6.js b/tests/baselines/reference/FunctionDeclaration11_es6.js index 36436e5679ee4..02708e78849a4 100644 --- a/tests/baselines/reference/FunctionDeclaration11_es6.js +++ b/tests/baselines/reference/FunctionDeclaration11_es6.js @@ -5,5 +5,6 @@ function * yield() { } //// [FunctionDeclaration11_es6.js] +"use strict"; function* yield() { } diff --git a/tests/baselines/reference/FunctionDeclaration12_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration12_es6.errors.txt index acdc5c9b2f32d..432b3035193ce 100644 --- a/tests/baselines/reference/FunctionDeclaration12_es6.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration12_es6.errors.txt @@ -1,7 +1,7 @@ -FunctionDeclaration12_es6.ts(1,20): error TS1359: Identifier expected. 'yield' is a reserved word that cannot be used here. +FunctionDeclaration12_es6.ts(1,20): error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. ==== FunctionDeclaration12_es6.ts (1 errors) ==== var v = function * yield() { } ~~~~~ -!!! error TS1359: Identifier expected. 'yield' is a reserved word that cannot be used here. \ No newline at end of file +!!! error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration12_es6.js b/tests/baselines/reference/FunctionDeclaration12_es6.js index 77f783aa26e85..6df28237886a4 100644 --- a/tests/baselines/reference/FunctionDeclaration12_es6.js +++ b/tests/baselines/reference/FunctionDeclaration12_es6.js @@ -4,4 +4,5 @@ var v = function * yield() { } //// [FunctionDeclaration12_es6.js] +"use strict"; var v = function* yield() { }; diff --git a/tests/baselines/reference/FunctionDeclaration13_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration13_es6.errors.txt index ba913e897b998..a828d0def89e6 100644 --- a/tests/baselines/reference/FunctionDeclaration13_es6.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration13_es6.errors.txt @@ -1,11 +1,14 @@ +FunctionDeclaration13_es6.ts(3,11): error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. FunctionDeclaration13_es6.ts(3,11): error TS2304: Cannot find name 'yield'. -==== FunctionDeclaration13_es6.ts (1 errors) ==== +==== FunctionDeclaration13_es6.ts (2 errors) ==== function * foo() { // Legal to use 'yield' in a type context. var v: yield; ~~~~~ +!!! error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. + ~~~~~ !!! error TS2304: Cannot find name 'yield'. } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration13_es6.js b/tests/baselines/reference/FunctionDeclaration13_es6.js index 1495b2c78c90f..f7e236180e65b 100644 --- a/tests/baselines/reference/FunctionDeclaration13_es6.js +++ b/tests/baselines/reference/FunctionDeclaration13_es6.js @@ -8,6 +8,7 @@ function * foo() { //// [FunctionDeclaration13_es6.js] +"use strict"; function* foo() { // Legal to use 'yield' in a type context. var v; diff --git a/tests/baselines/reference/FunctionDeclaration1_es6.js b/tests/baselines/reference/FunctionDeclaration1_es6.js index ebe562345226f..97cec2ded8b3c 100644 --- a/tests/baselines/reference/FunctionDeclaration1_es6.js +++ b/tests/baselines/reference/FunctionDeclaration1_es6.js @@ -5,5 +5,6 @@ function * foo() { } //// [FunctionDeclaration1_es6.js] +"use strict"; function* foo() { } diff --git a/tests/baselines/reference/FunctionDeclaration2_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration2_es6.errors.txt new file mode 100644 index 0000000000000..ed45ffd2e325f --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration2_es6.errors.txt @@ -0,0 +1,8 @@ +FunctionDeclaration2_es6.ts(1,12): error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. + + +==== FunctionDeclaration2_es6.ts (1 errors) ==== + function f(yield) { + ~~~~~ +!!! error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. + } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration2_es6.js b/tests/baselines/reference/FunctionDeclaration2_es6.js index b162aa7fe4560..08c7ab1554d55 100644 --- a/tests/baselines/reference/FunctionDeclaration2_es6.js +++ b/tests/baselines/reference/FunctionDeclaration2_es6.js @@ -5,5 +5,6 @@ function f(yield) { } //// [FunctionDeclaration2_es6.js] +"use strict"; function f(yield) { } diff --git a/tests/baselines/reference/FunctionDeclaration2_es6.types b/tests/baselines/reference/FunctionDeclaration2_es6.types index eb85c4124006f..ab3967a8e9039 100644 --- a/tests/baselines/reference/FunctionDeclaration2_es6.types +++ b/tests/baselines/reference/FunctionDeclaration2_es6.types @@ -5,4 +5,5 @@ function f(yield) { >f : (yield: any) => void > : ^ ^^^^^^^^^^^^^^ >yield : any +> : ^^^ } diff --git a/tests/baselines/reference/FunctionDeclaration3.errors.txt b/tests/baselines/reference/FunctionDeclaration3.errors.txt index 309efcbd12e85..c678e23d03ea2 100644 --- a/tests/baselines/reference/FunctionDeclaration3.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration3.errors.txt @@ -1,7 +1,10 @@ FunctionDeclaration3.ts(1,10): error TS2391: Function implementation is missing or not immediately following the declaration. +FunctionDeclaration3.ts(1,10): error TS7010: 'foo', which lacks return-type annotation, implicitly has an 'any' return type. -==== FunctionDeclaration3.ts (1 errors) ==== +==== FunctionDeclaration3.ts (2 errors) ==== function foo(); ~~~ -!!! error TS2391: Function implementation is missing or not immediately following the declaration. \ No newline at end of file +!!! error TS2391: Function implementation is missing or not immediately following the declaration. + ~~~ +!!! error TS7010: 'foo', which lacks return-type annotation, implicitly has an 'any' return type. \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration3.js b/tests/baselines/reference/FunctionDeclaration3.js index 9e1cea2afc497..ae6d41579e0f9 100644 --- a/tests/baselines/reference/FunctionDeclaration3.js +++ b/tests/baselines/reference/FunctionDeclaration3.js @@ -4,3 +4,4 @@ function foo(); //// [FunctionDeclaration3.js] +"use strict"; diff --git a/tests/baselines/reference/FunctionDeclaration3_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration3_es6.errors.txt index 131c54c9f1e20..ee922ce1d73a9 100644 --- a/tests/baselines/reference/FunctionDeclaration3_es6.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration3_es6.errors.txt @@ -1,8 +1,17 @@ +FunctionDeclaration3_es6.ts(1,12): error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. +FunctionDeclaration3_es6.ts(1,12): error TS7022: 'yield' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. +FunctionDeclaration3_es6.ts(1,20): error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. FunctionDeclaration3_es6.ts(1,20): error TS2372: Parameter 'yield' cannot reference itself. -==== FunctionDeclaration3_es6.ts (1 errors) ==== +==== FunctionDeclaration3_es6.ts (4 errors) ==== function f(yield = yield) { + ~~~~~ +!!! error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. + ~~~~~~~~~~~~~ +!!! error TS7022: 'yield' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. + ~~~~~ +!!! error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. ~~~~~ !!! error TS2372: Parameter 'yield' cannot reference itself. } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration3_es6.js b/tests/baselines/reference/FunctionDeclaration3_es6.js index 86a0765043c8e..f25c35f2c602f 100644 --- a/tests/baselines/reference/FunctionDeclaration3_es6.js +++ b/tests/baselines/reference/FunctionDeclaration3_es6.js @@ -5,5 +5,6 @@ function f(yield = yield) { } //// [FunctionDeclaration3_es6.js] +"use strict"; function f(yield = yield) { } diff --git a/tests/baselines/reference/FunctionDeclaration4.errors.txt b/tests/baselines/reference/FunctionDeclaration4.errors.txt index 6cca5dfc7e021..547b548867aee 100644 --- a/tests/baselines/reference/FunctionDeclaration4.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration4.errors.txt @@ -1,8 +1,11 @@ +FunctionDeclaration4.ts(1,10): error TS7010: 'foo', which lacks return-type annotation, implicitly has an 'any' return type. FunctionDeclaration4.ts(2,10): error TS2389: Function implementation name must be 'foo'. -==== FunctionDeclaration4.ts (1 errors) ==== +==== FunctionDeclaration4.ts (2 errors) ==== function foo(); + ~~~ +!!! error TS7010: 'foo', which lacks return-type annotation, implicitly has an 'any' return type. function bar() { } ~~~ !!! error TS2389: Function implementation name must be 'foo'. \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration4.js b/tests/baselines/reference/FunctionDeclaration4.js index eee614c6e026c..48cb943275dd3 100644 --- a/tests/baselines/reference/FunctionDeclaration4.js +++ b/tests/baselines/reference/FunctionDeclaration4.js @@ -5,4 +5,5 @@ function foo(); function bar() { } //// [FunctionDeclaration4.js] +"use strict"; function bar() { } diff --git a/tests/baselines/reference/FunctionDeclaration4_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration4_es6.errors.txt new file mode 100644 index 0000000000000..30e994926cbc5 --- /dev/null +++ b/tests/baselines/reference/FunctionDeclaration4_es6.errors.txt @@ -0,0 +1,8 @@ +FunctionDeclaration4_es6.ts(1,10): error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. + + +==== FunctionDeclaration4_es6.ts (1 errors) ==== + function yield() { + ~~~~~ +!!! error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. + } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration4_es6.js b/tests/baselines/reference/FunctionDeclaration4_es6.js index 7420537b63bc0..b97fac6da51bd 100644 --- a/tests/baselines/reference/FunctionDeclaration4_es6.js +++ b/tests/baselines/reference/FunctionDeclaration4_es6.js @@ -5,5 +5,6 @@ function yield() { } //// [FunctionDeclaration4_es6.js] +"use strict"; function yield() { } diff --git a/tests/baselines/reference/FunctionDeclaration5_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration5_es6.errors.txt index f3aeba6c9c1ee..7f909037a705f 100644 --- a/tests/baselines/reference/FunctionDeclaration5_es6.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration5_es6.errors.txt @@ -1,8 +1,11 @@ -FunctionDeclaration5_es6.ts(1,14): error TS1359: Identifier expected. 'yield' is a reserved word that cannot be used here. +FunctionDeclaration5_es6.ts(1,14): error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. +FunctionDeclaration5_es6.ts(1,14): error TS7006: Parameter 'yield' implicitly has an 'any' type. -==== FunctionDeclaration5_es6.ts (1 errors) ==== +==== FunctionDeclaration5_es6.ts (2 errors) ==== function*foo(yield) { ~~~~~ -!!! error TS1359: Identifier expected. 'yield' is a reserved word that cannot be used here. +!!! error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. + ~~~~~ +!!! error TS7006: Parameter 'yield' implicitly has an 'any' type. } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration5_es6.js b/tests/baselines/reference/FunctionDeclaration5_es6.js index 059ed261bb656..b1f00cd058bd5 100644 --- a/tests/baselines/reference/FunctionDeclaration5_es6.js +++ b/tests/baselines/reference/FunctionDeclaration5_es6.js @@ -5,5 +5,6 @@ function*foo(yield) { } //// [FunctionDeclaration5_es6.js] +"use strict"; function* foo(yield) { } diff --git a/tests/baselines/reference/FunctionDeclaration6.errors.txt b/tests/baselines/reference/FunctionDeclaration6.errors.txt index 11495f5d341e5..261852cbcb0da 100644 --- a/tests/baselines/reference/FunctionDeclaration6.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration6.errors.txt @@ -1,9 +1,12 @@ +FunctionDeclaration6.ts(2,14): error TS7010: 'foo', which lacks return-type annotation, implicitly has an 'any' return type. FunctionDeclaration6.ts(3,14): error TS2389: Function implementation name must be 'foo'. -==== FunctionDeclaration6.ts (1 errors) ==== +==== FunctionDeclaration6.ts (2 errors) ==== { function foo(); + ~~~ +!!! error TS7010: 'foo', which lacks return-type annotation, implicitly has an 'any' return type. function bar() { } ~~~ !!! error TS2389: Function implementation name must be 'foo'. diff --git a/tests/baselines/reference/FunctionDeclaration6.js b/tests/baselines/reference/FunctionDeclaration6.js index 2e00f2e143514..08f2ab2b2b5c9 100644 --- a/tests/baselines/reference/FunctionDeclaration6.js +++ b/tests/baselines/reference/FunctionDeclaration6.js @@ -7,6 +7,7 @@ } //// [FunctionDeclaration6.js] +"use strict"; { function bar() { } } diff --git a/tests/baselines/reference/FunctionDeclaration6_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration6_es6.errors.txt index 4afe01a7c9ced..171e1cb4dcd98 100644 --- a/tests/baselines/reference/FunctionDeclaration6_es6.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration6_es6.errors.txt @@ -1,8 +1,11 @@ FunctionDeclaration6_es6.ts(1,18): error TS2523: 'yield' expressions cannot be used in a parameter initializer. +FunctionDeclaration6_es6.ts(1,18): error TS7057: 'yield' expression implicitly results in an 'any' type because its containing generator lacks a return-type annotation. -==== FunctionDeclaration6_es6.ts (1 errors) ==== +==== FunctionDeclaration6_es6.ts (2 errors) ==== function*foo(a = yield) { ~~~~~ !!! error TS2523: 'yield' expressions cannot be used in a parameter initializer. + ~~~~~ +!!! error TS7057: 'yield' expression implicitly results in an 'any' type because its containing generator lacks a return-type annotation. } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration6_es6.js b/tests/baselines/reference/FunctionDeclaration6_es6.js index d0ca5adb8a77e..a141cde54ada2 100644 --- a/tests/baselines/reference/FunctionDeclaration6_es6.js +++ b/tests/baselines/reference/FunctionDeclaration6_es6.js @@ -5,5 +5,6 @@ function*foo(a = yield) { } //// [FunctionDeclaration6_es6.js] +"use strict"; function* foo(a = yield) { } diff --git a/tests/baselines/reference/FunctionDeclaration7.errors.txt b/tests/baselines/reference/FunctionDeclaration7.errors.txt index e22c882cac5a4..22322c946efbf 100644 --- a/tests/baselines/reference/FunctionDeclaration7.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration7.errors.txt @@ -1,9 +1,12 @@ FunctionDeclaration7.ts(2,13): error TS2391: Function implementation is missing or not immediately following the declaration. +FunctionDeclaration7.ts(2,13): error TS7010: 'foo', which lacks return-type annotation, implicitly has an 'any' return type. -==== FunctionDeclaration7.ts (1 errors) ==== +==== FunctionDeclaration7.ts (2 errors) ==== namespace M { function foo(); ~~~ !!! error TS2391: Function implementation is missing or not immediately following the declaration. + ~~~ +!!! error TS7010: 'foo', which lacks return-type annotation, implicitly has an 'any' return type. } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration7.js b/tests/baselines/reference/FunctionDeclaration7.js index 4990bf8f4bd9e..1d843d540b4f1 100644 --- a/tests/baselines/reference/FunctionDeclaration7.js +++ b/tests/baselines/reference/FunctionDeclaration7.js @@ -6,6 +6,7 @@ namespace M { } //// [FunctionDeclaration7.js] +"use strict"; var M; (function (M) { })(M || (M = {})); diff --git a/tests/baselines/reference/FunctionDeclaration7_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration7_es6.errors.txt index 73a84a46048e4..4fad4a34954ac 100644 --- a/tests/baselines/reference/FunctionDeclaration7_es6.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration7_es6.errors.txt @@ -1,11 +1,14 @@ FunctionDeclaration7_es6.ts(3,20): error TS2523: 'yield' expressions cannot be used in a parameter initializer. +FunctionDeclaration7_es6.ts(3,20): error TS7057: 'yield' expression implicitly results in an 'any' type because its containing generator lacks a return-type annotation. -==== FunctionDeclaration7_es6.ts (1 errors) ==== +==== FunctionDeclaration7_es6.ts (2 errors) ==== function*bar() { // 'yield' here is an identifier, and not a yield expression. function*foo(a = yield) { ~~~~~ !!! error TS2523: 'yield' expressions cannot be used in a parameter initializer. + ~~~~~ +!!! error TS7057: 'yield' expression implicitly results in an 'any' type because its containing generator lacks a return-type annotation. } } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration7_es6.js b/tests/baselines/reference/FunctionDeclaration7_es6.js index b63493f860961..08f56b21f59cf 100644 --- a/tests/baselines/reference/FunctionDeclaration7_es6.js +++ b/tests/baselines/reference/FunctionDeclaration7_es6.js @@ -8,6 +8,7 @@ function*bar() { } //// [FunctionDeclaration7_es6.js] +"use strict"; function* bar() { // 'yield' here is an identifier, and not a yield expression. function* foo(a = yield) { diff --git a/tests/baselines/reference/FunctionDeclaration8_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration8_es6.errors.txt index d649f8ef8b34b..972a640900c1b 100644 --- a/tests/baselines/reference/FunctionDeclaration8_es6.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration8_es6.errors.txt @@ -1,10 +1,13 @@ +FunctionDeclaration8_es6.ts(1,12): error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. FunctionDeclaration8_es6.ts(1,12): error TS2304: Cannot find name 'yield'. FunctionDeclaration8_es6.ts(1,20): error TS2304: Cannot find name 'foo'. -==== FunctionDeclaration8_es6.ts (2 errors) ==== +==== FunctionDeclaration8_es6.ts (3 errors) ==== var v = { [yield]: foo } ~~~~~ +!!! error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. + ~~~~~ !!! error TS2304: Cannot find name 'yield'. ~~~ !!! error TS2304: Cannot find name 'foo'. \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration8_es6.js b/tests/baselines/reference/FunctionDeclaration8_es6.js index 114f8a31dfc09..ec8eca2fde332 100644 --- a/tests/baselines/reference/FunctionDeclaration8_es6.js +++ b/tests/baselines/reference/FunctionDeclaration8_es6.js @@ -4,4 +4,5 @@ var v = { [yield]: foo } //// [FunctionDeclaration8_es6.js] +"use strict"; var v = { [yield]: foo }; diff --git a/tests/baselines/reference/FunctionDeclaration9_es6.js b/tests/baselines/reference/FunctionDeclaration9_es6.js index bab288e53236b..0c221af3078f6 100644 --- a/tests/baselines/reference/FunctionDeclaration9_es6.js +++ b/tests/baselines/reference/FunctionDeclaration9_es6.js @@ -6,6 +6,7 @@ function * foo() { } //// [FunctionDeclaration9_es6.js] +"use strict"; function* foo() { var v = { [yield]: foo }; } diff --git a/tests/baselines/reference/FunctionExpression1_es6.js b/tests/baselines/reference/FunctionExpression1_es6.js index 8455084b0cdf1..e3b48f0129ffe 100644 --- a/tests/baselines/reference/FunctionExpression1_es6.js +++ b/tests/baselines/reference/FunctionExpression1_es6.js @@ -4,4 +4,5 @@ var v = function * () { } //// [FunctionExpression1_es6.js] +"use strict"; var v = function* () { }; diff --git a/tests/baselines/reference/FunctionExpression2_es6.js b/tests/baselines/reference/FunctionExpression2_es6.js index da565d4830f72..0b2940f1eae50 100644 --- a/tests/baselines/reference/FunctionExpression2_es6.js +++ b/tests/baselines/reference/FunctionExpression2_es6.js @@ -4,4 +4,5 @@ var v = function * foo() { } //// [FunctionExpression2_es6.js] +"use strict"; var v = function* foo() { }; diff --git a/tests/baselines/reference/FunctionPropertyAssignments1_es6.js b/tests/baselines/reference/FunctionPropertyAssignments1_es6.js index f9014eded106e..ab1387d057815 100644 --- a/tests/baselines/reference/FunctionPropertyAssignments1_es6.js +++ b/tests/baselines/reference/FunctionPropertyAssignments1_es6.js @@ -4,4 +4,5 @@ var v = { *foo() { } } //// [FunctionPropertyAssignments1_es6.js] +"use strict"; var v = { *foo() { } }; diff --git a/tests/baselines/reference/FunctionPropertyAssignments2_es6.js b/tests/baselines/reference/FunctionPropertyAssignments2_es6.js index 149426d1afa8b..f0551b23667db 100644 --- a/tests/baselines/reference/FunctionPropertyAssignments2_es6.js +++ b/tests/baselines/reference/FunctionPropertyAssignments2_es6.js @@ -4,4 +4,5 @@ var v = { *() { } } //// [FunctionPropertyAssignments2_es6.js] +"use strict"; var v = { *() { } }; diff --git a/tests/baselines/reference/FunctionPropertyAssignments3_es6.js b/tests/baselines/reference/FunctionPropertyAssignments3_es6.js index 3676eeb18cc79..603bba4652553 100644 --- a/tests/baselines/reference/FunctionPropertyAssignments3_es6.js +++ b/tests/baselines/reference/FunctionPropertyAssignments3_es6.js @@ -4,4 +4,5 @@ var v = { *{ } } //// [FunctionPropertyAssignments3_es6.js] +"use strict"; var v = { *() { } }; diff --git a/tests/baselines/reference/FunctionPropertyAssignments4_es6.js b/tests/baselines/reference/FunctionPropertyAssignments4_es6.js index 70c4938f04acc..39ee92a217d1b 100644 --- a/tests/baselines/reference/FunctionPropertyAssignments4_es6.js +++ b/tests/baselines/reference/FunctionPropertyAssignments4_es6.js @@ -4,4 +4,5 @@ var v = { * } //// [FunctionPropertyAssignments4_es6.js] +"use strict"; var v = {}; diff --git a/tests/baselines/reference/FunctionPropertyAssignments5_es6.js b/tests/baselines/reference/FunctionPropertyAssignments5_es6.js index f48e1593bcf24..516aebe59e95f 100644 --- a/tests/baselines/reference/FunctionPropertyAssignments5_es6.js +++ b/tests/baselines/reference/FunctionPropertyAssignments5_es6.js @@ -4,4 +4,5 @@ var v = { *[foo()]() { } } //// [FunctionPropertyAssignments5_es6.js] +"use strict"; var v = { *[foo()]() { } }; diff --git a/tests/baselines/reference/FunctionPropertyAssignments6_es6.js b/tests/baselines/reference/FunctionPropertyAssignments6_es6.js index 205bf9cf4979f..39396780cc24a 100644 --- a/tests/baselines/reference/FunctionPropertyAssignments6_es6.js +++ b/tests/baselines/reference/FunctionPropertyAssignments6_es6.js @@ -4,4 +4,5 @@ var v = { *() { } } //// [FunctionPropertyAssignments6_es6.js] +"use strict"; var v = { *() { } }; diff --git a/tests/baselines/reference/InterfaceDeclaration8.js b/tests/baselines/reference/InterfaceDeclaration8.js index 629c1e6e1a551..22e1936e67355 100644 --- a/tests/baselines/reference/InterfaceDeclaration8.js +++ b/tests/baselines/reference/InterfaceDeclaration8.js @@ -5,3 +5,4 @@ interface string { } //// [InterfaceDeclaration8.js] +"use strict"; diff --git a/tests/baselines/reference/InvalidNonInstantiatedModule.js b/tests/baselines/reference/InvalidNonInstantiatedModule.js index 5b585a42fb304..dc404bc0cf651 100644 --- a/tests/baselines/reference/InvalidNonInstantiatedModule.js +++ b/tests/baselines/reference/InvalidNonInstantiatedModule.js @@ -11,5 +11,6 @@ var x: typeof M; // Error only a namespace //// [InvalidNonInstantiatedModule.js] +"use strict"; var m = M; // Error, not instantiated can not be used as var var x; // Error only a namespace diff --git a/tests/baselines/reference/MemberAccessorDeclaration15.js b/tests/baselines/reference/MemberAccessorDeclaration15.js index 126c5f798e8a6..f3cfe7e53c778 100644 --- a/tests/baselines/reference/MemberAccessorDeclaration15.js +++ b/tests/baselines/reference/MemberAccessorDeclaration15.js @@ -6,6 +6,7 @@ class C { } //// [MemberAccessorDeclaration15.js] +"use strict"; class C { set Foo(a) { } } diff --git a/tests/baselines/reference/MemberFunctionDeclaration1_es6.js b/tests/baselines/reference/MemberFunctionDeclaration1_es6.js index 049b3149ed0df..27cb770126adf 100644 --- a/tests/baselines/reference/MemberFunctionDeclaration1_es6.js +++ b/tests/baselines/reference/MemberFunctionDeclaration1_es6.js @@ -6,6 +6,7 @@ class C { } //// [MemberFunctionDeclaration1_es6.js] +"use strict"; class C { *foo() { } } diff --git a/tests/baselines/reference/MemberFunctionDeclaration2_es6.js b/tests/baselines/reference/MemberFunctionDeclaration2_es6.js index cdae46df370f0..4d4a4cebffb33 100644 --- a/tests/baselines/reference/MemberFunctionDeclaration2_es6.js +++ b/tests/baselines/reference/MemberFunctionDeclaration2_es6.js @@ -6,6 +6,7 @@ class C { } //// [MemberFunctionDeclaration2_es6.js] +"use strict"; class C { *foo() { } } diff --git a/tests/baselines/reference/MemberFunctionDeclaration3_es6.js b/tests/baselines/reference/MemberFunctionDeclaration3_es6.js index 5a1db01dafabe..581a8308f674d 100644 --- a/tests/baselines/reference/MemberFunctionDeclaration3_es6.js +++ b/tests/baselines/reference/MemberFunctionDeclaration3_es6.js @@ -6,6 +6,7 @@ class C { } //// [MemberFunctionDeclaration3_es6.js] +"use strict"; class C { *[foo]() { } } diff --git a/tests/baselines/reference/MemberFunctionDeclaration4_es6.js b/tests/baselines/reference/MemberFunctionDeclaration4_es6.js index dc0f55f23bdaa..2d03bb47f5a2f 100644 --- a/tests/baselines/reference/MemberFunctionDeclaration4_es6.js +++ b/tests/baselines/reference/MemberFunctionDeclaration4_es6.js @@ -6,6 +6,7 @@ class C { } //// [MemberFunctionDeclaration4_es6.js] +"use strict"; class C { *() { } } diff --git a/tests/baselines/reference/MemberFunctionDeclaration5_es6.errors.txt b/tests/baselines/reference/MemberFunctionDeclaration5_es6.errors.txt index e4f6d34cc66ee..f9cdb3c2bc141 100644 --- a/tests/baselines/reference/MemberFunctionDeclaration5_es6.errors.txt +++ b/tests/baselines/reference/MemberFunctionDeclaration5_es6.errors.txt @@ -1,9 +1,12 @@ +MemberFunctionDeclaration5_es6.ts(2,5): error TS7010: '(Missing)', which lacks return-type annotation, implicitly has an 'any' return type. MemberFunctionDeclaration5_es6.ts(3,1): error TS1003: Identifier expected. -==== MemberFunctionDeclaration5_es6.ts (1 errors) ==== +==== MemberFunctionDeclaration5_es6.ts (2 errors) ==== class C { * + +!!! error TS7010: '(Missing)', which lacks return-type annotation, implicitly has an 'any' return type. } ~ !!! error TS1003: Identifier expected. \ No newline at end of file diff --git a/tests/baselines/reference/MemberFunctionDeclaration5_es6.js b/tests/baselines/reference/MemberFunctionDeclaration5_es6.js index 02b6b91d103d4..9ac8f859ac92e 100644 --- a/tests/baselines/reference/MemberFunctionDeclaration5_es6.js +++ b/tests/baselines/reference/MemberFunctionDeclaration5_es6.js @@ -6,5 +6,6 @@ class C { } //// [MemberFunctionDeclaration5_es6.js] +"use strict"; class C { } diff --git a/tests/baselines/reference/MemberFunctionDeclaration6_es6.errors.txt b/tests/baselines/reference/MemberFunctionDeclaration6_es6.errors.txt index ca7bb62c64c05..291b53dd61e1b 100644 --- a/tests/baselines/reference/MemberFunctionDeclaration6_es6.errors.txt +++ b/tests/baselines/reference/MemberFunctionDeclaration6_es6.errors.txt @@ -1,12 +1,15 @@ MemberFunctionDeclaration6_es6.ts(2,5): error TS2391: Function implementation is missing or not immediately following the declaration. +MemberFunctionDeclaration6_es6.ts(2,5): error TS7010: 'foo', which lacks return-type annotation, implicitly has an 'any' return type. MemberFunctionDeclaration6_es6.ts(3,1): error TS1005: '(' expected. -==== MemberFunctionDeclaration6_es6.ts (2 errors) ==== +==== MemberFunctionDeclaration6_es6.ts (3 errors) ==== class C { *foo ~~~ !!! error TS2391: Function implementation is missing or not immediately following the declaration. + ~~~ +!!! error TS7010: 'foo', which lacks return-type annotation, implicitly has an 'any' return type. } ~ !!! error TS1005: '(' expected. \ No newline at end of file diff --git a/tests/baselines/reference/MemberFunctionDeclaration6_es6.js b/tests/baselines/reference/MemberFunctionDeclaration6_es6.js index 9338d7d0e32f3..1df6e08498b65 100644 --- a/tests/baselines/reference/MemberFunctionDeclaration6_es6.js +++ b/tests/baselines/reference/MemberFunctionDeclaration6_es6.js @@ -6,5 +6,6 @@ class C { } //// [MemberFunctionDeclaration6_es6.js] +"use strict"; class C { } diff --git a/tests/baselines/reference/MemberFunctionDeclaration7_es6.js b/tests/baselines/reference/MemberFunctionDeclaration7_es6.js index d2b76e729f17e..96d3a0dc26c04 100644 --- a/tests/baselines/reference/MemberFunctionDeclaration7_es6.js +++ b/tests/baselines/reference/MemberFunctionDeclaration7_es6.js @@ -6,6 +6,7 @@ class C { } //// [MemberFunctionDeclaration7_es6.js] +"use strict"; class C { *foo() { } } diff --git a/tests/baselines/reference/MemberFunctionDeclaration8_es6.js b/tests/baselines/reference/MemberFunctionDeclaration8_es6.js index 00043612d6321..0fe905b010bc1 100644 --- a/tests/baselines/reference/MemberFunctionDeclaration8_es6.js +++ b/tests/baselines/reference/MemberFunctionDeclaration8_es6.js @@ -10,6 +10,7 @@ class C { } //// [MemberFunctionDeclaration8_es6.js] +"use strict"; class C { foo() { // Make sure we don't think of *bar as the start of a generator method. diff --git a/tests/baselines/reference/ModuleAndClassWithSameNameAndCommonRoot.errors.txt b/tests/baselines/reference/ModuleAndClassWithSameNameAndCommonRoot.errors.txt index 9f07a4ff5b9d4..0888ba00e73fc 100644 --- a/tests/baselines/reference/ModuleAndClassWithSameNameAndCommonRoot.errors.txt +++ b/tests/baselines/reference/ModuleAndClassWithSameNameAndCommonRoot.errors.txt @@ -1,6 +1,7 @@ module.ts(2,22): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. simple.ts(1,11): error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged. simple.ts(2,31): error TS2449: Class 'A' used before its declaration. +simple.ts(7,5): error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. ==== module.ts (1 errors) ==== @@ -25,7 +26,7 @@ simple.ts(2,31): error TS2449: Class 'A' used before its declaration. } } -==== simple.ts (2 errors) ==== +==== simple.ts (3 errors) ==== namespace A { ~ !!! error TS2434: A namespace declaration cannot be located prior to a class or function with which it is merged. @@ -38,5 +39,7 @@ simple.ts(2,31): error TS2449: Class 'A' used before its declaration. // duplicate identifier class A { id: string; + ~~ +!!! error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. } \ No newline at end of file diff --git a/tests/baselines/reference/ModuleAndClassWithSameNameAndCommonRoot.js b/tests/baselines/reference/ModuleAndClassWithSameNameAndCommonRoot.js index b58b60a1471a5..b37e59b8303b6 100644 --- a/tests/baselines/reference/ModuleAndClassWithSameNameAndCommonRoot.js +++ b/tests/baselines/reference/ModuleAndClassWithSameNameAndCommonRoot.js @@ -32,6 +32,7 @@ class A { //// [module.js] +"use strict"; var X; (function (X) { var Y; @@ -43,6 +44,7 @@ var X; })(Y = X.Y || (X.Y = {})); })(X || (X = {})); //// [classPoint.js] +"use strict"; var X; (function (X) { var Y; @@ -58,6 +60,7 @@ var X; })(Y = X.Y || (X.Y = {})); })(X || (X = {})); //// [simple.js] +"use strict"; var A; (function (A) { A.Instance = new A(); diff --git a/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.js b/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.js index a83ab20eed641..5b8fb0862d020 100644 --- a/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.js +++ b/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.js @@ -19,6 +19,7 @@ var y: { x: number; y: number }; var y = new enumdule.Point(0, 0); //// [ModuleAndEnumWithSameNameAndCommonRoot.js] +"use strict"; var enumdule; (function (enumdule) { class Point { diff --git a/tests/baselines/reference/ModuleAndFunctionWithSameNameAndCommonRoot.js b/tests/baselines/reference/ModuleAndFunctionWithSameNameAndCommonRoot.js index 305592b816244..802346970efc6 100644 --- a/tests/baselines/reference/ModuleAndFunctionWithSameNameAndCommonRoot.js +++ b/tests/baselines/reference/ModuleAndFunctionWithSameNameAndCommonRoot.js @@ -30,6 +30,7 @@ namespace B { //// [module.js] +"use strict"; var A; (function (A) { let Point; @@ -38,6 +39,7 @@ var A; })(Point = A.Point || (A.Point = {})); })(A || (A = {})); //// [function.js] +"use strict"; var A; (function (A) { // duplicate identifier error @@ -47,6 +49,7 @@ var A; A.Point = Point; })(A || (A = {})); //// [simple.js] +"use strict"; var B; (function (B) { let Point; diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedClasses.errors.txt b/tests/baselines/reference/ModuleWithExportedAndNonExportedClasses.errors.txt index 0f10f1b7194b8..efdfb8c0ac338 100644 --- a/tests/baselines/reference/ModuleWithExportedAndNonExportedClasses.errors.txt +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedClasses.errors.txt @@ -1,27 +1,51 @@ +ModuleWithExportedAndNonExportedClasses.ts(3,9): error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. +ModuleWithExportedAndNonExportedClasses.ts(4,9): error TS2564: Property 'name' has no initializer and is not definitely assigned in the constructor. +ModuleWithExportedAndNonExportedClasses.ts(8,9): error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. +ModuleWithExportedAndNonExportedClasses.ts(9,9): error TS2564: Property 'name' has no initializer and is not definitely assigned in the constructor. +ModuleWithExportedAndNonExportedClasses.ts(13,9): error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. +ModuleWithExportedAndNonExportedClasses.ts(14,9): error TS2564: Property 'name' has no initializer and is not definitely assigned in the constructor. +ModuleWithExportedAndNonExportedClasses.ts(18,9): error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. +ModuleWithExportedAndNonExportedClasses.ts(19,9): error TS2564: Property 'name' has no initializer and is not definitely assigned in the constructor. ModuleWithExportedAndNonExportedClasses.ts(30,16): error TS2339: Property 'A2' does not exist on type 'typeof A'. ModuleWithExportedAndNonExportedClasses.ts(31,17): error TS2339: Property 'A2' does not exist on type 'typeof A'. -==== ModuleWithExportedAndNonExportedClasses.ts (2 errors) ==== +==== ModuleWithExportedAndNonExportedClasses.ts (10 errors) ==== namespace A { export class A { id: number; + ~~ +!!! error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. name: string; + ~~~~ +!!! error TS2564: Property 'name' has no initializer and is not definitely assigned in the constructor. } export class AG{ id: T; + ~~ +!!! error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. name: U; + ~~~~ +!!! error TS2564: Property 'name' has no initializer and is not definitely assigned in the constructor. } class A2 { id: number; + ~~ +!!! error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. name: string; + ~~~~ +!!! error TS2564: Property 'name' has no initializer and is not definitely assigned in the constructor. } class AG2{ id: T; + ~~ +!!! error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. name: U; + ~~~~ +!!! error TS2564: Property 'name' has no initializer and is not definitely assigned in the constructor. } } diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedClasses.js b/tests/baselines/reference/ModuleWithExportedAndNonExportedClasses.js index 674e4cc2c336f..510bbb206ded0 100644 --- a/tests/baselines/reference/ModuleWithExportedAndNonExportedClasses.js +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedClasses.js @@ -36,6 +36,7 @@ var ag2 = new A.A2(); //// [ModuleWithExportedAndNonExportedClasses.js] +"use strict"; var A; (function (A_1) { class A { diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedEnums.js b/tests/baselines/reference/ModuleWithExportedAndNonExportedEnums.js index 7cc7f1d0d3b29..0c8d91237a946 100644 --- a/tests/baselines/reference/ModuleWithExportedAndNonExportedEnums.js +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedEnums.js @@ -14,6 +14,7 @@ var b = A.Day.Monday; //// [ModuleWithExportedAndNonExportedEnums.js] +"use strict"; var A; (function (A) { let Color; diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedFunctions.errors.txt b/tests/baselines/reference/ModuleWithExportedAndNonExportedFunctions.errors.txt index 8da10e756fc09..378916aee2665 100644 --- a/tests/baselines/reference/ModuleWithExportedAndNonExportedFunctions.errors.txt +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedFunctions.errors.txt @@ -1,8 +1,12 @@ +ModuleWithExportedAndNonExportedFunctions.ts(8,9): error TS2322: Type 'null' is not assignable to type 'U'. + 'U' could be instantiated with an arbitrary type which could be unrelated to 'null'. +ModuleWithExportedAndNonExportedFunctions.ts(16,9): error TS2322: Type 'null' is not assignable to type 'U'. + 'U' could be instantiated with an arbitrary type which could be unrelated to 'null'. ModuleWithExportedAndNonExportedFunctions.ts(28,13): error TS2339: Property 'fn2' does not exist on type 'typeof A'. ModuleWithExportedAndNonExportedFunctions.ts(29,14): error TS2551: Property 'fng2' does not exist on type 'typeof A'. Did you mean 'fng'? -==== ModuleWithExportedAndNonExportedFunctions.ts (2 errors) ==== +==== ModuleWithExportedAndNonExportedFunctions.ts (4 errors) ==== namespace A { export function fn(s: string) { @@ -11,6 +15,9 @@ ModuleWithExportedAndNonExportedFunctions.ts(29,14): error TS2551: Property 'fng export function fng(s: T): U { return null; + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'U'. +!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'null'. } function fn2(s: string) { @@ -19,6 +26,9 @@ ModuleWithExportedAndNonExportedFunctions.ts(29,14): error TS2551: Property 'fng function fng2(s: T): U { return null; + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'U'. +!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'null'. } } diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedFunctions.js b/tests/baselines/reference/ModuleWithExportedAndNonExportedFunctions.js index f052fe9bc91cf..40bcf5a2ccf82 100644 --- a/tests/baselines/reference/ModuleWithExportedAndNonExportedFunctions.js +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedFunctions.js @@ -32,6 +32,7 @@ var fn2 = A.fn2; var fng2 = A.fng2; //// [ModuleWithExportedAndNonExportedFunctions.js] +"use strict"; var A; (function (A) { function fn(s) { diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.js b/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.js index eaea0758bedd9..919c77f40deff 100644 --- a/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.js +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.js @@ -42,6 +42,7 @@ var line = Geometry.Lines.Line; //// [ModuleWithExportedAndNonExportedImportAlias.js] +"use strict"; var B; (function (B) { class Line { diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedVariables.js b/tests/baselines/reference/ModuleWithExportedAndNonExportedVariables.js index 20dc6c94f4798..d676c05150ada 100644 --- a/tests/baselines/reference/ModuleWithExportedAndNonExportedVariables.js +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedVariables.js @@ -15,6 +15,7 @@ var y = A.y; //// [ModuleWithExportedAndNonExportedVariables.js] +"use strict"; var A; (function (A) { A.x = 'hello world'; diff --git a/tests/baselines/reference/NonInitializedExportInInternalModule.errors.txt b/tests/baselines/reference/NonInitializedExportInInternalModule.errors.txt index 20fd93f7c5cb8..6ebcd07495e35 100644 --- a/tests/baselines/reference/NonInitializedExportInInternalModule.errors.txt +++ b/tests/baselines/reference/NonInitializedExportInInternalModule.errors.txt @@ -1,15 +1,18 @@ NonInitializedExportInInternalModule.ts(2,8): error TS1123: Variable declaration list cannot be empty. +NonInitializedExportInInternalModule.ts(3,5): error TS1212: Identifier expected. 'let' is a reserved word in strict mode. NonInitializedExportInInternalModule.ts(3,5): error TS2304: Cannot find name 'let'. NonInitializedExportInInternalModule.ts(4,10): error TS1123: Variable declaration list cannot be empty. -==== NonInitializedExportInInternalModule.ts (3 errors) ==== +==== NonInitializedExportInInternalModule.ts (4 errors) ==== namespace Inner { var; !!! error TS1123: Variable declaration list cannot be empty. let; ~~~ +!!! error TS1212: Identifier expected. 'let' is a reserved word in strict mode. + ~~~ !!! error TS2304: Cannot find name 'let'. const; diff --git a/tests/baselines/reference/NonInitializedExportInInternalModule.js b/tests/baselines/reference/NonInitializedExportInInternalModule.js index ecc4cb85f4043..7dc27edb63e27 100644 --- a/tests/baselines/reference/NonInitializedExportInInternalModule.js +++ b/tests/baselines/reference/NonInitializedExportInInternalModule.js @@ -37,6 +37,7 @@ namespace Inner { } //// [NonInitializedExportInInternalModule.js] +"use strict"; var Inner; (function (Inner) { var ; diff --git a/tests/baselines/reference/ParameterList13.errors.txt b/tests/baselines/reference/ParameterList13.errors.txt index 34a5427b99950..bb7377596f98f 100644 --- a/tests/baselines/reference/ParameterList13.errors.txt +++ b/tests/baselines/reference/ParameterList13.errors.txt @@ -1,9 +1,15 @@ +ParameterList13.ts(2,5): error TS7013: Construct signature, which lacks return-type annotation, implicitly has an 'any' return type. ParameterList13.ts(2,10): error TS2369: A parameter property is only allowed in a constructor implementation. +ParameterList13.ts(2,10): error TS7006: Parameter 'x' implicitly has an 'any' type. -==== ParameterList13.ts (1 errors) ==== +==== ParameterList13.ts (3 errors) ==== interface I { new (public x); + ~~~~~~~~~~~~~~~ +!!! error TS7013: Construct signature, which lacks return-type annotation, implicitly has an 'any' return type. ~~~~~~~~ !!! error TS2369: A parameter property is only allowed in a constructor implementation. + ~~~~~~~~ +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. } \ No newline at end of file diff --git a/tests/baselines/reference/ParameterList13.js b/tests/baselines/reference/ParameterList13.js index d9273080b243e..69a47b32dd054 100644 --- a/tests/baselines/reference/ParameterList13.js +++ b/tests/baselines/reference/ParameterList13.js @@ -6,3 +6,4 @@ interface I { } //// [ParameterList13.js] +"use strict"; diff --git a/tests/baselines/reference/ParameterList4.errors.txt b/tests/baselines/reference/ParameterList4.errors.txt index d97d97e24ca99..67d4f376e4ae2 100644 --- a/tests/baselines/reference/ParameterList4.errors.txt +++ b/tests/baselines/reference/ParameterList4.errors.txt @@ -1,8 +1,11 @@ ParameterList4.ts(1,12): error TS2369: A parameter property is only allowed in a constructor implementation. +ParameterList4.ts(1,12): error TS7006: Parameter 'A' implicitly has an 'any' type. -==== ParameterList4.ts (1 errors) ==== +==== ParameterList4.ts (2 errors) ==== function F(public A) { ~~~~~~~~ !!! error TS2369: A parameter property is only allowed in a constructor implementation. + ~~~~~~~~ +!!! error TS7006: Parameter 'A' implicitly has an 'any' type. } \ No newline at end of file diff --git a/tests/baselines/reference/ParameterList4.js b/tests/baselines/reference/ParameterList4.js index 5070698cc2fcd..0b1d0c6d8481f 100644 --- a/tests/baselines/reference/ParameterList4.js +++ b/tests/baselines/reference/ParameterList4.js @@ -5,5 +5,6 @@ function F(public A) { } //// [ParameterList4.js] +"use strict"; function F(A) { } diff --git a/tests/baselines/reference/ParameterList5.errors.txt b/tests/baselines/reference/ParameterList5.errors.txt index 96e653fee0531..d5145f3636dcc 100644 --- a/tests/baselines/reference/ParameterList5.errors.txt +++ b/tests/baselines/reference/ParameterList5.errors.txt @@ -1,14 +1,17 @@ ParameterList5.ts(1,15): error TS2355: A function whose declared type is neither 'undefined', 'void', nor 'any' must return a value. ParameterList5.ts(1,16): error TS2369: A parameter property is only allowed in a constructor implementation. +ParameterList5.ts(1,16): error TS7006: Parameter 'B' implicitly has an 'any' type. ParameterList5.ts(1,29): error TS2304: Cannot find name 'C'. -==== ParameterList5.ts (3 errors) ==== +==== ParameterList5.ts (4 errors) ==== function A(): (public B) => C { ~~~~~~~~~~~~~~~ !!! error TS2355: A function whose declared type is neither 'undefined', 'void', nor 'any' must return a value. ~~~~~~~~ !!! error TS2369: A parameter property is only allowed in a constructor implementation. + ~~~~~~~~ +!!! error TS7006: Parameter 'B' implicitly has an 'any' type. ~ !!! error TS2304: Cannot find name 'C'. } \ No newline at end of file diff --git a/tests/baselines/reference/ParameterList5.js b/tests/baselines/reference/ParameterList5.js index 48715d6ae562a..cc4a3f48f86ee 100644 --- a/tests/baselines/reference/ParameterList5.js +++ b/tests/baselines/reference/ParameterList5.js @@ -5,5 +5,6 @@ function A(): (public B) => C { } //// [ParameterList5.js] +"use strict"; function A() { } diff --git a/tests/baselines/reference/ParameterList6.errors.txt b/tests/baselines/reference/ParameterList6.errors.txt index afaaaf51ca90b..8f7139273f85e 100644 --- a/tests/baselines/reference/ParameterList6.errors.txt +++ b/tests/baselines/reference/ParameterList6.errors.txt @@ -1,10 +1,13 @@ ParameterList6.ts(2,19): error TS2369: A parameter property is only allowed in a constructor implementation. +ParameterList6.ts(2,19): error TS7006: Parameter 'A' implicitly has an 'any' type. -==== ParameterList6.ts (1 errors) ==== +==== ParameterList6.ts (2 errors) ==== class C { constructor(C: (public A) => any) { ~~~~~~~~ !!! error TS2369: A parameter property is only allowed in a constructor implementation. + ~~~~~~~~ +!!! error TS7006: Parameter 'A' implicitly has an 'any' type. } } \ No newline at end of file diff --git a/tests/baselines/reference/ParameterList6.js b/tests/baselines/reference/ParameterList6.js index 42eebf7339892..1fe9b4044dbf5 100644 --- a/tests/baselines/reference/ParameterList6.js +++ b/tests/baselines/reference/ParameterList6.js @@ -7,6 +7,7 @@ class C { } //// [ParameterList6.js] +"use strict"; class C { constructor(C) { } diff --git a/tests/baselines/reference/ParameterList7.js b/tests/baselines/reference/ParameterList7.js index f62bda39e684c..0f00f547bf221 100644 --- a/tests/baselines/reference/ParameterList7.js +++ b/tests/baselines/reference/ParameterList7.js @@ -8,6 +8,7 @@ class C1 { } //// [ParameterList7.js] +"use strict"; class C1 { constructor(p3) { this.p3 = p3; diff --git a/tests/baselines/reference/ParameterList8.js b/tests/baselines/reference/ParameterList8.js index ba1a14752248b..c4457c4924486 100644 --- a/tests/baselines/reference/ParameterList8.js +++ b/tests/baselines/reference/ParameterList8.js @@ -8,3 +8,4 @@ declare class C2 { } //// [ParameterList8.js] +"use strict"; diff --git a/tests/baselines/reference/Protected1.js b/tests/baselines/reference/Protected1.js index f342e0d3efa78..8a683b339406b 100644 --- a/tests/baselines/reference/Protected1.js +++ b/tests/baselines/reference/Protected1.js @@ -5,5 +5,6 @@ protected class C { } //// [Protected1.js] +"use strict"; class C { } diff --git a/tests/baselines/reference/Protected2.js b/tests/baselines/reference/Protected2.js index 042cb12504924..3355896095256 100644 --- a/tests/baselines/reference/Protected2.js +++ b/tests/baselines/reference/Protected2.js @@ -5,3 +5,4 @@ protected namespace M { } //// [Protected2.js] +"use strict"; diff --git a/tests/baselines/reference/Protected3.js b/tests/baselines/reference/Protected3.js index 06e6054bd6950..370e3a17bb28e 100644 --- a/tests/baselines/reference/Protected3.js +++ b/tests/baselines/reference/Protected3.js @@ -6,6 +6,7 @@ class C { } //// [Protected3.js] +"use strict"; class C { constructor() { } } diff --git a/tests/baselines/reference/Protected4.js b/tests/baselines/reference/Protected4.js index 75cfa2a7c6a68..5317cb42819d5 100644 --- a/tests/baselines/reference/Protected4.js +++ b/tests/baselines/reference/Protected4.js @@ -6,6 +6,7 @@ class C { } //// [Protected4.js] +"use strict"; class C { m() { } } diff --git a/tests/baselines/reference/Protected5.js b/tests/baselines/reference/Protected5.js index 537f8234b6e32..b825a83a6caa9 100644 --- a/tests/baselines/reference/Protected5.js +++ b/tests/baselines/reference/Protected5.js @@ -6,6 +6,7 @@ class C { } //// [Protected5.js] +"use strict"; class C { static m() { } } diff --git a/tests/baselines/reference/Protected6.js b/tests/baselines/reference/Protected6.js index 384830949b4b7..9a0344fc554c6 100644 --- a/tests/baselines/reference/Protected6.js +++ b/tests/baselines/reference/Protected6.js @@ -6,6 +6,7 @@ class C { } //// [Protected6.js] +"use strict"; class C { static m() { } } diff --git a/tests/baselines/reference/Protected7.js b/tests/baselines/reference/Protected7.js index d965c7b9d6ca0..d5a840e25f10f 100644 --- a/tests/baselines/reference/Protected7.js +++ b/tests/baselines/reference/Protected7.js @@ -6,6 +6,7 @@ class C { } //// [Protected7.js] +"use strict"; class C { m() { } } diff --git a/tests/baselines/reference/Protected8.js b/tests/baselines/reference/Protected8.js index 7a2dda4c92738..3a2997f5a4a43 100644 --- a/tests/baselines/reference/Protected8.js +++ b/tests/baselines/reference/Protected8.js @@ -7,3 +7,4 @@ interface I { } //// [Protected8.js] +"use strict"; diff --git a/tests/baselines/reference/Protected9.js b/tests/baselines/reference/Protected9.js index 2088595fe56cb..e9a046d9ca4f4 100644 --- a/tests/baselines/reference/Protected9.js +++ b/tests/baselines/reference/Protected9.js @@ -6,6 +6,7 @@ class C { } //// [Protected9.js] +"use strict"; class C { constructor(p) { this.p = p; diff --git a/tests/baselines/reference/TemplateExpression1.js b/tests/baselines/reference/TemplateExpression1.js index ada7989792446..1a00c1cac032b 100644 --- a/tests/baselines/reference/TemplateExpression1.js +++ b/tests/baselines/reference/TemplateExpression1.js @@ -4,4 +4,5 @@ var v = `foo ${ a //// [TemplateExpression1.js] +"use strict"; var v = `foo ${a; diff --git a/tests/baselines/reference/TransportStream.js b/tests/baselines/reference/TransportStream.js index 19e4cfce936a5..9f0603e59b338 100644 --- a/tests/baselines/reference/TransportStream.js +++ b/tests/baselines/reference/TransportStream.js @@ -4,4 +4,5 @@ G@�G@�G@� //// [TransportStream.js] +"use strict"; G; diff --git a/tests/baselines/reference/TupleType1.js b/tests/baselines/reference/TupleType1.js index 8be436f2e7b6b..463740b6ccf5e 100644 --- a/tests/baselines/reference/TupleType1.js +++ b/tests/baselines/reference/TupleType1.js @@ -4,4 +4,5 @@ var v: [number] //// [TupleType1.js] +"use strict"; var v; diff --git a/tests/baselines/reference/TupleType2.js b/tests/baselines/reference/TupleType2.js index d9ef15bf84fbf..1b45ec71ffbf9 100644 --- a/tests/baselines/reference/TupleType2.js +++ b/tests/baselines/reference/TupleType2.js @@ -4,4 +4,5 @@ var v: [number, string] //// [TupleType2.js] +"use strict"; var v; diff --git a/tests/baselines/reference/TupleType3.js b/tests/baselines/reference/TupleType3.js index 19a3e3c1d7926..188e90ee0bfbf 100644 --- a/tests/baselines/reference/TupleType3.js +++ b/tests/baselines/reference/TupleType3.js @@ -4,4 +4,5 @@ var v: [] //// [TupleType3.js] +"use strict"; var v; diff --git a/tests/baselines/reference/TupleType4.js b/tests/baselines/reference/TupleType4.js index 7d71182b6b42a..b95a5c70305aa 100644 --- a/tests/baselines/reference/TupleType4.js +++ b/tests/baselines/reference/TupleType4.js @@ -4,4 +4,5 @@ var v: [ //// [TupleType4.js] +"use strict"; var v; diff --git a/tests/baselines/reference/TupleType5.js b/tests/baselines/reference/TupleType5.js index 6b8d035e2f950..c1e1edb7bba72 100644 --- a/tests/baselines/reference/TupleType5.js +++ b/tests/baselines/reference/TupleType5.js @@ -4,4 +4,5 @@ var v: [number,] //// [TupleType5.js] +"use strict"; var v; diff --git a/tests/baselines/reference/TupleType6.js b/tests/baselines/reference/TupleType6.js index 1d48701b060c0..125ec40dfc163 100644 --- a/tests/baselines/reference/TupleType6.js +++ b/tests/baselines/reference/TupleType6.js @@ -4,4 +4,5 @@ var v: [number,,] //// [TupleType6.js] +"use strict"; var v; diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.errors.txt b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.errors.txt new file mode 100644 index 0000000000000..9f0b29c48d916 --- /dev/null +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.errors.txt @@ -0,0 +1,55 @@ +TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts(3,9): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. +TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts(4,9): error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. +TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts(22,9): error TS2564: Property 'length' has no initializer and is not definitely assigned in the constructor. +TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts(30,17): error TS2564: Property 'name' has no initializer and is not definitely assigned in the constructor. + + +==== TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts (4 errors) ==== + namespace A { + export class Point { + x: number; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. + y: number; + ~ +!!! error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. + } + } + + namespace A { + class Point { + fromCarthesian(p: A.Point) { + return { x: p.x, y: p.y }; + } + } + } + + // ensure merges as expected + var p: { x: number; y: number; }; + var p: A.Point; + + namespace X.Y.Z { + export class Line { + length: number; + ~~~~~~ +!!! error TS2564: Property 'length' has no initializer and is not definitely assigned in the constructor. + } + } + + namespace X { + export namespace Y { + export namespace Z { + class Line { + name: string; + ~~~~ +!!! error TS2564: Property 'name' has no initializer and is not definitely assigned in the constructor. + } + } + } + } + + // ensure merges as expected + var l: { length: number; } + var l: X.Y.Z.Line; + + \ No newline at end of file diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.js b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.js index 1ebda368cb584..83cfac61c6b86 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.js +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.js @@ -43,6 +43,7 @@ var l: X.Y.Z.Line; //// [TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.js] +"use strict"; var A; (function (A) { class Point { diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.js b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.js index cad11bb4f3235..2c5d82481aeb8 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.js +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.js @@ -40,6 +40,7 @@ var l: X.Y.Z.Line; //// [TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.js] +"use strict"; // ensure merges as expected var p; var p; diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.js b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.js index ca5e9f124eb2a..f149847fa2f2f 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.js +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.js @@ -42,6 +42,7 @@ var p = new A.Utils.Plane(o, { x: 1, y: 1 }); //// [part1.js] +"use strict"; var A; (function (A) { let Utils; @@ -54,6 +55,7 @@ var A; A.Origin = { x: 0, y: 0 }; })(A || (A = {})); //// [part2.js] +"use strict"; var A; (function (A) { // not a collision, since we don't export @@ -70,6 +72,7 @@ var A; })(Utils = A.Utils || (A.Utils = {})); })(A || (A = {})); //// [part3.js] +"use strict"; // test the merging actually worked var o; var o; diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.errors.txt b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.errors.txt index c62c22a8b8117..d706b7cf141bd 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.errors.txt +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.errors.txt @@ -1,16 +1,26 @@ TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(2,18): error TS2300: Duplicate identifier 'Point'. +TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(3,9): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. +TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(4,9): error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(10,18): error TS2300: Duplicate identifier 'Point'. +TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(11,9): error TS2564: Property 'origin' has no initializer and is not definitely assigned in the constructor. +TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(12,9): error TS2564: Property 'angle' has no initializer and is not definitely assigned in the constructor. TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(17,18): error TS2300: Duplicate identifier 'Line'. +TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(18,9): error TS2564: Property 'length' has no initializer and is not definitely assigned in the constructor. TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(26,26): error TS2300: Duplicate identifier 'Line'. +TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(27,17): error TS2564: Property 'name' has no initializer and is not definitely assigned in the constructor. -==== TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts (4 errors) ==== +==== TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts (10 errors) ==== namespace A { export class Point { ~~~~~ !!! error TS2300: Duplicate identifier 'Point'. x: number; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. y: number; + ~ +!!! error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. } } @@ -20,7 +30,11 @@ TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(26,26): error ~~~~~ !!! error TS2300: Duplicate identifier 'Point'. origin: number; + ~~~~~~ +!!! error TS2564: Property 'origin' has no initializer and is not definitely assigned in the constructor. angle: number; + ~~~~~ +!!! error TS2564: Property 'angle' has no initializer and is not definitely assigned in the constructor. } } @@ -29,6 +43,8 @@ TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(26,26): error ~~~~ !!! error TS2300: Duplicate identifier 'Line'. length: number; + ~~~~~~ +!!! error TS2564: Property 'length' has no initializer and is not definitely assigned in the constructor. } } @@ -40,6 +56,8 @@ TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(26,26): error ~~~~ !!! error TS2300: Duplicate identifier 'Line'. name: string; + ~~~~ +!!! error TS2564: Property 'name' has no initializer and is not definitely assigned in the constructor. } } } diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.js b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.js index e99534b34e351..7d65e92624e12 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.js +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.js @@ -35,6 +35,7 @@ namespace X { //// [TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.js] +"use strict"; var A; (function (A) { class Point { diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.js b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.js index 0af0fe1881879..57e0a9cf27a67 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.js +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.js @@ -40,6 +40,7 @@ var l: X.Y.Z.Line; //// [TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.js] +"use strict"; // ensure merges as expected var p; var p; diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.errors.txt b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.errors.txt new file mode 100644 index 0000000000000..fa4e60425f7e5 --- /dev/null +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.errors.txt @@ -0,0 +1,43 @@ +TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts(17,9): error TS2564: Property 'length' has no initializer and is not definitely assigned in the constructor. +TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts(25,17): error TS2564: Property 'name' has no initializer and is not definitely assigned in the constructor. + + +==== TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts (2 errors) ==== + namespace A.B { + export var x: number; + } + + namespace A{ + namespace B { + export var x: string; + } + } + + // ensure the right var decl is exported + var x: number; + var x = A.B.x; + + namespace X.Y.Z { + export class Line { + length: number; + ~~~~~~ +!!! error TS2564: Property 'length' has no initializer and is not definitely assigned in the constructor. + } + } + + namespace X { + export namespace Y { + namespace Z { + export class Line { + name: string; + ~~~~ +!!! error TS2564: Property 'name' has no initializer and is not definitely assigned in the constructor. + } + } + } + } + + // make sure merging works as expected + var l: { length: number }; + var l: X.Y.Z.Line; + \ No newline at end of file diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.js b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.js index c804721aa5ecc..64e50a57613cb 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.js +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.js @@ -37,6 +37,7 @@ var l: X.Y.Z.Line; //// [TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.js] +"use strict"; var A; (function (A) { var B; diff --git a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.js b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.js index b5d0a4c3fa616..d270896fcd5c1 100644 --- a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.js +++ b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.js @@ -31,6 +31,7 @@ namespace otherRoot { } //// [part1.js] +"use strict"; var Root; (function (Root) { let A; @@ -45,6 +46,7 @@ var Root; })(A = Root.A || (Root.A = {})); })(Root || (Root = {})); //// [part2.js] +"use strict"; var otherRoot; (function (otherRoot) { let A; diff --git a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.js b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.js index 364e8a2e7c766..175f121ec9fdb 100644 --- a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.js +++ b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.js @@ -40,6 +40,7 @@ var p = new A.Utils.Plane(o, { x: 1, y: 1 }); //// [part1.js] +"use strict"; var A; (function (A) { let Utils; @@ -51,6 +52,7 @@ var A; })(Utils = A.Utils || (A.Utils = {})); })(A || (A = {})); //// [part2.js] +"use strict"; var A; (function (A) { A.Origin = { x: 0, y: 0 }; @@ -66,6 +68,7 @@ var A; })(Utils = A.Utils || (A.Utils = {})); })(A || (A = {})); //// [part3.js] +"use strict"; // test the merging actually worked var o; var o; diff --git a/tests/baselines/reference/TypeArgumentList1.js b/tests/baselines/reference/TypeArgumentList1.js index 3254810cd804f..61e4b0f74ae01 100644 --- a/tests/baselines/reference/TypeArgumentList1.js +++ b/tests/baselines/reference/TypeArgumentList1.js @@ -4,5 +4,6 @@ Foo(4, 5, 6); //// [TypeArgumentList1.js] +"use strict"; Foo < A, B, ; C > (4, 5, 6); diff --git a/tests/baselines/reference/TypeGuardWithArrayUnion.errors.txt b/tests/baselines/reference/TypeGuardWithArrayUnion.errors.txt new file mode 100644 index 0000000000000..4f726e6f8c34a --- /dev/null +++ b/tests/baselines/reference/TypeGuardWithArrayUnion.errors.txt @@ -0,0 +1,16 @@ +TypeGuardWithArrayUnion.ts(2,5): error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor. + + +==== TypeGuardWithArrayUnion.ts (1 errors) ==== + class Message { + value: string; + ~~~~~ +!!! error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor. + } + + function saySize(message: Message | Message[]) { + if (message instanceof Array) { + return message.length; // Should have type Message[] here + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/TypeGuardWithArrayUnion.js b/tests/baselines/reference/TypeGuardWithArrayUnion.js index fda6574e2d060..dc07bb4460c99 100644 --- a/tests/baselines/reference/TypeGuardWithArrayUnion.js +++ b/tests/baselines/reference/TypeGuardWithArrayUnion.js @@ -13,6 +13,7 @@ function saySize(message: Message | Message[]) { //// [TypeGuardWithArrayUnion.js] +"use strict"; class Message { } function saySize(message) { diff --git a/tests/baselines/reference/TypeGuardWithArrayUnion.types b/tests/baselines/reference/TypeGuardWithArrayUnion.types index 383b3398340b9..e5604a54cdae4 100644 --- a/tests/baselines/reference/TypeGuardWithArrayUnion.types +++ b/tests/baselines/reference/TypeGuardWithArrayUnion.types @@ -11,8 +11,8 @@ class Message { } function saySize(message: Message | Message[]) { ->saySize : (message: Message | Message[]) => number -> : ^ ^^ ^^^^^^^^^^^ +>saySize : (message: Message | Message[]) => number | undefined +> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^ >message : Message | Message[] > : ^^^^^^^^^^^^^^^^^^^ diff --git a/tests/baselines/reference/TypeGuardWithEnumUnion.js b/tests/baselines/reference/TypeGuardWithEnumUnion.js index 4a47a9aefcad5..5254c999dfff1 100644 --- a/tests/baselines/reference/TypeGuardWithEnumUnion.js +++ b/tests/baselines/reference/TypeGuardWithEnumUnion.js @@ -39,6 +39,7 @@ function f2(x: Color | string | string[]) { //// [TypeGuardWithEnumUnion.js] +"use strict"; var Color; (function (Color) { Color[Color["R"] = 0] = "R"; diff --git a/tests/baselines/reference/VariableDeclaration10_es6.js b/tests/baselines/reference/VariableDeclaration10_es6.js index 4aac9e2b945a5..27bfc087a6150 100644 --- a/tests/baselines/reference/VariableDeclaration10_es6.js +++ b/tests/baselines/reference/VariableDeclaration10_es6.js @@ -4,4 +4,5 @@ let a: number = 1 //// [VariableDeclaration10_es6.js] +"use strict"; let a = 1; diff --git a/tests/baselines/reference/VariableDeclaration12_es6.js b/tests/baselines/reference/VariableDeclaration12_es6.js index 98a622fe9a0e4..59f1c853ac7ae 100644 --- a/tests/baselines/reference/VariableDeclaration12_es6.js +++ b/tests/baselines/reference/VariableDeclaration12_es6.js @@ -5,4 +5,5 @@ let x //// [VariableDeclaration12_es6.js] +"use strict"; let x; diff --git a/tests/baselines/reference/VariableDeclaration13_es6.js b/tests/baselines/reference/VariableDeclaration13_es6.js index bafe314c4f55a..4fe76871492cb 100644 --- a/tests/baselines/reference/VariableDeclaration13_es6.js +++ b/tests/baselines/reference/VariableDeclaration13_es6.js @@ -7,6 +7,7 @@ var let: any; let[0] = 100; //// [VariableDeclaration13_es6.js] +"use strict"; // An ExpressionStatement cannot start with the two token sequence `let [` because // that would make it ambiguous with a `let` LexicalDeclaration whose first LexicalBinding was an ArrayBindingPattern. var let; diff --git a/tests/baselines/reference/VariableDeclaration1_es6.js b/tests/baselines/reference/VariableDeclaration1_es6.js index 753a718651913..697158257eee2 100644 --- a/tests/baselines/reference/VariableDeclaration1_es6.js +++ b/tests/baselines/reference/VariableDeclaration1_es6.js @@ -4,4 +4,5 @@ const //// [VariableDeclaration1_es6.js] +"use strict"; const ; diff --git a/tests/baselines/reference/VariableDeclaration2_es6.js b/tests/baselines/reference/VariableDeclaration2_es6.js index 8014be127dd8b..994b76542f2d9 100644 --- a/tests/baselines/reference/VariableDeclaration2_es6.js +++ b/tests/baselines/reference/VariableDeclaration2_es6.js @@ -4,4 +4,5 @@ const a //// [VariableDeclaration2_es6.js] +"use strict"; const a; diff --git a/tests/baselines/reference/VariableDeclaration3_es6.js b/tests/baselines/reference/VariableDeclaration3_es6.js index d7b0e57e8e8cd..d81660607762e 100644 --- a/tests/baselines/reference/VariableDeclaration3_es6.js +++ b/tests/baselines/reference/VariableDeclaration3_es6.js @@ -4,4 +4,5 @@ const a = 1 //// [VariableDeclaration3_es6.js] +"use strict"; const a = 1; diff --git a/tests/baselines/reference/VariableDeclaration4_es6.js b/tests/baselines/reference/VariableDeclaration4_es6.js index a14d01fda5c28..18b0c8c1a21a0 100644 --- a/tests/baselines/reference/VariableDeclaration4_es6.js +++ b/tests/baselines/reference/VariableDeclaration4_es6.js @@ -4,4 +4,5 @@ const a: number //// [VariableDeclaration4_es6.js] +"use strict"; const a; diff --git a/tests/baselines/reference/VariableDeclaration5_es6.js b/tests/baselines/reference/VariableDeclaration5_es6.js index 749f63fc508be..2ca89154c5169 100644 --- a/tests/baselines/reference/VariableDeclaration5_es6.js +++ b/tests/baselines/reference/VariableDeclaration5_es6.js @@ -4,4 +4,5 @@ const a: number = 1 //// [VariableDeclaration5_es6.js] +"use strict"; const a = 1; diff --git a/tests/baselines/reference/VariableDeclaration6_es6.errors.txt b/tests/baselines/reference/VariableDeclaration6_es6.errors.txt index a475016684007..f6d10640284d3 100644 --- a/tests/baselines/reference/VariableDeclaration6_es6.errors.txt +++ b/tests/baselines/reference/VariableDeclaration6_es6.errors.txt @@ -1,7 +1,10 @@ +VariableDeclaration6_es6.ts(1,1): error TS1212: Identifier expected. 'let' is a reserved word in strict mode. VariableDeclaration6_es6.ts(1,1): error TS2304: Cannot find name 'let'. -==== VariableDeclaration6_es6.ts (1 errors) ==== +==== VariableDeclaration6_es6.ts (2 errors) ==== let ~~~ +!!! error TS1212: Identifier expected. 'let' is a reserved word in strict mode. + ~~~ !!! error TS2304: Cannot find name 'let'. \ No newline at end of file diff --git a/tests/baselines/reference/VariableDeclaration6_es6.js b/tests/baselines/reference/VariableDeclaration6_es6.js index 05bd083e66fdd..a20cb8d2533ad 100644 --- a/tests/baselines/reference/VariableDeclaration6_es6.js +++ b/tests/baselines/reference/VariableDeclaration6_es6.js @@ -4,4 +4,5 @@ let //// [VariableDeclaration6_es6.js] +"use strict"; let; diff --git a/tests/baselines/reference/VariableDeclaration7_es6.js b/tests/baselines/reference/VariableDeclaration7_es6.js index 448c1fa5198f4..c3b14cfab7ff9 100644 --- a/tests/baselines/reference/VariableDeclaration7_es6.js +++ b/tests/baselines/reference/VariableDeclaration7_es6.js @@ -4,4 +4,5 @@ let a //// [VariableDeclaration7_es6.js] +"use strict"; let a; diff --git a/tests/baselines/reference/VariableDeclaration8_es6.js b/tests/baselines/reference/VariableDeclaration8_es6.js index 8a26a861d5db1..38c8b7572eb23 100644 --- a/tests/baselines/reference/VariableDeclaration8_es6.js +++ b/tests/baselines/reference/VariableDeclaration8_es6.js @@ -4,4 +4,5 @@ let a = 1 //// [VariableDeclaration8_es6.js] +"use strict"; let a = 1; diff --git a/tests/baselines/reference/VariableDeclaration9_es6.js b/tests/baselines/reference/VariableDeclaration9_es6.js index 1d107657c4e3e..8a6ab5b8482e9 100644 --- a/tests/baselines/reference/VariableDeclaration9_es6.js +++ b/tests/baselines/reference/VariableDeclaration9_es6.js @@ -4,4 +4,5 @@ let a: number //// [VariableDeclaration9_es6.js] +"use strict"; let a; diff --git a/tests/baselines/reference/YieldExpression10_es6.js b/tests/baselines/reference/YieldExpression10_es6.js index 0e3f21cdde8b7..0f46400e5c1c0 100644 --- a/tests/baselines/reference/YieldExpression10_es6.js +++ b/tests/baselines/reference/YieldExpression10_es6.js @@ -8,6 +8,7 @@ var v = { * foo() { //// [YieldExpression10_es6.js] +"use strict"; var v = { *foo() { yield (foo); } diff --git a/tests/baselines/reference/YieldExpression11_es6.js b/tests/baselines/reference/YieldExpression11_es6.js index 41b8f2b9be513..3736e23f93512 100644 --- a/tests/baselines/reference/YieldExpression11_es6.js +++ b/tests/baselines/reference/YieldExpression11_es6.js @@ -8,6 +8,7 @@ class C { } //// [YieldExpression11_es6.js] +"use strict"; class C { *foo() { yield (foo); diff --git a/tests/baselines/reference/YieldExpression12_es6.js b/tests/baselines/reference/YieldExpression12_es6.js index b57f72e31d5d5..2b4708957d919 100644 --- a/tests/baselines/reference/YieldExpression12_es6.js +++ b/tests/baselines/reference/YieldExpression12_es6.js @@ -8,6 +8,7 @@ class C { } //// [YieldExpression12_es6.js] +"use strict"; class C { constructor() { yield foo; diff --git a/tests/baselines/reference/YieldExpression13_es6.js b/tests/baselines/reference/YieldExpression13_es6.js index 2d31a2ea6388b..11d55624ea9e9 100644 --- a/tests/baselines/reference/YieldExpression13_es6.js +++ b/tests/baselines/reference/YieldExpression13_es6.js @@ -4,4 +4,5 @@ function* foo() { yield } //// [YieldExpression13_es6.js] +"use strict"; function* foo() { yield; } diff --git a/tests/baselines/reference/YieldExpression14_es6.js b/tests/baselines/reference/YieldExpression14_es6.js index 94f6484284d0e..103ad38ed3bd0 100644 --- a/tests/baselines/reference/YieldExpression14_es6.js +++ b/tests/baselines/reference/YieldExpression14_es6.js @@ -8,6 +8,7 @@ class C { } //// [YieldExpression14_es6.js] +"use strict"; class C { foo() { yield foo; diff --git a/tests/baselines/reference/YieldExpression15_es6.js b/tests/baselines/reference/YieldExpression15_es6.js index 52413d7326e34..182ee54bb741f 100644 --- a/tests/baselines/reference/YieldExpression15_es6.js +++ b/tests/baselines/reference/YieldExpression15_es6.js @@ -6,6 +6,7 @@ var v = () => { } //// [YieldExpression15_es6.js] +"use strict"; var v = () => { yield foo; }; diff --git a/tests/baselines/reference/YieldExpression16_es6.js b/tests/baselines/reference/YieldExpression16_es6.js index fe803ae4e0ed2..e7b33612d24d5 100644 --- a/tests/baselines/reference/YieldExpression16_es6.js +++ b/tests/baselines/reference/YieldExpression16_es6.js @@ -8,6 +8,7 @@ function* foo() { } //// [YieldExpression16_es6.js] +"use strict"; function* foo() { function bar() { yield foo; diff --git a/tests/baselines/reference/YieldExpression17_es6.js b/tests/baselines/reference/YieldExpression17_es6.js index 176bc1382b4e7..339f84e1af7ce 100644 --- a/tests/baselines/reference/YieldExpression17_es6.js +++ b/tests/baselines/reference/YieldExpression17_es6.js @@ -4,4 +4,5 @@ var v = { get foo() { yield foo; } } //// [YieldExpression17_es6.js] +"use strict"; var v = { get foo() { yield foo; } }; diff --git a/tests/baselines/reference/YieldExpression19_es6.js b/tests/baselines/reference/YieldExpression19_es6.js index f99fa292080ad..501020bef7623 100644 --- a/tests/baselines/reference/YieldExpression19_es6.js +++ b/tests/baselines/reference/YieldExpression19_es6.js @@ -10,6 +10,7 @@ function*foo() { } //// [YieldExpression19_es6.js] +"use strict"; function* foo() { function bar() { function* quux() { diff --git a/tests/baselines/reference/YieldExpression1_es6.errors.txt b/tests/baselines/reference/YieldExpression1_es6.errors.txt index 5c5cf3714b9b1..853cf1ff814f3 100644 --- a/tests/baselines/reference/YieldExpression1_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression1_es6.errors.txt @@ -1,7 +1,10 @@ +YieldExpression1_es6.ts(1,1): error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. YieldExpression1_es6.ts(1,1): error TS2304: Cannot find name 'yield'. -==== YieldExpression1_es6.ts (1 errors) ==== +==== YieldExpression1_es6.ts (2 errors) ==== yield; ~~~~~ +!!! error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. + ~~~~~ !!! error TS2304: Cannot find name 'yield'. \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression1_es6.js b/tests/baselines/reference/YieldExpression1_es6.js index b948bfaf37f84..71f2ae42e3e47 100644 --- a/tests/baselines/reference/YieldExpression1_es6.js +++ b/tests/baselines/reference/YieldExpression1_es6.js @@ -4,4 +4,5 @@ yield; //// [YieldExpression1_es6.js] +"use strict"; yield; diff --git a/tests/baselines/reference/YieldExpression20_es6.js b/tests/baselines/reference/YieldExpression20_es6.js index 05ae6a9e79140..3c46f0c49c3af 100644 --- a/tests/baselines/reference/YieldExpression20_es6.js +++ b/tests/baselines/reference/YieldExpression20_es6.js @@ -9,6 +9,7 @@ function* test() { //// [YieldExpression20_es6.js] +"use strict"; function* test() { return () => ({ b: yield 2, // error diff --git a/tests/baselines/reference/YieldExpression2_es6.js b/tests/baselines/reference/YieldExpression2_es6.js index f290601ba5c51..4345ac5d71009 100644 --- a/tests/baselines/reference/YieldExpression2_es6.js +++ b/tests/baselines/reference/YieldExpression2_es6.js @@ -4,4 +4,5 @@ yield foo; //// [YieldExpression2_es6.js] +"use strict"; yield foo; diff --git a/tests/baselines/reference/YieldExpression3_es6.js b/tests/baselines/reference/YieldExpression3_es6.js index 979cbe7b033a0..cf6c343f88e54 100644 --- a/tests/baselines/reference/YieldExpression3_es6.js +++ b/tests/baselines/reference/YieldExpression3_es6.js @@ -7,6 +7,7 @@ function* foo() { } //// [YieldExpression3_es6.js] +"use strict"; function* foo() { yield; yield; diff --git a/tests/baselines/reference/YieldExpression4_es6.js b/tests/baselines/reference/YieldExpression4_es6.js index 4703f404c526a..d48966f583681 100644 --- a/tests/baselines/reference/YieldExpression4_es6.js +++ b/tests/baselines/reference/YieldExpression4_es6.js @@ -7,6 +7,7 @@ function* foo() { } //// [YieldExpression4_es6.js] +"use strict"; function* foo() { yield; yield; diff --git a/tests/baselines/reference/YieldExpression5_es6.js b/tests/baselines/reference/YieldExpression5_es6.js index da0904ba1db45..afe5bc5a1012b 100644 --- a/tests/baselines/reference/YieldExpression5_es6.js +++ b/tests/baselines/reference/YieldExpression5_es6.js @@ -6,6 +6,7 @@ function* foo() { } //// [YieldExpression5_es6.js] +"use strict"; function* foo() { yield* ; } diff --git a/tests/baselines/reference/YieldExpression6_es6.js b/tests/baselines/reference/YieldExpression6_es6.js index 93798bb3ac4a0..e14f23fb4dc0f 100644 --- a/tests/baselines/reference/YieldExpression6_es6.js +++ b/tests/baselines/reference/YieldExpression6_es6.js @@ -6,6 +6,7 @@ function* foo() { } //// [YieldExpression6_es6.js] +"use strict"; function* foo() { yield* foo; } diff --git a/tests/baselines/reference/YieldExpression7_es6.js b/tests/baselines/reference/YieldExpression7_es6.js index d86963a134533..501cf9283770d 100644 --- a/tests/baselines/reference/YieldExpression7_es6.js +++ b/tests/baselines/reference/YieldExpression7_es6.js @@ -6,6 +6,7 @@ function* foo() { } //// [YieldExpression7_es6.js] +"use strict"; function* foo() { yield foo; } diff --git a/tests/baselines/reference/YieldExpression8_es6.errors.txt b/tests/baselines/reference/YieldExpression8_es6.errors.txt index e7db07eb354f9..f5047733b6a83 100644 --- a/tests/baselines/reference/YieldExpression8_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression8_es6.errors.txt @@ -1,9 +1,12 @@ +YieldExpression8_es6.ts(1,1): error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. YieldExpression8_es6.ts(1,1): error TS2304: Cannot find name 'yield'. -==== YieldExpression8_es6.ts (1 errors) ==== +==== YieldExpression8_es6.ts (2 errors) ==== yield(foo); ~~~~~ +!!! error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. + ~~~~~ !!! error TS2304: Cannot find name 'yield'. function* foo() { yield(foo); diff --git a/tests/baselines/reference/YieldExpression8_es6.js b/tests/baselines/reference/YieldExpression8_es6.js index eb7bf197d0c25..2847ae5d91675 100644 --- a/tests/baselines/reference/YieldExpression8_es6.js +++ b/tests/baselines/reference/YieldExpression8_es6.js @@ -7,6 +7,7 @@ function* foo() { } //// [YieldExpression8_es6.js] +"use strict"; yield(foo); function* foo() { yield (foo); diff --git a/tests/baselines/reference/YieldExpression9_es6.js b/tests/baselines/reference/YieldExpression9_es6.js index 5cd88a575f87f..3e0d129b71584 100644 --- a/tests/baselines/reference/YieldExpression9_es6.js +++ b/tests/baselines/reference/YieldExpression9_es6.js @@ -6,6 +6,7 @@ var v = function*() { } //// [YieldExpression9_es6.js] +"use strict"; var v = function* () { yield (foo); }; diff --git a/tests/baselines/reference/YieldStarExpression1_es6.errors.txt b/tests/baselines/reference/YieldStarExpression1_es6.errors.txt index e7776535f90cb..cf59d189bc301 100644 --- a/tests/baselines/reference/YieldStarExpression1_es6.errors.txt +++ b/tests/baselines/reference/YieldStarExpression1_es6.errors.txt @@ -1,10 +1,13 @@ +YieldStarExpression1_es6.ts(1,1): error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. YieldStarExpression1_es6.ts(1,1): error TS2304: Cannot find name 'yield'. YieldStarExpression1_es6.ts(1,9): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. -==== YieldStarExpression1_es6.ts (2 errors) ==== +==== YieldStarExpression1_es6.ts (3 errors) ==== yield * []; ~~~~~ +!!! error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. + ~~~~~ !!! error TS2304: Cannot find name 'yield'. ~~ !!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. \ No newline at end of file diff --git a/tests/baselines/reference/YieldStarExpression1_es6.js b/tests/baselines/reference/YieldStarExpression1_es6.js index 0c2e3356a9b6c..7a109e8e7f46f 100644 --- a/tests/baselines/reference/YieldStarExpression1_es6.js +++ b/tests/baselines/reference/YieldStarExpression1_es6.js @@ -4,4 +4,5 @@ yield * []; //// [YieldStarExpression1_es6.js] +"use strict"; yield * []; diff --git a/tests/baselines/reference/YieldStarExpression1_es6.types b/tests/baselines/reference/YieldStarExpression1_es6.types index 6dacff32e3fe3..0fc7bbe661948 100644 --- a/tests/baselines/reference/YieldStarExpression1_es6.types +++ b/tests/baselines/reference/YieldStarExpression1_es6.types @@ -6,6 +6,6 @@ yield * []; > : ^^^^^^ >yield : any > : ^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ diff --git a/tests/baselines/reference/YieldStarExpression2_es6.js b/tests/baselines/reference/YieldStarExpression2_es6.js index f33990cad45de..2ebafc3ee0ed5 100644 --- a/tests/baselines/reference/YieldStarExpression2_es6.js +++ b/tests/baselines/reference/YieldStarExpression2_es6.js @@ -4,4 +4,5 @@ yield *; //// [YieldStarExpression2_es6.js] +"use strict"; yield * ; diff --git a/tests/baselines/reference/YieldStarExpression3_es6.js b/tests/baselines/reference/YieldStarExpression3_es6.js index 66bde1547ff76..edac58e7d24d2 100644 --- a/tests/baselines/reference/YieldStarExpression3_es6.js +++ b/tests/baselines/reference/YieldStarExpression3_es6.js @@ -6,6 +6,7 @@ function *g() { } //// [YieldStarExpression3_es6.js] +"use strict"; function* g() { yield* ; } diff --git a/tests/baselines/reference/YieldStarExpression4_es6.js b/tests/baselines/reference/YieldStarExpression4_es6.js index 7e743965459d6..ad435152e01a6 100644 --- a/tests/baselines/reference/YieldStarExpression4_es6.js +++ b/tests/baselines/reference/YieldStarExpression4_es6.js @@ -6,6 +6,7 @@ function *g() { } //// [YieldStarExpression4_es6.js] +"use strict"; function* g() { yield* []; } diff --git a/tests/baselines/reference/abstractClassInLocalScope.js b/tests/baselines/reference/abstractClassInLocalScope.js index 67990f045fd7c..f601769a9fb7c 100644 --- a/tests/baselines/reference/abstractClassInLocalScope.js +++ b/tests/baselines/reference/abstractClassInLocalScope.js @@ -10,6 +10,7 @@ //// [abstractClassInLocalScope.js] +"use strict"; (() => { class A { } diff --git a/tests/baselines/reference/abstractClassInLocalScopeIsAbstract.js b/tests/baselines/reference/abstractClassInLocalScopeIsAbstract.js index 1b0c13d877935..22205acaec793 100644 --- a/tests/baselines/reference/abstractClassInLocalScopeIsAbstract.js +++ b/tests/baselines/reference/abstractClassInLocalScopeIsAbstract.js @@ -10,6 +10,7 @@ //// [abstractClassInLocalScopeIsAbstract.js] +"use strict"; (() => { class A { } diff --git a/tests/baselines/reference/abstractClassUnionInstantiation.errors.txt b/tests/baselines/reference/abstractClassUnionInstantiation.errors.txt index 5446841f97c33..2a8da2952e4fc 100644 --- a/tests/baselines/reference/abstractClassUnionInstantiation.errors.txt +++ b/tests/baselines/reference/abstractClassUnionInstantiation.errors.txt @@ -1,3 +1,5 @@ +abstractClassUnionInstantiation.ts(3,28): error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. +abstractClassUnionInstantiation.ts(4,28): error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. abstractClassUnionInstantiation.ts(14,1): error TS2511: Cannot create an instance of an abstract class. abstractClassUnionInstantiation.ts(15,1): error TS2511: Cannot create an instance of an abstract class. abstractClassUnionInstantiation.ts(18,46): error TS2511: Cannot create an instance of an abstract class. @@ -5,11 +7,15 @@ abstractClassUnionInstantiation.ts(19,46): error TS2511: Cannot create an instan abstractClassUnionInstantiation.ts(21,35): error TS2511: Cannot create an instance of an abstract class. -==== abstractClassUnionInstantiation.ts (5 errors) ==== +==== abstractClassUnionInstantiation.ts (7 errors) ==== class ConcreteA {} class ConcreteB {} abstract class AbstractA { a: string; } + ~ +!!! error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. abstract class AbstractB { b: string; } + ~ +!!! error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. type Abstracts = typeof AbstractA | typeof AbstractB; type Concretes = typeof ConcreteA | typeof ConcreteB; diff --git a/tests/baselines/reference/abstractClassUnionInstantiation.js b/tests/baselines/reference/abstractClassUnionInstantiation.js index daef675355adc..fe4338e63f7eb 100644 --- a/tests/baselines/reference/abstractClassUnionInstantiation.js +++ b/tests/baselines/reference/abstractClassUnionInstantiation.js @@ -24,6 +24,7 @@ new cls3(); // should work [AbstractA, AbstractB].map(cls => new cls()); // should error //// [abstractClassUnionInstantiation.js] +"use strict"; class ConcreteA { } class ConcreteB { diff --git a/tests/baselines/reference/abstractIdentifierNameStrict.js b/tests/baselines/reference/abstractIdentifierNameStrict.js index 9af7284f07cc4..1cca86105a028 100644 --- a/tests/baselines/reference/abstractIdentifierNameStrict.js +++ b/tests/baselines/reference/abstractIdentifierNameStrict.js @@ -9,6 +9,7 @@ function foo() { } //// [abstractIdentifierNameStrict.js] +"use strict"; var abstract = true; function foo() { "use strict"; diff --git a/tests/baselines/reference/abstractInterfaceIdentifierName.js b/tests/baselines/reference/abstractInterfaceIdentifierName.js index 2e092cf4b28c2..598e39c629e5d 100644 --- a/tests/baselines/reference/abstractInterfaceIdentifierName.js +++ b/tests/baselines/reference/abstractInterfaceIdentifierName.js @@ -7,3 +7,4 @@ interface abstract { //// [abstractInterfaceIdentifierName.js] +"use strict"; diff --git a/tests/baselines/reference/abstractProperty(target=es2015).js b/tests/baselines/reference/abstractProperty(target=es2015).js index 5d6ccd7959384..1e4e9eb1d8d9d 100644 --- a/tests/baselines/reference/abstractProperty(target=es2015).js +++ b/tests/baselines/reference/abstractProperty(target=es2015).js @@ -18,6 +18,7 @@ class C extends A { //// [abstractProperty.js] +"use strict"; class A { foo() { console.log(this.x); diff --git a/tests/baselines/reference/abstractProperty(target=esnext).js b/tests/baselines/reference/abstractProperty(target=esnext).js index 1d6a28b40d9ff..3ecf9650df638 100644 --- a/tests/baselines/reference/abstractProperty(target=esnext).js +++ b/tests/baselines/reference/abstractProperty(target=esnext).js @@ -18,6 +18,7 @@ class C extends A { //// [abstractProperty.js] +"use strict"; class A { foo() { console.log(this.x); diff --git a/tests/baselines/reference/abstractPropertyBasics(target=es2015).js b/tests/baselines/reference/abstractPropertyBasics(target=es2015).js index dbc3fa5095331..7cf0d23c8f203 100644 --- a/tests/baselines/reference/abstractPropertyBasics(target=es2015).js +++ b/tests/baselines/reference/abstractPropertyBasics(target=es2015).js @@ -24,6 +24,7 @@ class C extends B { } //// [abstractPropertyBasics.js] +"use strict"; class B { } class C extends B { diff --git a/tests/baselines/reference/abstractPropertyBasics(target=es5).js b/tests/baselines/reference/abstractPropertyBasics(target=es5).js index c20a295242ff3..735b9ab0461d8 100644 --- a/tests/baselines/reference/abstractPropertyBasics(target=es5).js +++ b/tests/baselines/reference/abstractPropertyBasics(target=es5).js @@ -24,6 +24,7 @@ class C extends B { } //// [abstractPropertyBasics.js] +"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || diff --git a/tests/baselines/reference/abstractPropertyInConstructor.errors.txt b/tests/baselines/reference/abstractPropertyInConstructor.errors.txt index a6ea82afdd03a..08eb4bacffefb 100644 --- a/tests/baselines/reference/abstractPropertyInConstructor.errors.txt +++ b/tests/baselines/reference/abstractPropertyInConstructor.errors.txt @@ -9,9 +9,11 @@ abstractPropertyInConstructor.ts(78,18): error TS2715: Abstract property 'y' in abstractPropertyInConstructor.ts(79,12): error TS2715: Abstract property 'x' in class 'C1' cannot be accessed in the constructor. abstractPropertyInConstructor.ts(79,15): error TS2715: Abstract property 'y' in class 'C1' cannot be accessed in the constructor. abstractPropertyInConstructor.ts(79,22): error TS2715: Abstract property 'y' in class 'C1' cannot be accessed in the constructor. +abstractPropertyInConstructor.ts(84,5): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. +abstractPropertyInConstructor.ts(85,5): error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. -==== abstractPropertyInConstructor.ts (11 errors) ==== +==== abstractPropertyInConstructor.ts (13 errors) ==== abstract class AbstractClass { constructor(str: string, other: AbstractClass) { this.method(parseInt(str)); @@ -119,7 +121,11 @@ abstractPropertyInConstructor.ts(79,22): error TS2715: Abstract property 'y' in class C2 { x: string; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. y: string; + ~ +!!! error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. constructor() { let self = this; // ok diff --git a/tests/baselines/reference/abstractPropertyInConstructor.js b/tests/baselines/reference/abstractPropertyInConstructor.js index a237aad964662..5f84fd5b82285 100644 --- a/tests/baselines/reference/abstractPropertyInConstructor.js +++ b/tests/baselines/reference/abstractPropertyInConstructor.js @@ -96,6 +96,7 @@ class C2 { //// [abstractPropertyInConstructor.js] +"use strict"; class AbstractClass { constructor(str, other) { this.other = this.prop; diff --git a/tests/baselines/reference/abstractPropertyNegative(target=es2015).js b/tests/baselines/reference/abstractPropertyNegative(target=es2015).js index 6d8a2c7bd37a2..0cc55210c5ef4 100644 --- a/tests/baselines/reference/abstractPropertyNegative(target=es2015).js +++ b/tests/baselines/reference/abstractPropertyNegative(target=es2015).js @@ -46,6 +46,7 @@ abstract class AbstractAccessorMismatch { //// [abstractPropertyNegative.js] +"use strict"; class B { } class C extends B { diff --git a/tests/baselines/reference/abstractPropertyNegative(target=es5).js b/tests/baselines/reference/abstractPropertyNegative(target=es5).js index 193fd8e5a2001..f8b0b7c3743fa 100644 --- a/tests/baselines/reference/abstractPropertyNegative(target=es5).js +++ b/tests/baselines/reference/abstractPropertyNegative(target=es5).js @@ -46,6 +46,7 @@ abstract class AbstractAccessorMismatch { //// [abstractPropertyNegative.js] +"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || diff --git a/tests/baselines/reference/acceptableAlias1.js b/tests/baselines/reference/acceptableAlias1.js index b360c5c3bb572..0904f10623dc6 100644 --- a/tests/baselines/reference/acceptableAlias1.js +++ b/tests/baselines/reference/acceptableAlias1.js @@ -10,6 +10,7 @@ namespace M { import r = M.X; //// [acceptableAlias1.js] +"use strict"; var M; (function (M) { })(M || (M = {})); diff --git a/tests/baselines/reference/accessInstanceMemberFromStaticMethod01.js b/tests/baselines/reference/accessInstanceMemberFromStaticMethod01.js index e881500e64486..3d0dcebfcb66c 100644 --- a/tests/baselines/reference/accessInstanceMemberFromStaticMethod01.js +++ b/tests/baselines/reference/accessInstanceMemberFromStaticMethod01.js @@ -10,6 +10,7 @@ class C { } //// [accessInstanceMemberFromStaticMethod01.js] +"use strict"; class C { bar() { let k = foo; diff --git a/tests/baselines/reference/accessOverriddenBaseClassMember1.js b/tests/baselines/reference/accessOverriddenBaseClassMember1.js index df054ac23c535..5f60958fc59b6 100644 --- a/tests/baselines/reference/accessOverriddenBaseClassMember1.js +++ b/tests/baselines/reference/accessOverriddenBaseClassMember1.js @@ -18,6 +18,7 @@ class ColoredPoint extends Point { //// [accessOverriddenBaseClassMember1.js] +"use strict"; class Point { constructor(x, y) { this.x = x; diff --git a/tests/baselines/reference/accessStaticMemberFromInstanceMethod01.errors.txt b/tests/baselines/reference/accessStaticMemberFromInstanceMethod01.errors.txt index 029ebb55f871b..c18ba1ee66a33 100644 --- a/tests/baselines/reference/accessStaticMemberFromInstanceMethod01.errors.txt +++ b/tests/baselines/reference/accessStaticMemberFromInstanceMethod01.errors.txt @@ -1,9 +1,12 @@ +accessStaticMemberFromInstanceMethod01.ts(2,5): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. accessStaticMemberFromInstanceMethod01.ts(5,17): error TS2304: Cannot find name 'foo'. -==== accessStaticMemberFromInstanceMethod01.ts (1 errors) ==== +==== accessStaticMemberFromInstanceMethod01.ts (2 errors) ==== class C { foo: string; + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. static bar() { let k = foo; diff --git a/tests/baselines/reference/accessStaticMemberFromInstanceMethod01.js b/tests/baselines/reference/accessStaticMemberFromInstanceMethod01.js index de8e397a95c4b..9bfbbae375dd3 100644 --- a/tests/baselines/reference/accessStaticMemberFromInstanceMethod01.js +++ b/tests/baselines/reference/accessStaticMemberFromInstanceMethod01.js @@ -10,6 +10,7 @@ class C { } //// [accessStaticMemberFromInstanceMethod01.js] +"use strict"; class C { static bar() { let k = foo; diff --git a/tests/baselines/reference/accessibilityModifiers(target=es2015).js b/tests/baselines/reference/accessibilityModifiers(target=es2015).js index 04c572ea4e276..8320ca4e78621 100644 --- a/tests/baselines/reference/accessibilityModifiers(target=es2015).js +++ b/tests/baselines/reference/accessibilityModifiers(target=es2015).js @@ -47,6 +47,7 @@ class E { //// [accessibilityModifiers.js] +"use strict"; // No errors class C { static privateMethod() { } diff --git a/tests/baselines/reference/accessibilityModifiers(target=es5).js b/tests/baselines/reference/accessibilityModifiers(target=es5).js index 306717824e1b4..cae8a79337a4f 100644 --- a/tests/baselines/reference/accessibilityModifiers(target=es5).js +++ b/tests/baselines/reference/accessibilityModifiers(target=es5).js @@ -47,6 +47,7 @@ class E { //// [accessibilityModifiers.js] +"use strict"; // No errors var C = /** @class */ (function () { function C() { diff --git a/tests/baselines/reference/accessorAccidentalCallDiagnostic(target=es2015).js b/tests/baselines/reference/accessorAccidentalCallDiagnostic(target=es2015).js index 9f923f5ab20db..9b10162002de3 100644 --- a/tests/baselines/reference/accessorAccidentalCallDiagnostic(target=es2015).js +++ b/tests/baselines/reference/accessorAccidentalCallDiagnostic(target=es2015).js @@ -11,6 +11,7 @@ function test24554(x: Test24554) { //// [accessorAccidentalCallDiagnostic.js] +"use strict"; // https://github.com/microsoft/TypeScript/issues/24554 class Test24554 { get property() { return 1; } diff --git a/tests/baselines/reference/accessorAccidentalCallDiagnostic(target=es5).js b/tests/baselines/reference/accessorAccidentalCallDiagnostic(target=es5).js index a808e4bf767e6..03b8be874f2d3 100644 --- a/tests/baselines/reference/accessorAccidentalCallDiagnostic(target=es5).js +++ b/tests/baselines/reference/accessorAccidentalCallDiagnostic(target=es5).js @@ -11,6 +11,7 @@ function test24554(x: Test24554) { //// [accessorAccidentalCallDiagnostic.js] +"use strict"; // https://github.com/microsoft/TypeScript/issues/24554 var Test24554 = /** @class */ (function () { function Test24554() { diff --git a/tests/baselines/reference/accessorBodyInTypeContext.js b/tests/baselines/reference/accessorBodyInTypeContext.js index d2bcee2a086ce..2197d0ad34268 100644 --- a/tests/baselines/reference/accessorBodyInTypeContext.js +++ b/tests/baselines/reference/accessorBodyInTypeContext.js @@ -20,3 +20,4 @@ interface Y { //// [accessorBodyInTypeContext.js] +"use strict"; diff --git a/tests/baselines/reference/accessorDeclarationOrder.errors.txt b/tests/baselines/reference/accessorDeclarationOrder.errors.txt new file mode 100644 index 0000000000000..5ad6314b2af5e --- /dev/null +++ b/tests/baselines/reference/accessorDeclarationOrder.errors.txt @@ -0,0 +1,43 @@ +accessorDeclarationOrder.ts(2,5): error TS2564: Property '#name' has no initializer and is not definitely assigned in the constructor. +accessorDeclarationOrder.ts(14,5): error TS2564: Property '#name' has no initializer and is not definitely assigned in the constructor. + + +==== accessorDeclarationOrder.ts (2 errors) ==== + class C1 { + #name: string; + ~~~~~ +!!! error TS2564: Property '#name' has no initializer and is not definitely assigned in the constructor. + + public get name() { + return this.#name; + } + + private set name(name: string) { + this.#name = name; + } + } + + class C2 { + #name: string; + ~~~~~ +!!! error TS2564: Property '#name' has no initializer and is not definitely assigned in the constructor. + + private set name(name: string) { + this.#name = name; + } + + public get name() { + return this.#name; + } + } + + const c1 = new C1(); + const c2 = new C2(); + + + // no error + c1.name; + + // no error + c2.name; + \ No newline at end of file diff --git a/tests/baselines/reference/accessorDeclarationOrder.js b/tests/baselines/reference/accessorDeclarationOrder.js index 5fc9a7e71bd38..a9f427fc8e124 100644 --- a/tests/baselines/reference/accessorDeclarationOrder.js +++ b/tests/baselines/reference/accessorDeclarationOrder.js @@ -37,6 +37,7 @@ c2.name; //// [accessorDeclarationOrder.js] +"use strict"; class C1 { #name; get name() { diff --git a/tests/baselines/reference/accessorInAmbientContextES5(target=es2015).errors.txt b/tests/baselines/reference/accessorInAmbientContextES5(target=es2015).errors.txt new file mode 100644 index 0000000000000..cb255666e1508 --- /dev/null +++ b/tests/baselines/reference/accessorInAmbientContextES5(target=es2015).errors.txt @@ -0,0 +1,32 @@ +accessorInAmbientContextES5.ts(25,14): error TS2564: Property 'shouldError' has no initializer and is not definitely assigned in the constructor. + + +==== accessorInAmbientContextES5.ts (1 errors) ==== + // Should allow accessor in ambient contexts even when targeting ES5 + + declare class AmbientClass { + accessor prop1: string; + static accessor prop2: number; + private accessor prop3: boolean; + private static accessor prop4: symbol; + } + + declare namespace AmbientNamespace { + class C { + accessor prop: string; + } + } + + // Should also work in .d.ts files (simulated with declare) + declare module "some-module" { + export class ExportedClass { + accessor value: any; + } + } + + // Regular class should still error when targeting ES5 + class RegularClass { + accessor shouldError: string; // Should still error + ~~~~~~~~~~~ +!!! error TS2564: Property 'shouldError' has no initializer and is not definitely assigned in the constructor. + } \ No newline at end of file diff --git a/tests/baselines/reference/accessorInAmbientContextES5(target=es2015).js b/tests/baselines/reference/accessorInAmbientContextES5(target=es2015).js index dac427e6df2ad..e3cf8bbd33a02 100644 --- a/tests/baselines/reference/accessorInAmbientContextES5(target=es2015).js +++ b/tests/baselines/reference/accessorInAmbientContextES5(target=es2015).js @@ -29,6 +29,7 @@ class RegularClass { } //// [accessorInAmbientContextES5.js] +"use strict"; // Should allow accessor in ambient contexts even when targeting ES5 var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); diff --git a/tests/baselines/reference/accessorInAmbientContextES5(target=es2015).types b/tests/baselines/reference/accessorInAmbientContextES5(target=es2015).types index a1519de527550..eefedf0cf1306 100644 --- a/tests/baselines/reference/accessorInAmbientContextES5(target=es2015).types +++ b/tests/baselines/reference/accessorInAmbientContextES5(target=es2015).types @@ -49,6 +49,7 @@ declare module "some-module" { accessor value: any; >value : any +> : ^^^ } } diff --git a/tests/baselines/reference/accessorInAmbientContextES5(target=es5).errors.txt b/tests/baselines/reference/accessorInAmbientContextES5(target=es5).errors.txt index 01f4594204cd3..814c3de435340 100644 --- a/tests/baselines/reference/accessorInAmbientContextES5(target=es5).errors.txt +++ b/tests/baselines/reference/accessorInAmbientContextES5(target=es5).errors.txt @@ -1,9 +1,10 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +accessorInAmbientContextES5.ts(25,14): error TS2564: Property 'shouldError' has no initializer and is not definitely assigned in the constructor. accessorInAmbientContextES5.ts(25,14): error TS18045: Properties with the 'accessor' modifier are only available when targeting ECMAScript 2015 and higher. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== accessorInAmbientContextES5.ts (1 errors) ==== +==== accessorInAmbientContextES5.ts (2 errors) ==== // Should allow accessor in ambient contexts even when targeting ES5 declare class AmbientClass { @@ -30,5 +31,7 @@ accessorInAmbientContextES5.ts(25,14): error TS18045: Properties with the 'acces class RegularClass { accessor shouldError: string; // Should still error ~~~~~~~~~~~ +!!! error TS2564: Property 'shouldError' has no initializer and is not definitely assigned in the constructor. + ~~~~~~~~~~~ !!! error TS18045: Properties with the 'accessor' modifier are only available when targeting ECMAScript 2015 and higher. } \ No newline at end of file diff --git a/tests/baselines/reference/accessorInAmbientContextES5(target=es5).js b/tests/baselines/reference/accessorInAmbientContextES5(target=es5).js index caea4933da878..356e94690cfd9 100644 --- a/tests/baselines/reference/accessorInAmbientContextES5(target=es5).js +++ b/tests/baselines/reference/accessorInAmbientContextES5(target=es5).js @@ -29,6 +29,7 @@ class RegularClass { } //// [accessorInAmbientContextES5.js] +"use strict"; // Should allow accessor in ambient contexts even when targeting ES5 var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); diff --git a/tests/baselines/reference/accessorParameterAccessibilityModifier(target=es2015).js b/tests/baselines/reference/accessorParameterAccessibilityModifier(target=es2015).js index e930a48da4dae..4796505f4ac53 100644 --- a/tests/baselines/reference/accessorParameterAccessibilityModifier(target=es2015).js +++ b/tests/baselines/reference/accessorParameterAccessibilityModifier(target=es2015).js @@ -7,6 +7,7 @@ class C { } //// [accessorParameterAccessibilityModifier.js] +"use strict"; class C { set X(v) { } static set X(v2) { } diff --git a/tests/baselines/reference/accessorParameterAccessibilityModifier(target=es5).js b/tests/baselines/reference/accessorParameterAccessibilityModifier(target=es5).js index c0cf7eb7c9eb0..f87eebeb6e8fc 100644 --- a/tests/baselines/reference/accessorParameterAccessibilityModifier(target=es5).js +++ b/tests/baselines/reference/accessorParameterAccessibilityModifier(target=es5).js @@ -7,6 +7,7 @@ class C { } //// [accessorParameterAccessibilityModifier.js] +"use strict"; var C = /** @class */ (function () { function C() { } diff --git a/tests/baselines/reference/accessorWithES5(target=es2015).js b/tests/baselines/reference/accessorWithES5(target=es2015).js index 6a4a1f425a403..f2dfac11e00ca 100644 --- a/tests/baselines/reference/accessorWithES5(target=es2015).js +++ b/tests/baselines/reference/accessorWithES5(target=es2015).js @@ -21,6 +21,7 @@ var y = { } //// [accessorWithES5.js] +"use strict"; class C { get x() { return 1; diff --git a/tests/baselines/reference/accessorWithES5(target=es5).js b/tests/baselines/reference/accessorWithES5(target=es5).js index 19d5409b7f1b9..5f037856ad487 100644 --- a/tests/baselines/reference/accessorWithES5(target=es5).js +++ b/tests/baselines/reference/accessorWithES5(target=es5).js @@ -21,6 +21,7 @@ var y = { } //// [accessorWithES5.js] +"use strict"; var C = /** @class */ (function () { function C() { } diff --git a/tests/baselines/reference/accessorWithInitializer(target=es2015).js b/tests/baselines/reference/accessorWithInitializer(target=es2015).js index db9477e948950..0341d24656c16 100644 --- a/tests/baselines/reference/accessorWithInitializer(target=es2015).js +++ b/tests/baselines/reference/accessorWithInitializer(target=es2015).js @@ -7,6 +7,7 @@ class C { } //// [accessorWithInitializer.js] +"use strict"; class C { set X(v = 0) { } static set X(v2 = 0) { } diff --git a/tests/baselines/reference/accessorWithInitializer(target=es5).js b/tests/baselines/reference/accessorWithInitializer(target=es5).js index d70cbd6828395..4d55352be22cc 100644 --- a/tests/baselines/reference/accessorWithInitializer(target=es5).js +++ b/tests/baselines/reference/accessorWithInitializer(target=es5).js @@ -7,6 +7,7 @@ class C { } //// [accessorWithInitializer.js] +"use strict"; var C = /** @class */ (function () { function C() { } diff --git a/tests/baselines/reference/accessorWithLineTerminator(target=es2015).js b/tests/baselines/reference/accessorWithLineTerminator(target=es2015).js index 632c5ac17d7cc..02ab53138e609 100644 --- a/tests/baselines/reference/accessorWithLineTerminator(target=es2015).js +++ b/tests/baselines/reference/accessorWithLineTerminator(target=es2015).js @@ -10,6 +10,7 @@ class C { } //// [accessorWithLineTerminator.js] +"use strict"; class C { get x() { return 1; } set x(v) { } diff --git a/tests/baselines/reference/accessorWithLineTerminator(target=es5).js b/tests/baselines/reference/accessorWithLineTerminator(target=es5).js index 4d7b3fe8d0535..2a0ced9254f23 100644 --- a/tests/baselines/reference/accessorWithLineTerminator(target=es5).js +++ b/tests/baselines/reference/accessorWithLineTerminator(target=es5).js @@ -10,6 +10,7 @@ class C { } //// [accessorWithLineTerminator.js] +"use strict"; var C = /** @class */ (function () { function C() { } diff --git a/tests/baselines/reference/accessorWithMismatchedAccessibilityModifiers(target=es2015).js b/tests/baselines/reference/accessorWithMismatchedAccessibilityModifiers(target=es2015).js index de837ed885091..b3f21e69e92e3 100644 --- a/tests/baselines/reference/accessorWithMismatchedAccessibilityModifiers(target=es2015).js +++ b/tests/baselines/reference/accessorWithMismatchedAccessibilityModifiers(target=es2015).js @@ -34,6 +34,7 @@ class F { } //// [accessorWithMismatchedAccessibilityModifiers.js] +"use strict"; class C { get x() { return 1; diff --git a/tests/baselines/reference/accessorWithMismatchedAccessibilityModifiers(target=es5).js b/tests/baselines/reference/accessorWithMismatchedAccessibilityModifiers(target=es5).js index 5f608fdaafe9a..017f87fcf4712 100644 --- a/tests/baselines/reference/accessorWithMismatchedAccessibilityModifiers(target=es5).js +++ b/tests/baselines/reference/accessorWithMismatchedAccessibilityModifiers(target=es5).js @@ -34,6 +34,7 @@ class F { } //// [accessorWithMismatchedAccessibilityModifiers.js] +"use strict"; var C = /** @class */ (function () { function C() { } diff --git a/tests/baselines/reference/accessorWithRestParam(target=es2015).js b/tests/baselines/reference/accessorWithRestParam(target=es2015).js index 894e8420ad1da..1f91fbae1afa5 100644 --- a/tests/baselines/reference/accessorWithRestParam(target=es2015).js +++ b/tests/baselines/reference/accessorWithRestParam(target=es2015).js @@ -7,6 +7,7 @@ class C { } //// [accessorWithRestParam.js] +"use strict"; class C { set X(...v) { } static set X(...v2) { } diff --git a/tests/baselines/reference/accessorWithRestParam(target=es5).js b/tests/baselines/reference/accessorWithRestParam(target=es5).js index 1713b6e0ad354..ec2daf41e279f 100644 --- a/tests/baselines/reference/accessorWithRestParam(target=es5).js +++ b/tests/baselines/reference/accessorWithRestParam(target=es5).js @@ -7,6 +7,7 @@ class C { } //// [accessorWithRestParam.js] +"use strict"; var C = /** @class */ (function () { function C() { } diff --git a/tests/baselines/reference/accessorWithoutBody1(target=es2015).js b/tests/baselines/reference/accessorWithoutBody1(target=es2015).js index 930cd3e6559b3..462c607fa5645 100644 --- a/tests/baselines/reference/accessorWithoutBody1(target=es2015).js +++ b/tests/baselines/reference/accessorWithoutBody1(target=es2015).js @@ -4,4 +4,5 @@ var v = { get foo() } //// [accessorWithoutBody1.js] +"use strict"; var v = { get foo() { } }; diff --git a/tests/baselines/reference/accessorWithoutBody1(target=es5).js b/tests/baselines/reference/accessorWithoutBody1(target=es5).js index 930cd3e6559b3..462c607fa5645 100644 --- a/tests/baselines/reference/accessorWithoutBody1(target=es5).js +++ b/tests/baselines/reference/accessorWithoutBody1(target=es5).js @@ -4,4 +4,5 @@ var v = { get foo() } //// [accessorWithoutBody1.js] +"use strict"; var v = { get foo() { } }; diff --git a/tests/baselines/reference/accessorWithoutBody2(target=es2015).js b/tests/baselines/reference/accessorWithoutBody2(target=es2015).js index 39a3bfd02dd40..7bdb67b3c572b 100644 --- a/tests/baselines/reference/accessorWithoutBody2(target=es2015).js +++ b/tests/baselines/reference/accessorWithoutBody2(target=es2015).js @@ -4,4 +4,5 @@ var v = { set foo(a) } //// [accessorWithoutBody2.js] +"use strict"; var v = { set foo(a) { } }; diff --git a/tests/baselines/reference/accessorWithoutBody2(target=es5).js b/tests/baselines/reference/accessorWithoutBody2(target=es5).js index 39a3bfd02dd40..7bdb67b3c572b 100644 --- a/tests/baselines/reference/accessorWithoutBody2(target=es5).js +++ b/tests/baselines/reference/accessorWithoutBody2(target=es5).js @@ -4,4 +4,5 @@ var v = { set foo(a) } //// [accessorWithoutBody2.js] +"use strict"; var v = { set foo(a) { } }; diff --git a/tests/baselines/reference/accessorsAreNotContextuallyTyped.errors.txt b/tests/baselines/reference/accessorsAreNotContextuallyTyped.errors.txt new file mode 100644 index 0000000000000..6e56eead8d7e7 --- /dev/null +++ b/tests/baselines/reference/accessorsAreNotContextuallyTyped.errors.txt @@ -0,0 +1,19 @@ +accessorsAreNotContextuallyTyped.ts(13,9): error TS2454: Variable 'c' is used before being assigned. + + +==== accessorsAreNotContextuallyTyped.ts (1 errors) ==== + // accessors are not contextually typed + + class C { + set x(v: (a: string) => string) { + } + + get x() { + return (x: string) => ""; + } + } + + var c: C; + var r = c.x(''); // string + ~ +!!! error TS2454: Variable 'c' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/accessorsAreNotContextuallyTyped.js b/tests/baselines/reference/accessorsAreNotContextuallyTyped.js index 9ec976eb0a6f4..7d97b9412029a 100644 --- a/tests/baselines/reference/accessorsAreNotContextuallyTyped.js +++ b/tests/baselines/reference/accessorsAreNotContextuallyTyped.js @@ -16,6 +16,7 @@ var c: C; var r = c.x(''); // string //// [accessorsAreNotContextuallyTyped.js] +"use strict"; // accessors are not contextually typed class C { set x(v) { diff --git a/tests/baselines/reference/accessorsEmit.js b/tests/baselines/reference/accessorsEmit.js index 6b3a7b0443ff1..b080b23d7afd9 100644 --- a/tests/baselines/reference/accessorsEmit.js +++ b/tests/baselines/reference/accessorsEmit.js @@ -18,6 +18,7 @@ class Test2 { } //// [accessorsEmit.js] +"use strict"; class Result { } class Test { diff --git a/tests/baselines/reference/accessorsInAmbientContext(target=es2015).js b/tests/baselines/reference/accessorsInAmbientContext(target=es2015).js index 73122973c5b3c..189b4f1a9412a 100644 --- a/tests/baselines/reference/accessorsInAmbientContext(target=es2015).js +++ b/tests/baselines/reference/accessorsInAmbientContext(target=es2015).js @@ -20,3 +20,4 @@ declare class C { } //// [accessorsInAmbientContext.js] +"use strict"; diff --git a/tests/baselines/reference/accessorsInAmbientContext(target=es5).js b/tests/baselines/reference/accessorsInAmbientContext(target=es5).js index 73122973c5b3c..189b4f1a9412a 100644 --- a/tests/baselines/reference/accessorsInAmbientContext(target=es5).js +++ b/tests/baselines/reference/accessorsInAmbientContext(target=es5).js @@ -20,3 +20,4 @@ declare class C { } //// [accessorsInAmbientContext.js] +"use strict"; diff --git a/tests/baselines/reference/accessorsOverrideMethod.js b/tests/baselines/reference/accessorsOverrideMethod.js index aebe8002d54ba..a352e4381f022 100644 --- a/tests/baselines/reference/accessorsOverrideMethod.js +++ b/tests/baselines/reference/accessorsOverrideMethod.js @@ -10,6 +10,7 @@ class B extends A { //// [accessorsOverrideMethod.js] +"use strict"; class A { m() { } } diff --git a/tests/baselines/reference/accessorsOverrideProperty.js b/tests/baselines/reference/accessorsOverrideProperty.js index fc81501712031..b5a17feb42895 100644 --- a/tests/baselines/reference/accessorsOverrideProperty.js +++ b/tests/baselines/reference/accessorsOverrideProperty.js @@ -18,6 +18,7 @@ class D extends C { //// [accessorsOverrideProperty.js] +"use strict"; class A { p = 'yep'; } diff --git a/tests/baselines/reference/accessorsOverrideProperty2.js b/tests/baselines/reference/accessorsOverrideProperty2.js index 39bad9d894e37..3b7a27b5e17f5 100644 --- a/tests/baselines/reference/accessorsOverrideProperty2.js +++ b/tests/baselines/reference/accessorsOverrideProperty2.js @@ -15,6 +15,7 @@ console.log(obj.x); // number //// [accessorsOverrideProperty2.js] +"use strict"; class Base { x = 1; } diff --git a/tests/baselines/reference/accessorsOverrideProperty3.js b/tests/baselines/reference/accessorsOverrideProperty3.js index f030e47d5a784..9240062059b68 100644 --- a/tests/baselines/reference/accessorsOverrideProperty3.js +++ b/tests/baselines/reference/accessorsOverrideProperty3.js @@ -12,6 +12,7 @@ class Lion extends Animal { //// [accessorsOverrideProperty3.js] +"use strict"; class Lion extends Animal { _sound = 'grrr'; get sound() { return this._sound; } // error here diff --git a/tests/baselines/reference/accessorsOverrideProperty4.js b/tests/baselines/reference/accessorsOverrideProperty4.js index 3b3f273685b63..d1fc34dc866ca 100644 --- a/tests/baselines/reference/accessorsOverrideProperty4.js +++ b/tests/baselines/reference/accessorsOverrideProperty4.js @@ -12,6 +12,7 @@ class Lion extends Animal { //// [accessorsOverrideProperty4.js] +"use strict"; class Lion extends Animal { _sound = 'roar'; get sound() { return this._sound; } diff --git a/tests/baselines/reference/accessorsOverrideProperty5.js b/tests/baselines/reference/accessorsOverrideProperty5.js index 6f6af3a404449..e2745e480e26b 100644 --- a/tests/baselines/reference/accessorsOverrideProperty5.js +++ b/tests/baselines/reference/accessorsOverrideProperty5.js @@ -13,6 +13,7 @@ class C extends B { //// [accessorsOverrideProperty5.js] +"use strict"; class B { } class C extends B { diff --git a/tests/baselines/reference/accessorsOverrideProperty6.js b/tests/baselines/reference/accessorsOverrideProperty6.js index 7a5ceb71e8c61..4c1a19dfb42c0 100644 --- a/tests/baselines/reference/accessorsOverrideProperty6.js +++ b/tests/baselines/reference/accessorsOverrideProperty6.js @@ -18,6 +18,7 @@ class D extends C { //// [accessorsOverrideProperty6.js] +"use strict"; class A { constructor() { this.p = 'yep'; diff --git a/tests/baselines/reference/accessorsOverrideProperty7(target=es2015).js b/tests/baselines/reference/accessorsOverrideProperty7(target=es2015).js index 2fa70d0f2b72f..b8eb6bf34e55c 100644 --- a/tests/baselines/reference/accessorsOverrideProperty7(target=es2015).js +++ b/tests/baselines/reference/accessorsOverrideProperty7(target=es2015).js @@ -10,6 +10,7 @@ class B extends A { //// [accessorsOverrideProperty7.js] +"use strict"; class A { } class B extends A { diff --git a/tests/baselines/reference/accessorsOverrideProperty7(target=es5).js b/tests/baselines/reference/accessorsOverrideProperty7(target=es5).js index b4b222b18387d..6bd04f695d9d9 100644 --- a/tests/baselines/reference/accessorsOverrideProperty7(target=es5).js +++ b/tests/baselines/reference/accessorsOverrideProperty7(target=es5).js @@ -10,6 +10,7 @@ class B extends A { //// [accessorsOverrideProperty7.js] +"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || diff --git a/tests/baselines/reference/accessorsOverrideProperty8.js b/tests/baselines/reference/accessorsOverrideProperty8.js index 57f35263f166d..d43749339413b 100644 --- a/tests/baselines/reference/accessorsOverrideProperty8.js +++ b/tests/baselines/reference/accessorsOverrideProperty8.js @@ -35,6 +35,7 @@ const value = mine.x; //// [accessorsOverrideProperty8.js] +"use strict"; const Base = classWithProperties({ get x() { return 'boolean'; }, y: 'string', diff --git a/tests/baselines/reference/accessors_spec_section-4.5_error-cases.js b/tests/baselines/reference/accessors_spec_section-4.5_error-cases.js index 9ea30819ca58d..e6cd4cc791b04 100644 --- a/tests/baselines/reference/accessors_spec_section-4.5_error-cases.js +++ b/tests/baselines/reference/accessors_spec_section-4.5_error-cases.js @@ -16,6 +16,7 @@ class LanguageSpec_section_4_5_error_cases { } //// [accessors_spec_section-4.5_error-cases.js] +"use strict"; class LanguageSpec_section_4_5_error_cases { set AnnotatedSetter_SetterFirst(a) { } get AnnotatedSetter_SetterFirst() { return ""; } diff --git a/tests/baselines/reference/accessors_spec_section-4.5_inference.js b/tests/baselines/reference/accessors_spec_section-4.5_inference.js index 81138a81d0bc6..a8e7a017beb11 100644 --- a/tests/baselines/reference/accessors_spec_section-4.5_inference.js +++ b/tests/baselines/reference/accessors_spec_section-4.5_inference.js @@ -27,6 +27,7 @@ class LanguageSpec_section_4_5_inference { } //// [accessors_spec_section-4.5_inference.js] +"use strict"; class A { } class B extends A { diff --git a/tests/baselines/reference/addMoreCallSignaturesToBaseSignature.errors.txt b/tests/baselines/reference/addMoreCallSignaturesToBaseSignature.errors.txt new file mode 100644 index 0000000000000..f267787430a06 --- /dev/null +++ b/tests/baselines/reference/addMoreCallSignaturesToBaseSignature.errors.txt @@ -0,0 +1,17 @@ +addMoreCallSignaturesToBaseSignature.ts(10,13): error TS2454: Variable 'a' is used before being assigned. + + +==== addMoreCallSignaturesToBaseSignature.ts (1 errors) ==== + interface Foo { + (): string; + } + + interface Bar extends Foo { + (key: string): string; + } + + var a: Bar; + var kitty = a(); + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + \ No newline at end of file diff --git a/tests/baselines/reference/addMoreCallSignaturesToBaseSignature.js b/tests/baselines/reference/addMoreCallSignaturesToBaseSignature.js index 6d2085bf3c0b2..6366b65914aa3 100644 --- a/tests/baselines/reference/addMoreCallSignaturesToBaseSignature.js +++ b/tests/baselines/reference/addMoreCallSignaturesToBaseSignature.js @@ -14,5 +14,6 @@ var kitty = a(); //// [addMoreCallSignaturesToBaseSignature.js] +"use strict"; var a; var kitty = a(); diff --git a/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.errors.txt b/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.errors.txt new file mode 100644 index 0000000000000..2ad8c84453b75 --- /dev/null +++ b/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.errors.txt @@ -0,0 +1,16 @@ +addMoreCallSignaturesToBaseSignature2.ts(10,13): error TS2454: Variable 'a' is used before being assigned. + + +==== addMoreCallSignaturesToBaseSignature2.ts (1 errors) ==== + interface Foo { + (bar:number): string; + } + + interface Bar extends Foo { + (key: string): string; + } + + var a: Bar; + var kitty = a(1); + ~ +!!! error TS2454: Variable 'a' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.js b/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.js index c21f6c2c4fe56..a49a733e3c913 100644 --- a/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.js +++ b/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.js @@ -13,5 +13,6 @@ var a: Bar; var kitty = a(1); //// [addMoreCallSignaturesToBaseSignature2.js] +"use strict"; var a; var kitty = a(1); diff --git a/tests/baselines/reference/addMoreOverloadsToBaseSignature.js b/tests/baselines/reference/addMoreOverloadsToBaseSignature.js index de56258b76f3f..e116e69dcec47 100644 --- a/tests/baselines/reference/addMoreOverloadsToBaseSignature.js +++ b/tests/baselines/reference/addMoreOverloadsToBaseSignature.js @@ -11,3 +11,4 @@ interface Bar extends Foo { //// [addMoreOverloadsToBaseSignature.js] +"use strict"; diff --git a/tests/baselines/reference/additionOperatorWithAnyAndEveryType.js b/tests/baselines/reference/additionOperatorWithAnyAndEveryType.js index 44661c52d3bed..3dcced7cfb68e 100644 --- a/tests/baselines/reference/additionOperatorWithAnyAndEveryType.js +++ b/tests/baselines/reference/additionOperatorWithAnyAndEveryType.js @@ -42,6 +42,7 @@ var r19 = a + { a: '' }; var r20 = a + ((a: string) => { return a }); //// [additionOperatorWithAnyAndEveryType.js] +"use strict"; function foo() { } class C { static foo() { } diff --git a/tests/baselines/reference/additionOperatorWithConstrainedTypeParameter.js b/tests/baselines/reference/additionOperatorWithConstrainedTypeParameter.js index 6bd92fe270e43..94f3a600d234d 100644 --- a/tests/baselines/reference/additionOperatorWithConstrainedTypeParameter.js +++ b/tests/baselines/reference/additionOperatorWithConstrainedTypeParameter.js @@ -15,6 +15,7 @@ function realSum, K extends string>(n: number, vs: T //// [additionOperatorWithConstrainedTypeParameter.js] +"use strict"; // test for #17069 function sum(n, v, k) { n = n + v[k]; diff --git a/tests/baselines/reference/additionOperatorWithInvalidOperands.js b/tests/baselines/reference/additionOperatorWithInvalidOperands.js index ee53f3b495928..b664f5c0df71c 100644 --- a/tests/baselines/reference/additionOperatorWithInvalidOperands.js +++ b/tests/baselines/reference/additionOperatorWithInvalidOperands.js @@ -43,6 +43,7 @@ var r19 = E.a + C.foo(); var r20 = E.a + M; //// [additionOperatorWithInvalidOperands.js] +"use strict"; function foo() { } class C { static foo() { } diff --git a/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.errors.txt b/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.errors.txt index 30c26aace1a40..088a14b54474c 100644 --- a/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.errors.txt +++ b/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.errors.txt @@ -1,14 +1,14 @@ -additionOperatorWithNullValueAndInvalidOperator.ts(11,10): error TS2365: Operator '+' cannot be applied to types 'null' and 'boolean'. -additionOperatorWithNullValueAndInvalidOperator.ts(12,10): error TS2365: Operator '+' cannot be applied to types 'null' and 'Object'. -additionOperatorWithNullValueAndInvalidOperator.ts(13,10): error TS2365: Operator '+' cannot be applied to types 'null' and 'void'. -additionOperatorWithNullValueAndInvalidOperator.ts(14,10): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'null'. -additionOperatorWithNullValueAndInvalidOperator.ts(15,10): error TS2365: Operator '+' cannot be applied to types 'Object' and 'null'. -additionOperatorWithNullValueAndInvalidOperator.ts(16,10): error TS2365: Operator '+' cannot be applied to types 'null' and 'void'. -additionOperatorWithNullValueAndInvalidOperator.ts(19,10): error TS2365: Operator '+' cannot be applied to types 'null' and 'Number'. -additionOperatorWithNullValueAndInvalidOperator.ts(20,10): error TS2365: Operator '+' cannot be applied to types 'null' and 'boolean'. -additionOperatorWithNullValueAndInvalidOperator.ts(21,10): error TS2365: Operator '+' cannot be applied to types 'null' and '{ a: string; }'. -additionOperatorWithNullValueAndInvalidOperator.ts(22,11): error TS2365: Operator '+' cannot be applied to types 'null' and 'void'. -additionOperatorWithNullValueAndInvalidOperator.ts(23,11): error TS2365: Operator '+' cannot be applied to types 'null' and '() => void'. +additionOperatorWithNullValueAndInvalidOperator.ts(11,10): error TS18050: The value 'null' cannot be used here. +additionOperatorWithNullValueAndInvalidOperator.ts(12,10): error TS18050: The value 'null' cannot be used here. +additionOperatorWithNullValueAndInvalidOperator.ts(13,10): error TS18050: The value 'null' cannot be used here. +additionOperatorWithNullValueAndInvalidOperator.ts(14,14): error TS18050: The value 'null' cannot be used here. +additionOperatorWithNullValueAndInvalidOperator.ts(15,14): error TS18050: The value 'null' cannot be used here. +additionOperatorWithNullValueAndInvalidOperator.ts(16,10): error TS18050: The value 'null' cannot be used here. +additionOperatorWithNullValueAndInvalidOperator.ts(19,10): error TS18050: The value 'null' cannot be used here. +additionOperatorWithNullValueAndInvalidOperator.ts(20,10): error TS18050: The value 'null' cannot be used here. +additionOperatorWithNullValueAndInvalidOperator.ts(21,10): error TS18050: The value 'null' cannot be used here. +additionOperatorWithNullValueAndInvalidOperator.ts(22,11): error TS18050: The value 'null' cannot be used here. +additionOperatorWithNullValueAndInvalidOperator.ts(23,11): error TS18050: The value 'null' cannot be used here. ==== additionOperatorWithNullValueAndInvalidOperator.ts (11 errors) ==== @@ -23,37 +23,37 @@ additionOperatorWithNullValueAndInvalidOperator.ts(23,11): error TS2365: Operato // null + boolean/Object var r1 = null + a; - ~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'boolean'. + ~~~~ +!!! error TS18050: The value 'null' cannot be used here. var r2 = null + b; - ~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'Object'. + ~~~~ +!!! error TS18050: The value 'null' cannot be used here. var r3 = null + c; - ~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'void'. + ~~~~ +!!! error TS18050: The value 'null' cannot be used here. var r4 = a + null; - ~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'null'. + ~~~~ +!!! error TS18050: The value 'null' cannot be used here. var r5 = b + null; - ~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'Object' and 'null'. + ~~~~ +!!! error TS18050: The value 'null' cannot be used here. var r6 = null + c; - ~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'void'. + ~~~~ +!!! error TS18050: The value 'null' cannot be used here. // other cases var r7 = null + d; - ~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'Number'. + ~~~~ +!!! error TS18050: The value 'null' cannot be used here. var r8 = null + true; - ~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'boolean'. + ~~~~ +!!! error TS18050: The value 'null' cannot be used here. var r9 = null + { a: '' }; - ~~~~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'null' and '{ a: string; }'. + ~~~~ +!!! error TS18050: The value 'null' cannot be used here. var r10 = null + foo(); - ~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'void'. + ~~~~ +!!! error TS18050: The value 'null' cannot be used here. var r11 = null + (() => { }); - ~~~~~~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'null' and '() => void'. \ No newline at end of file + ~~~~ +!!! error TS18050: The value 'null' cannot be used here. \ No newline at end of file diff --git a/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.js b/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.js index 61b416eee5c68..21a06fa901659 100644 --- a/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.js +++ b/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.js @@ -26,6 +26,7 @@ var r10 = null + foo(); var r11 = null + (() => { }); //// [additionOperatorWithNullValueAndInvalidOperator.js] +"use strict"; // If one operand is the null or undefined value, it is treated as having the type of the other operand. function foo() { return undefined; } // null + boolean/Object diff --git a/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.errors.txt b/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.errors.txt index a046d0f0b0f8f..4f3fa8273a516 100644 --- a/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.errors.txt +++ b/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.errors.txt @@ -1,13 +1,13 @@ -additionOperatorWithNullValueAndValidOperator.ts(15,10): error TS2365: Operator '+' cannot be applied to types 'null' and 'number'. -additionOperatorWithNullValueAndValidOperator.ts(16,10): error TS2365: Operator '+' cannot be applied to types 'null' and '1'. -additionOperatorWithNullValueAndValidOperator.ts(17,10): error TS2365: Operator '+' cannot be applied to types 'null' and 'E'. -additionOperatorWithNullValueAndValidOperator.ts(18,10): error TS2365: Operator '+' cannot be applied to types 'null' and 'E.a'. -additionOperatorWithNullValueAndValidOperator.ts(19,10): error TS2365: Operator '+' cannot be applied to types 'null' and 'E.a'. -additionOperatorWithNullValueAndValidOperator.ts(20,10): error TS2365: Operator '+' cannot be applied to types 'number' and 'null'. -additionOperatorWithNullValueAndValidOperator.ts(21,10): error TS2365: Operator '+' cannot be applied to types '1' and 'null'. -additionOperatorWithNullValueAndValidOperator.ts(22,11): error TS2365: Operator '+' cannot be applied to types 'E' and 'null'. -additionOperatorWithNullValueAndValidOperator.ts(23,11): error TS2365: Operator '+' cannot be applied to types 'E.a' and 'null'. -additionOperatorWithNullValueAndValidOperator.ts(24,11): error TS2365: Operator '+' cannot be applied to types 'E.a' and 'null'. +additionOperatorWithNullValueAndValidOperator.ts(15,10): error TS18050: The value 'null' cannot be used here. +additionOperatorWithNullValueAndValidOperator.ts(16,10): error TS18050: The value 'null' cannot be used here. +additionOperatorWithNullValueAndValidOperator.ts(17,10): error TS18050: The value 'null' cannot be used here. +additionOperatorWithNullValueAndValidOperator.ts(18,10): error TS18050: The value 'null' cannot be used here. +additionOperatorWithNullValueAndValidOperator.ts(19,10): error TS18050: The value 'null' cannot be used here. +additionOperatorWithNullValueAndValidOperator.ts(20,14): error TS18050: The value 'null' cannot be used here. +additionOperatorWithNullValueAndValidOperator.ts(21,14): error TS18050: The value 'null' cannot be used here. +additionOperatorWithNullValueAndValidOperator.ts(22,15): error TS18050: The value 'null' cannot be used here. +additionOperatorWithNullValueAndValidOperator.ts(23,17): error TS18050: The value 'null' cannot be used here. +additionOperatorWithNullValueAndValidOperator.ts(24,20): error TS18050: The value 'null' cannot be used here. ==== additionOperatorWithNullValueAndValidOperator.ts (10 errors) ==== @@ -26,35 +26,35 @@ additionOperatorWithNullValueAndValidOperator.ts(24,11): error TS2365: Operator // null + number/enum var r3 = null + b; - ~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'number'. + ~~~~ +!!! error TS18050: The value 'null' cannot be used here. var r4 = null + 1; - ~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'null' and '1'. + ~~~~ +!!! error TS18050: The value 'null' cannot be used here. var r5 = null + c; - ~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'E'. + ~~~~ +!!! error TS18050: The value 'null' cannot be used here. var r6 = null + E.a; - ~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'E.a'. + ~~~~ +!!! error TS18050: The value 'null' cannot be used here. var r7 = null + E['a']; - ~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'E.a'. + ~~~~ +!!! error TS18050: The value 'null' cannot be used here. var r8 = b + null; - ~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'number' and 'null'. + ~~~~ +!!! error TS18050: The value 'null' cannot be used here. var r9 = 1 + null; - ~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types '1' and 'null'. + ~~~~ +!!! error TS18050: The value 'null' cannot be used here. var r10 = c + null - ~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'E' and 'null'. + ~~~~ +!!! error TS18050: The value 'null' cannot be used here. var r11 = E.a + null; - ~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'E.a' and 'null'. + ~~~~ +!!! error TS18050: The value 'null' cannot be used here. var r12 = E['a'] + null; - ~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'E.a' and 'null'. + ~~~~ +!!! error TS18050: The value 'null' cannot be used here. // null + string var r13 = null + d; diff --git a/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.js b/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.js index 0c9c6750982ed..0ed68b06716c8 100644 --- a/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.js +++ b/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.js @@ -33,6 +33,7 @@ var r15 = d + null; var r16 = '' + null; //// [additionOperatorWithNullValueAndValidOperator.js] +"use strict"; // If one operand is the null or undefined value, it is treated as having the type of the other operand. var E; (function (E) { diff --git a/tests/baselines/reference/additionOperatorWithNumberAndEnum.errors.txt b/tests/baselines/reference/additionOperatorWithNumberAndEnum.errors.txt new file mode 100644 index 0000000000000..1a593c463d299 --- /dev/null +++ b/tests/baselines/reference/additionOperatorWithNumberAndEnum.errors.txt @@ -0,0 +1,84 @@ +additionOperatorWithNumberAndEnum.ts(8,10): error TS2454: Variable 'a' is used before being assigned. +additionOperatorWithNumberAndEnum.ts(8,14): error TS2454: Variable 'a' is used before being assigned. +additionOperatorWithNumberAndEnum.ts(9,10): error TS2454: Variable 'a' is used before being assigned. +additionOperatorWithNumberAndEnum.ts(9,14): error TS2454: Variable 'b' is used before being assigned. +additionOperatorWithNumberAndEnum.ts(10,10): error TS2454: Variable 'b' is used before being assigned. +additionOperatorWithNumberAndEnum.ts(10,14): error TS2454: Variable 'a' is used before being assigned. +additionOperatorWithNumberAndEnum.ts(11,10): error TS2454: Variable 'b' is used before being assigned. +additionOperatorWithNumberAndEnum.ts(11,14): error TS2454: Variable 'b' is used before being assigned. +additionOperatorWithNumberAndEnum.ts(13,14): error TS2454: Variable 'a' is used before being assigned. +additionOperatorWithNumberAndEnum.ts(19,11): error TS2454: Variable 'a' is used before being assigned. +additionOperatorWithNumberAndEnum.ts(19,15): error TS2454: Variable 'c' is used before being assigned. +additionOperatorWithNumberAndEnum.ts(20,11): error TS2454: Variable 'c' is used before being assigned. +additionOperatorWithNumberAndEnum.ts(20,15): error TS2454: Variable 'a' is used before being assigned. +additionOperatorWithNumberAndEnum.ts(21,11): error TS2454: Variable 'b' is used before being assigned. +additionOperatorWithNumberAndEnum.ts(21,15): error TS2454: Variable 'c' is used before being assigned. +additionOperatorWithNumberAndEnum.ts(22,11): error TS2454: Variable 'c' is used before being assigned. +additionOperatorWithNumberAndEnum.ts(22,15): error TS2454: Variable 'b' is used before being assigned. +additionOperatorWithNumberAndEnum.ts(23,11): error TS2454: Variable 'c' is used before being assigned. +additionOperatorWithNumberAndEnum.ts(23,15): error TS2454: Variable 'c' is used before being assigned. + + +==== additionOperatorWithNumberAndEnum.ts (19 errors) ==== + enum E { a, b } + enum F { c, d } + + var a: number; + var b: E; + var c: E | F; + + var r1 = a + a; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var r2 = a + b; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var r3 = b + a; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var r4 = b + b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + + var r5 = 0 + a; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var r6 = E.a + 0; + var r7 = E.a + E.b; + var r8 = E['a'] + E['b']; + var r9 = E['a'] + F['c']; + + var r10 = a + c; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var r11 = c + a; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var r12 = b + c; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var r13 = c + b; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var r14 = c + c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + \ No newline at end of file diff --git a/tests/baselines/reference/additionOperatorWithNumberAndEnum.js b/tests/baselines/reference/additionOperatorWithNumberAndEnum.js index f687ae509f49f..d41a009fdbf58 100644 --- a/tests/baselines/reference/additionOperatorWithNumberAndEnum.js +++ b/tests/baselines/reference/additionOperatorWithNumberAndEnum.js @@ -27,6 +27,7 @@ var r14 = c + c; //// [additionOperatorWithNumberAndEnum.js] +"use strict"; var E; (function (E) { E[E["a"] = 0] = "a"; diff --git a/tests/baselines/reference/additionOperatorWithOnlyNullValueOrUndefinedValue.errors.txt b/tests/baselines/reference/additionOperatorWithOnlyNullValueOrUndefinedValue.errors.txt index df254946507c7..b02da7fdb1014 100644 --- a/tests/baselines/reference/additionOperatorWithOnlyNullValueOrUndefinedValue.errors.txt +++ b/tests/baselines/reference/additionOperatorWithOnlyNullValueOrUndefinedValue.errors.txt @@ -1,20 +1,32 @@ -additionOperatorWithOnlyNullValueOrUndefinedValue.ts(2,10): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. -additionOperatorWithOnlyNullValueOrUndefinedValue.ts(3,10): error TS2365: Operator '+' cannot be applied to types 'null' and 'undefined'. -additionOperatorWithOnlyNullValueOrUndefinedValue.ts(4,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'null'. -additionOperatorWithOnlyNullValueOrUndefinedValue.ts(5,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. +additionOperatorWithOnlyNullValueOrUndefinedValue.ts(2,10): error TS18050: The value 'null' cannot be used here. +additionOperatorWithOnlyNullValueOrUndefinedValue.ts(2,17): error TS18050: The value 'null' cannot be used here. +additionOperatorWithOnlyNullValueOrUndefinedValue.ts(3,10): error TS18050: The value 'null' cannot be used here. +additionOperatorWithOnlyNullValueOrUndefinedValue.ts(3,17): error TS18050: The value 'undefined' cannot be used here. +additionOperatorWithOnlyNullValueOrUndefinedValue.ts(4,10): error TS18050: The value 'undefined' cannot be used here. +additionOperatorWithOnlyNullValueOrUndefinedValue.ts(4,22): error TS18050: The value 'null' cannot be used here. +additionOperatorWithOnlyNullValueOrUndefinedValue.ts(5,10): error TS18050: The value 'undefined' cannot be used here. +additionOperatorWithOnlyNullValueOrUndefinedValue.ts(5,22): error TS18050: The value 'undefined' cannot be used here. -==== additionOperatorWithOnlyNullValueOrUndefinedValue.ts (4 errors) ==== +==== additionOperatorWithOnlyNullValueOrUndefinedValue.ts (8 errors) ==== // bug 819721 var r1 = null + null; - ~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. + ~~~~ +!!! error TS18050: The value 'null' cannot be used here. + ~~~~ +!!! error TS18050: The value 'null' cannot be used here. var r2 = null + undefined; - ~~~~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'null' and 'undefined'. + ~~~~ +!!! error TS18050: The value 'null' cannot be used here. + ~~~~~~~~~ +!!! error TS18050: The value 'undefined' cannot be used here. var r3 = undefined + null; - ~~~~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'null'. + ~~~~~~~~~ +!!! error TS18050: The value 'undefined' cannot be used here. + ~~~~ +!!! error TS18050: The value 'null' cannot be used here. var r4 = undefined + undefined; - ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. \ No newline at end of file + ~~~~~~~~~ +!!! error TS18050: The value 'undefined' cannot be used here. + ~~~~~~~~~ +!!! error TS18050: The value 'undefined' cannot be used here. \ No newline at end of file diff --git a/tests/baselines/reference/additionOperatorWithOnlyNullValueOrUndefinedValue.js b/tests/baselines/reference/additionOperatorWithOnlyNullValueOrUndefinedValue.js index 94d34e8a15705..0c06a18fcd5e6 100644 --- a/tests/baselines/reference/additionOperatorWithOnlyNullValueOrUndefinedValue.js +++ b/tests/baselines/reference/additionOperatorWithOnlyNullValueOrUndefinedValue.js @@ -8,6 +8,7 @@ var r3 = undefined + null; var r4 = undefined + undefined; //// [additionOperatorWithOnlyNullValueOrUndefinedValue.js] +"use strict"; // bug 819721 var r1 = null + null; var r2 = null + undefined; diff --git a/tests/baselines/reference/additionOperatorWithStringAndEveryType.errors.txt b/tests/baselines/reference/additionOperatorWithStringAndEveryType.errors.txt new file mode 100644 index 0000000000000..209d9b5bc0953 --- /dev/null +++ b/tests/baselines/reference/additionOperatorWithStringAndEveryType.errors.txt @@ -0,0 +1,131 @@ +additionOperatorWithStringAndEveryType.ts(15,10): error TS2454: Variable 'x' is used before being assigned. +additionOperatorWithStringAndEveryType.ts(16,10): error TS2454: Variable 'x' is used before being assigned. +additionOperatorWithStringAndEveryType.ts(16,14): error TS2454: Variable 'b' is used before being assigned. +additionOperatorWithStringAndEveryType.ts(17,10): error TS2454: Variable 'x' is used before being assigned. +additionOperatorWithStringAndEveryType.ts(17,14): error TS2454: Variable 'c' is used before being assigned. +additionOperatorWithStringAndEveryType.ts(18,10): error TS2454: Variable 'x' is used before being assigned. +additionOperatorWithStringAndEveryType.ts(18,14): error TS2454: Variable 'd' is used before being assigned. +additionOperatorWithStringAndEveryType.ts(19,10): error TS2454: Variable 'x' is used before being assigned. +additionOperatorWithStringAndEveryType.ts(19,14): error TS2454: Variable 'e' is used before being assigned. +additionOperatorWithStringAndEveryType.ts(20,10): error TS2454: Variable 'x' is used before being assigned. +additionOperatorWithStringAndEveryType.ts(21,10): error TS2454: Variable 'x' is used before being assigned. +additionOperatorWithStringAndEveryType.ts(21,14): error TS2454: Variable 'g' is used before being assigned. +additionOperatorWithStringAndEveryType.ts(24,14): error TS2454: Variable 'x' is used before being assigned. +additionOperatorWithStringAndEveryType.ts(25,10): error TS2454: Variable 'b' is used before being assigned. +additionOperatorWithStringAndEveryType.ts(25,14): error TS2454: Variable 'x' is used before being assigned. +additionOperatorWithStringAndEveryType.ts(26,11): error TS2454: Variable 'c' is used before being assigned. +additionOperatorWithStringAndEveryType.ts(26,15): error TS2454: Variable 'x' is used before being assigned. +additionOperatorWithStringAndEveryType.ts(27,11): error TS2454: Variable 'd' is used before being assigned. +additionOperatorWithStringAndEveryType.ts(27,15): error TS2454: Variable 'x' is used before being assigned. +additionOperatorWithStringAndEveryType.ts(28,11): error TS2454: Variable 'e' is used before being assigned. +additionOperatorWithStringAndEveryType.ts(28,15): error TS2454: Variable 'x' is used before being assigned. +additionOperatorWithStringAndEveryType.ts(29,15): error TS2454: Variable 'x' is used before being assigned. +additionOperatorWithStringAndEveryType.ts(30,11): error TS2454: Variable 'g' is used before being assigned. +additionOperatorWithStringAndEveryType.ts(30,15): error TS2454: Variable 'x' is used before being assigned. +additionOperatorWithStringAndEveryType.ts(33,11): error TS2454: Variable 'x' is used before being assigned. +additionOperatorWithStringAndEveryType.ts(34,11): error TS2454: Variable 'x' is used before being assigned. +additionOperatorWithStringAndEveryType.ts(35,11): error TS2454: Variable 'x' is used before being assigned. +additionOperatorWithStringAndEveryType.ts(36,11): error TS2454: Variable 'x' is used before being assigned. +additionOperatorWithStringAndEveryType.ts(37,11): error TS2454: Variable 'x' is used before being assigned. +additionOperatorWithStringAndEveryType.ts(38,11): error TS2454: Variable 'x' is used before being assigned. + + +==== additionOperatorWithStringAndEveryType.ts (30 errors) ==== + enum E { a, b, c } + + var a: any; + var b: boolean; + var c: number; + var d: string; + var e: Object; + var f: void; + var g: E; + + var x: string; + + // string could plus every type, and the result is always string + // string as left operand + var r1 = x + a; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + var r2 = x + b; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var r3 = x + c; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var r4 = x + d; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + ~ +!!! error TS2454: Variable 'd' is used before being assigned. + var r5 = x + e; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + ~ +!!! error TS2454: Variable 'e' is used before being assigned. + var r6 = x + f; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + var r7 = x + g; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + ~ +!!! error TS2454: Variable 'g' is used before being assigned. + + // string as right operand + var r8 = a + x; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + var r9 = b + x; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + var r10 = c + x; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + var r11 = d + x; + ~ +!!! error TS2454: Variable 'd' is used before being assigned. + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + var r12 = e + x; + ~ +!!! error TS2454: Variable 'e' is used before being assigned. + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + var r13 = f + x; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + var r14 = g + x; + ~ +!!! error TS2454: Variable 'g' is used before being assigned. + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + + // other cases + var r15 = x + E; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + var r16 = x + E.a; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + var r17 = x + ''; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + var r18 = x + 0; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + var r19 = x + { a: '' }; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + var r20 = x + []; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/additionOperatorWithStringAndEveryType.js b/tests/baselines/reference/additionOperatorWithStringAndEveryType.js index aa6652ac8a8d3..351176e204402 100644 --- a/tests/baselines/reference/additionOperatorWithStringAndEveryType.js +++ b/tests/baselines/reference/additionOperatorWithStringAndEveryType.js @@ -41,6 +41,7 @@ var r19 = x + { a: '' }; var r20 = x + []; //// [additionOperatorWithStringAndEveryType.js] +"use strict"; var E; (function (E) { E[E["a"] = 0] = "a"; diff --git a/tests/baselines/reference/additionOperatorWithStringAndEveryType.types b/tests/baselines/reference/additionOperatorWithStringAndEveryType.types index 43fac514abc55..ad66b62070ab0 100644 --- a/tests/baselines/reference/additionOperatorWithStringAndEveryType.types +++ b/tests/baselines/reference/additionOperatorWithStringAndEveryType.types @@ -13,6 +13,7 @@ enum E { a, b, c } var a: any; >a : any +> : ^^^ var b: boolean; >b : boolean @@ -52,6 +53,7 @@ var r1 = x + a; >x : string > : ^^^^^^ >a : any +> : ^^^ var r2 = x + b; >r2 : string @@ -120,6 +122,7 @@ var r8 = a + x; >a + x : string > : ^^^^^^ >a : any +> : ^^^ >x : string > : ^^^^^^ @@ -249,6 +252,6 @@ var r20 = x + []; > : ^^^^^^ >x : string > : ^^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ diff --git a/tests/baselines/reference/additionOperatorWithTypeParameter.errors.txt b/tests/baselines/reference/additionOperatorWithTypeParameter.errors.txt index 6bf776b120d4b..f4f8ad9291859 100644 --- a/tests/baselines/reference/additionOperatorWithTypeParameter.errors.txt +++ b/tests/baselines/reference/additionOperatorWithTypeParameter.errors.txt @@ -8,12 +8,12 @@ additionOperatorWithTypeParameter.ts(25,15): error TS2365: Operator '+' cannot b additionOperatorWithTypeParameter.ts(27,15): error TS2365: Operator '+' cannot be applied to types 'Object' and 'T'. additionOperatorWithTypeParameter.ts(28,15): error TS2365: Operator '+' cannot be applied to types 'E' and 'T'. additionOperatorWithTypeParameter.ts(29,15): error TS2365: Operator '+' cannot be applied to types 'void' and 'T'. -additionOperatorWithTypeParameter.ts(32,15): error TS2365: Operator '+' cannot be applied to types 'T' and 'null'. -additionOperatorWithTypeParameter.ts(33,15): error TS2365: Operator '+' cannot be applied to types 'T' and 'undefined'. +additionOperatorWithTypeParameter.ts(32,19): error TS18050: The value 'null' cannot be used here. +additionOperatorWithTypeParameter.ts(33,19): error TS18050: The value 'undefined' cannot be used here. additionOperatorWithTypeParameter.ts(34,15): error TS2365: Operator '+' cannot be applied to types 'T' and 'T'. additionOperatorWithTypeParameter.ts(35,15): error TS2365: Operator '+' cannot be applied to types 'T' and 'U'. additionOperatorWithTypeParameter.ts(36,15): error TS2365: Operator '+' cannot be applied to types 'T' and '() => void'. -additionOperatorWithTypeParameter.ts(37,15): error TS2365: Operator '+' cannot be applied to types 'T' and 'undefined[]'. +additionOperatorWithTypeParameter.ts(37,15): error TS2365: Operator '+' cannot be applied to types 'T' and 'never[]'. ==== additionOperatorWithTypeParameter.ts (16 errors) ==== @@ -69,11 +69,11 @@ additionOperatorWithTypeParameter.ts(37,15): error TS2365: Operator '+' cannot b // other cases var r15 = t + null; - ~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'T' and 'null'. + ~~~~ +!!! error TS18050: The value 'null' cannot be used here. var r16 = t + undefined; - ~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'T' and 'undefined'. + ~~~~~~~~~ +!!! error TS18050: The value 'undefined' cannot be used here. var r17 = t + t; ~~~~~ !!! error TS2365: Operator '+' cannot be applied to types 'T' and 'T'. @@ -85,5 +85,5 @@ additionOperatorWithTypeParameter.ts(37,15): error TS2365: Operator '+' cannot b !!! error TS2365: Operator '+' cannot be applied to types 'T' and '() => void'. var r20 = t + []; ~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'T' and 'undefined[]'. +!!! error TS2365: Operator '+' cannot be applied to types 'T' and 'never[]'. } \ No newline at end of file diff --git a/tests/baselines/reference/additionOperatorWithTypeParameter.js b/tests/baselines/reference/additionOperatorWithTypeParameter.js index 51302d3e39f06..2fd4cc157b2bb 100644 --- a/tests/baselines/reference/additionOperatorWithTypeParameter.js +++ b/tests/baselines/reference/additionOperatorWithTypeParameter.js @@ -41,6 +41,7 @@ function foo(t: T, u: U) { } //// [additionOperatorWithTypeParameter.js] +"use strict"; // type parameter type is not a valid operand of addition operator var E; (function (E) { diff --git a/tests/baselines/reference/additionOperatorWithTypeParameter.types b/tests/baselines/reference/additionOperatorWithTypeParameter.types index 200f1ebab23a1..06d992fbc7044 100644 --- a/tests/baselines/reference/additionOperatorWithTypeParameter.types +++ b/tests/baselines/reference/additionOperatorWithTypeParameter.types @@ -246,6 +246,6 @@ function foo(t: T, u: U) { > : ^^^ >t : T > : ^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ } diff --git a/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.errors.txt b/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.errors.txt index 1c50937aad0a7..cd55b935a5445 100644 --- a/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.errors.txt +++ b/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.errors.txt @@ -1,14 +1,14 @@ -additionOperatorWithUndefinedValueAndInvalidOperands.ts(11,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'boolean'. -additionOperatorWithUndefinedValueAndInvalidOperands.ts(12,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'Object'. -additionOperatorWithUndefinedValueAndInvalidOperands.ts(13,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'void'. -additionOperatorWithUndefinedValueAndInvalidOperands.ts(14,10): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'undefined'. -additionOperatorWithUndefinedValueAndInvalidOperands.ts(15,10): error TS2365: Operator '+' cannot be applied to types 'Object' and 'undefined'. -additionOperatorWithUndefinedValueAndInvalidOperands.ts(16,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'void'. -additionOperatorWithUndefinedValueAndInvalidOperands.ts(19,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'Number'. -additionOperatorWithUndefinedValueAndInvalidOperands.ts(20,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'boolean'. -additionOperatorWithUndefinedValueAndInvalidOperands.ts(21,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and '{ a: string; }'. -additionOperatorWithUndefinedValueAndInvalidOperands.ts(22,11): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'void'. -additionOperatorWithUndefinedValueAndInvalidOperands.ts(23,11): error TS2365: Operator '+' cannot be applied to types 'undefined' and '() => void'. +additionOperatorWithUndefinedValueAndInvalidOperands.ts(11,10): error TS18050: The value 'undefined' cannot be used here. +additionOperatorWithUndefinedValueAndInvalidOperands.ts(12,10): error TS18050: The value 'undefined' cannot be used here. +additionOperatorWithUndefinedValueAndInvalidOperands.ts(13,10): error TS18050: The value 'undefined' cannot be used here. +additionOperatorWithUndefinedValueAndInvalidOperands.ts(14,14): error TS18050: The value 'undefined' cannot be used here. +additionOperatorWithUndefinedValueAndInvalidOperands.ts(15,14): error TS18050: The value 'undefined' cannot be used here. +additionOperatorWithUndefinedValueAndInvalidOperands.ts(16,10): error TS18050: The value 'undefined' cannot be used here. +additionOperatorWithUndefinedValueAndInvalidOperands.ts(19,10): error TS18050: The value 'undefined' cannot be used here. +additionOperatorWithUndefinedValueAndInvalidOperands.ts(20,10): error TS18050: The value 'undefined' cannot be used here. +additionOperatorWithUndefinedValueAndInvalidOperands.ts(21,10): error TS18050: The value 'undefined' cannot be used here. +additionOperatorWithUndefinedValueAndInvalidOperands.ts(22,11): error TS18050: The value 'undefined' cannot be used here. +additionOperatorWithUndefinedValueAndInvalidOperands.ts(23,11): error TS18050: The value 'undefined' cannot be used here. ==== additionOperatorWithUndefinedValueAndInvalidOperands.ts (11 errors) ==== @@ -23,37 +23,37 @@ additionOperatorWithUndefinedValueAndInvalidOperands.ts(23,11): error TS2365: Op // undefined + boolean/Object var r1 = undefined + a; - ~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'boolean'. + ~~~~~~~~~ +!!! error TS18050: The value 'undefined' cannot be used here. var r2 = undefined + b; - ~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'Object'. + ~~~~~~~~~ +!!! error TS18050: The value 'undefined' cannot be used here. var r3 = undefined + c; - ~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'void'. + ~~~~~~~~~ +!!! error TS18050: The value 'undefined' cannot be used here. var r4 = a + undefined; - ~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'undefined'. + ~~~~~~~~~ +!!! error TS18050: The value 'undefined' cannot be used here. var r5 = b + undefined; - ~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'Object' and 'undefined'. + ~~~~~~~~~ +!!! error TS18050: The value 'undefined' cannot be used here. var r6 = undefined + c; - ~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'void'. + ~~~~~~~~~ +!!! error TS18050: The value 'undefined' cannot be used here. // other cases var r7 = undefined + d; - ~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'Number'. + ~~~~~~~~~ +!!! error TS18050: The value 'undefined' cannot be used here. var r8 = undefined + true; - ~~~~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'boolean'. + ~~~~~~~~~ +!!! error TS18050: The value 'undefined' cannot be used here. var r9 = undefined + { a: '' }; - ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and '{ a: string; }'. + ~~~~~~~~~ +!!! error TS18050: The value 'undefined' cannot be used here. var r10 = undefined + foo(); - ~~~~~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'void'. + ~~~~~~~~~ +!!! error TS18050: The value 'undefined' cannot be used here. var r11 = undefined + (() => { }); - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and '() => void'. \ No newline at end of file + ~~~~~~~~~ +!!! error TS18050: The value 'undefined' cannot be used here. \ No newline at end of file diff --git a/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.js b/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.js index 8dc0815fc1e71..2d074e01f6003 100644 --- a/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.js +++ b/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.js @@ -26,6 +26,7 @@ var r10 = undefined + foo(); var r11 = undefined + (() => { }); //// [additionOperatorWithUndefinedValueAndInvalidOperands.js] +"use strict"; // If one operand is the null or undefined value, it is treated as having the type of the other operand. function foo() { return undefined; } // undefined + boolean/Object diff --git a/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.errors.txt b/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.errors.txt index bf1f4cd3e4fd3..73058382c5d8f 100644 --- a/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.errors.txt +++ b/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.errors.txt @@ -1,13 +1,13 @@ -additionOperatorWithUndefinedValueAndValidOperator.ts(15,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'number'. -additionOperatorWithUndefinedValueAndValidOperator.ts(16,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and '1'. -additionOperatorWithUndefinedValueAndValidOperator.ts(17,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'E'. -additionOperatorWithUndefinedValueAndValidOperator.ts(18,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'E.a'. -additionOperatorWithUndefinedValueAndValidOperator.ts(19,10): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'E.a'. -additionOperatorWithUndefinedValueAndValidOperator.ts(20,10): error TS2365: Operator '+' cannot be applied to types 'number' and 'undefined'. -additionOperatorWithUndefinedValueAndValidOperator.ts(21,10): error TS2365: Operator '+' cannot be applied to types '1' and 'undefined'. -additionOperatorWithUndefinedValueAndValidOperator.ts(22,11): error TS2365: Operator '+' cannot be applied to types 'E' and 'undefined'. -additionOperatorWithUndefinedValueAndValidOperator.ts(23,11): error TS2365: Operator '+' cannot be applied to types 'E.a' and 'undefined'. -additionOperatorWithUndefinedValueAndValidOperator.ts(24,11): error TS2365: Operator '+' cannot be applied to types 'E.a' and 'undefined'. +additionOperatorWithUndefinedValueAndValidOperator.ts(15,10): error TS18050: The value 'undefined' cannot be used here. +additionOperatorWithUndefinedValueAndValidOperator.ts(16,10): error TS18050: The value 'undefined' cannot be used here. +additionOperatorWithUndefinedValueAndValidOperator.ts(17,10): error TS18050: The value 'undefined' cannot be used here. +additionOperatorWithUndefinedValueAndValidOperator.ts(18,10): error TS18050: The value 'undefined' cannot be used here. +additionOperatorWithUndefinedValueAndValidOperator.ts(19,10): error TS18050: The value 'undefined' cannot be used here. +additionOperatorWithUndefinedValueAndValidOperator.ts(20,14): error TS18050: The value 'undefined' cannot be used here. +additionOperatorWithUndefinedValueAndValidOperator.ts(21,14): error TS18050: The value 'undefined' cannot be used here. +additionOperatorWithUndefinedValueAndValidOperator.ts(22,15): error TS18050: The value 'undefined' cannot be used here. +additionOperatorWithUndefinedValueAndValidOperator.ts(23,17): error TS18050: The value 'undefined' cannot be used here. +additionOperatorWithUndefinedValueAndValidOperator.ts(24,20): error TS18050: The value 'undefined' cannot be used here. ==== additionOperatorWithUndefinedValueAndValidOperator.ts (10 errors) ==== @@ -26,35 +26,35 @@ additionOperatorWithUndefinedValueAndValidOperator.ts(24,11): error TS2365: Oper // undefined + number/enum var r3 = undefined + b; - ~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'number'. + ~~~~~~~~~ +!!! error TS18050: The value 'undefined' cannot be used here. var r4 = undefined + 1; - ~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and '1'. + ~~~~~~~~~ +!!! error TS18050: The value 'undefined' cannot be used here. var r5 = undefined + c; - ~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'E'. + ~~~~~~~~~ +!!! error TS18050: The value 'undefined' cannot be used here. var r6 = undefined + E.a; - ~~~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'E.a'. + ~~~~~~~~~ +!!! error TS18050: The value 'undefined' cannot be used here. var r7 = undefined + E['a']; - ~~~~~~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'undefined' and 'E.a'. + ~~~~~~~~~ +!!! error TS18050: The value 'undefined' cannot be used here. var r8 = b + undefined; - ~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'number' and 'undefined'. + ~~~~~~~~~ +!!! error TS18050: The value 'undefined' cannot be used here. var r9 = 1 + undefined; - ~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types '1' and 'undefined'. + ~~~~~~~~~ +!!! error TS18050: The value 'undefined' cannot be used here. var r10 = c + undefined - ~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'E' and 'undefined'. + ~~~~~~~~~ +!!! error TS18050: The value 'undefined' cannot be used here. var r11 = E.a + undefined; - ~~~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'E.a' and 'undefined'. + ~~~~~~~~~ +!!! error TS18050: The value 'undefined' cannot be used here. var r12 = E['a'] + undefined; - ~~~~~~~~~~~~~~~~~~ -!!! error TS2365: Operator '+' cannot be applied to types 'E.a' and 'undefined'. + ~~~~~~~~~ +!!! error TS18050: The value 'undefined' cannot be used here. // undefined + string var r13 = undefined + d; diff --git a/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.js b/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.js index f80fb1253c3f4..db7c8097db3e6 100644 --- a/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.js +++ b/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.js @@ -33,6 +33,7 @@ var r15 = d + undefined; var r16 = '' + undefined; //// [additionOperatorWithUndefinedValueAndValidOperator.js] +"use strict"; // If one operand is the null or undefined value, it is treated as having the type of the other operand. var E; (function (E) { diff --git a/tests/baselines/reference/aliasAssignments.errors.txt b/tests/baselines/reference/aliasAssignments.errors.txt index 23a687c811270..828201dfefe80 100644 --- a/tests/baselines/reference/aliasAssignments.errors.txt +++ b/tests/baselines/reference/aliasAssignments.errors.txt @@ -1,5 +1,6 @@ aliasAssignments_1.ts(3,1): error TS2322: Type 'number' is not assignable to type 'typeof import("aliasAssignments_moduleA")'. aliasAssignments_1.ts(5,1): error TS2322: Type 'typeof import("aliasAssignments_moduleA")' is not assignable to type 'number'. +aliasAssignments_moduleA.ts(2,12): error TS2564: Property 'someData' has no initializer and is not definitely assigned in the constructor. ==== aliasAssignments_1.ts (2 errors) ==== @@ -13,8 +14,10 @@ aliasAssignments_1.ts(5,1): error TS2322: Type 'typeof import("aliasAssignments_ ~ !!! error TS2322: Type 'typeof import("aliasAssignments_moduleA")' is not assignable to type 'number'. -==== aliasAssignments_moduleA.ts (0 errors) ==== +==== aliasAssignments_moduleA.ts (1 errors) ==== export class someClass { public someData: string; + ~~~~~~~~ +!!! error TS2564: Property 'someData' has no initializer and is not definitely assigned in the constructor. } \ No newline at end of file diff --git a/tests/baselines/reference/aliasBug.js b/tests/baselines/reference/aliasBug.js index 49ea8df48062e..79e03ae5e747b 100644 --- a/tests/baselines/reference/aliasBug.js +++ b/tests/baselines/reference/aliasBug.js @@ -22,6 +22,7 @@ function use() { //// [aliasBug.js] +"use strict"; var foo; (function (foo) { class Provide { diff --git a/tests/baselines/reference/aliasErrors.js b/tests/baselines/reference/aliasErrors.js index fb7e5c0f70c99..eaf56a1ab015c 100644 --- a/tests/baselines/reference/aliasErrors.js +++ b/tests/baselines/reference/aliasErrors.js @@ -33,6 +33,7 @@ function use() { //// [aliasErrors.js] +"use strict"; var foo; (function (foo) { class Provide { diff --git a/tests/baselines/reference/aliasInaccessibleModule.js b/tests/baselines/reference/aliasInaccessibleModule.js index 72460c86f5458..690b65b36f107 100644 --- a/tests/baselines/reference/aliasInaccessibleModule.js +++ b/tests/baselines/reference/aliasInaccessibleModule.js @@ -8,6 +8,7 @@ namespace M { } //// [aliasInaccessibleModule.js] +"use strict"; var M; (function (M) { })(M || (M = {})); diff --git a/tests/baselines/reference/aliasInaccessibleModule2.js b/tests/baselines/reference/aliasInaccessibleModule2.js index 979b7157bb7ce..7f2922d3a2435 100644 --- a/tests/baselines/reference/aliasInaccessibleModule2.js +++ b/tests/baselines/reference/aliasInaccessibleModule2.js @@ -12,6 +12,7 @@ namespace M { } //// [aliasInaccessibleModule2.js] +"use strict"; var M; (function (M) { let N; diff --git a/tests/baselines/reference/aliasOnMergedModuleInterface.js b/tests/baselines/reference/aliasOnMergedModuleInterface.js index 3d032add8eb62..5d9c2d30045da 100644 --- a/tests/baselines/reference/aliasOnMergedModuleInterface.js +++ b/tests/baselines/reference/aliasOnMergedModuleInterface.js @@ -22,6 +22,7 @@ var x: foo.A = foo.bar("hello"); // foo.A should be ok but foo.bar should be err //// [aliasOnMergedModuleInterface_0.js] +"use strict"; //// [aliasOnMergedModuleInterface_1.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tests/baselines/reference/aliasUsageInAccessorsOfClass(target=es2015).errors.txt b/tests/baselines/reference/aliasUsageInAccessorsOfClass(target=es2015).errors.txt new file mode 100644 index 0000000000000..eaf906b703ccc --- /dev/null +++ b/tests/baselines/reference/aliasUsageInAccessorsOfClass(target=es2015).errors.txt @@ -0,0 +1,34 @@ +aliasUsage1_backbone.ts(2,12): error TS2564: Property 'someData' has no initializer and is not definitely assigned in the constructor. +aliasUsage1_main.ts(7,5): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. + + +==== aliasUsage1_main.ts (1 errors) ==== + import Backbone = require("./aliasUsage1_backbone"); + import moduleA = require("./aliasUsage1_moduleA"); + interface IHasVisualizationModel { + VisualizationModel: typeof Backbone.Model; + } + class C2 { + x: IHasVisualizationModel; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. + get A() { + return this.x; + } + set A(x) { + x = moduleA; + } + } +==== aliasUsage1_backbone.ts (1 errors) ==== + export class Model { + public someData: string; + ~~~~~~~~ +!!! error TS2564: Property 'someData' has no initializer and is not definitely assigned in the constructor. + } + +==== aliasUsage1_moduleA.ts (0 errors) ==== + import Backbone = require("./aliasUsage1_backbone"); + export class VisualizationModel extends Backbone.Model { + // interesting stuff here + } + \ No newline at end of file diff --git a/tests/baselines/reference/aliasUsageInAccessorsOfClass(target=es5).errors.txt b/tests/baselines/reference/aliasUsageInAccessorsOfClass(target=es5).errors.txt index 89d33d97c1d39..58dbecfece425 100644 --- a/tests/baselines/reference/aliasUsageInAccessorsOfClass(target=es5).errors.txt +++ b/tests/baselines/reference/aliasUsageInAccessorsOfClass(target=es5).errors.txt @@ -1,8 +1,10 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +aliasUsage1_backbone.ts(2,12): error TS2564: Property 'someData' has no initializer and is not definitely assigned in the constructor. +aliasUsage1_main.ts(7,5): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== aliasUsage1_main.ts (0 errors) ==== +==== aliasUsage1_main.ts (1 errors) ==== import Backbone = require("./aliasUsage1_backbone"); import moduleA = require("./aliasUsage1_moduleA"); interface IHasVisualizationModel { @@ -10,6 +12,8 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in Typ } class C2 { x: IHasVisualizationModel; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. get A() { return this.x; } @@ -17,9 +21,11 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in Typ x = moduleA; } } -==== aliasUsage1_backbone.ts (0 errors) ==== +==== aliasUsage1_backbone.ts (1 errors) ==== export class Model { public someData: string; + ~~~~~~~~ +!!! error TS2564: Property 'someData' has no initializer and is not definitely assigned in the constructor. } ==== aliasUsage1_moduleA.ts (0 errors) ==== diff --git a/tests/baselines/reference/aliasUsageInArray.errors.txt b/tests/baselines/reference/aliasUsageInArray.errors.txt new file mode 100644 index 0000000000000..642baa33ba8e2 --- /dev/null +++ b/tests/baselines/reference/aliasUsageInArray.errors.txt @@ -0,0 +1,25 @@ +aliasUsageInArray_backbone.ts(2,12): error TS2564: Property 'someData' has no initializer and is not definitely assigned in the constructor. + + +==== aliasUsageInArray_main.ts (0 errors) ==== + import Backbone = require("./aliasUsageInArray_backbone"); + import moduleA = require("./aliasUsageInArray_moduleA"); + interface IHasVisualizationModel { + VisualizationModel: typeof Backbone.Model; + } + + var xs: IHasVisualizationModel[] = [moduleA]; + var xs2: typeof moduleA[] = [moduleA]; +==== aliasUsageInArray_backbone.ts (1 errors) ==== + export class Model { + public someData: string; + ~~~~~~~~ +!!! error TS2564: Property 'someData' has no initializer and is not definitely assigned in the constructor. + } + +==== aliasUsageInArray_moduleA.ts (0 errors) ==== + import Backbone = require("./aliasUsageInArray_backbone"); + export class VisualizationModel extends Backbone.Model { + // interesting stuff here + } + \ No newline at end of file diff --git a/tests/baselines/reference/aliasUsageInFunctionExpression.errors.txt b/tests/baselines/reference/aliasUsageInFunctionExpression.errors.txt new file mode 100644 index 0000000000000..183ab038f28d7 --- /dev/null +++ b/tests/baselines/reference/aliasUsageInFunctionExpression.errors.txt @@ -0,0 +1,24 @@ +aliasUsageInFunctionExpression_backbone.ts(2,12): error TS2564: Property 'someData' has no initializer and is not definitely assigned in the constructor. + + +==== aliasUsageInFunctionExpression_main.ts (0 errors) ==== + import Backbone = require("./aliasUsageInFunctionExpression_backbone"); + import moduleA = require("./aliasUsageInFunctionExpression_moduleA"); + interface IHasVisualizationModel { + VisualizationModel: typeof Backbone.Model; + } + var f = (x: IHasVisualizationModel) => x; + f = (x) => moduleA; +==== aliasUsageInFunctionExpression_backbone.ts (1 errors) ==== + export class Model { + public someData: string; + ~~~~~~~~ +!!! error TS2564: Property 'someData' has no initializer and is not definitely assigned in the constructor. + } + +==== aliasUsageInFunctionExpression_moduleA.ts (0 errors) ==== + import Backbone = require("./aliasUsageInFunctionExpression_backbone"); + export class VisualizationModel extends Backbone.Model { + // interesting stuff here + } + \ No newline at end of file diff --git a/tests/baselines/reference/aliasUsageInGenericFunction.errors.txt b/tests/baselines/reference/aliasUsageInGenericFunction.errors.txt new file mode 100644 index 0000000000000..a74a44d0a256b --- /dev/null +++ b/tests/baselines/reference/aliasUsageInGenericFunction.errors.txt @@ -0,0 +1,31 @@ +aliasUsageInGenericFunction_backbone.ts(2,12): error TS2564: Property 'someData' has no initializer and is not definitely assigned in the constructor. +aliasUsageInGenericFunction_main.ts(10,19): error TS2352: Conversion of type 'null' to type 'IHasVisualizationModel' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. + + +==== aliasUsageInGenericFunction_main.ts (1 errors) ==== + import Backbone = require("./aliasUsageInGenericFunction_backbone"); + import moduleA = require("./aliasUsageInGenericFunction_moduleA"); + interface IHasVisualizationModel { + VisualizationModel: typeof Backbone.Model; + } + function foo(x: T) { + return x; + } + var r = foo({ a: moduleA }); + var r2 = foo({ a: null }); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2352: Conversion of type 'null' to type 'IHasVisualizationModel' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. + +==== aliasUsageInGenericFunction_backbone.ts (1 errors) ==== + export class Model { + public someData: string; + ~~~~~~~~ +!!! error TS2564: Property 'someData' has no initializer and is not definitely assigned in the constructor. + } + +==== aliasUsageInGenericFunction_moduleA.ts (0 errors) ==== + import Backbone = require("./aliasUsageInGenericFunction_backbone"); + export class VisualizationModel extends Backbone.Model { + // interesting stuff here + } + \ No newline at end of file diff --git a/tests/baselines/reference/aliasUsageInIndexerOfClass.errors.txt b/tests/baselines/reference/aliasUsageInIndexerOfClass.errors.txt new file mode 100644 index 0000000000000..c0beabe02f590 --- /dev/null +++ b/tests/baselines/reference/aliasUsageInIndexerOfClass.errors.txt @@ -0,0 +1,33 @@ +aliasUsageInIndexerOfClass_backbone.ts(2,12): error TS2564: Property 'someData' has no initializer and is not definitely assigned in the constructor. +aliasUsageInIndexerOfClass_main.ts(12,5): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. + + +==== aliasUsageInIndexerOfClass_main.ts (1 errors) ==== + import Backbone = require("./aliasUsageInIndexerOfClass_backbone"); + import moduleA = require("./aliasUsageInIndexerOfClass_moduleA"); + interface IHasVisualizationModel { + VisualizationModel: typeof Backbone.Model; + } + class N { + [idx: string]: IHasVisualizationModel + x = moduleA; + } + class N2 { + [idx: string]: typeof moduleA + x: IHasVisualizationModel; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. + } +==== aliasUsageInIndexerOfClass_backbone.ts (1 errors) ==== + export class Model { + public someData: string; + ~~~~~~~~ +!!! error TS2564: Property 'someData' has no initializer and is not definitely assigned in the constructor. + } + +==== aliasUsageInIndexerOfClass_moduleA.ts (0 errors) ==== + import Backbone = require("./aliasUsageInIndexerOfClass_backbone"); + export class VisualizationModel extends Backbone.Model { + // interesting stuff here + } + \ No newline at end of file diff --git a/tests/baselines/reference/aliasUsageInObjectLiteral.errors.txt b/tests/baselines/reference/aliasUsageInObjectLiteral.errors.txt new file mode 100644 index 0000000000000..a27eba14ae988 --- /dev/null +++ b/tests/baselines/reference/aliasUsageInObjectLiteral.errors.txt @@ -0,0 +1,25 @@ +aliasUsageInObjectLiteral_backbone.ts(2,12): error TS2564: Property 'someData' has no initializer and is not definitely assigned in the constructor. + + +==== aliasUsageInObjectLiteral_main.ts (0 errors) ==== + import Backbone = require("./aliasUsageInObjectLiteral_backbone"); + import moduleA = require("./aliasUsageInObjectLiteral_moduleA"); + interface IHasVisualizationModel { + VisualizationModel: typeof Backbone.Model; + } + var a: { x: typeof moduleA } = { x: moduleA }; + var b: { x: IHasVisualizationModel } = { x: moduleA }; + var c: { y: { z: IHasVisualizationModel } } = { y: { z: moduleA } }; +==== aliasUsageInObjectLiteral_backbone.ts (1 errors) ==== + export class Model { + public someData: string; + ~~~~~~~~ +!!! error TS2564: Property 'someData' has no initializer and is not definitely assigned in the constructor. + } + +==== aliasUsageInObjectLiteral_moduleA.ts (0 errors) ==== + import Backbone = require("./aliasUsageInObjectLiteral_backbone"); + export class VisualizationModel extends Backbone.Model { + // interesting stuff here + } + \ No newline at end of file diff --git a/tests/baselines/reference/aliasUsageInOrExpression.errors.txt b/tests/baselines/reference/aliasUsageInOrExpression.errors.txt index 85113b6a55d79..7b26c4df03fbe 100644 --- a/tests/baselines/reference/aliasUsageInOrExpression.errors.txt +++ b/tests/baselines/reference/aliasUsageInOrExpression.errors.txt @@ -1,8 +1,13 @@ +aliasUsageInOrExpression_backbone.ts(2,12): error TS2564: Property 'someData' has no initializer and is not definitely assigned in the constructor. +aliasUsageInOrExpression_main.ts(10,40): error TS2352: Conversion of type 'null' to type '{ x: IHasVisualizationModel; }' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. aliasUsageInOrExpression_main.ts(10,40): error TS2873: This kind of expression is always falsy. +aliasUsageInOrExpression_main.ts(11,5): error TS2322: Type '{ x: typeof import("aliasUsageInOrExpression_moduleA"); } | null' is not assignable to type '{ x: IHasVisualizationModel; }'. + Type 'null' is not assignable to type '{ x: IHasVisualizationModel; }'. +aliasUsageInOrExpression_main.ts(11,40): error TS2352: Conversion of type 'null' to type '{ x: IHasVisualizationModel; }' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. aliasUsageInOrExpression_main.ts(11,40): error TS2873: This kind of expression is always falsy. -==== aliasUsageInOrExpression_main.ts (2 errors) ==== +==== aliasUsageInOrExpression_main.ts (5 errors) ==== import Backbone = require("./aliasUsageInOrExpression_backbone"); import moduleA = require("./aliasUsageInOrExpression_moduleA"); interface IHasVisualizationModel { @@ -14,13 +19,22 @@ aliasUsageInOrExpression_main.ts(11,40): error TS2873: This kind of expression i var d2: IHasVisualizationModel = moduleA || i; var e: { x: IHasVisualizationModel } = <{ x: IHasVisualizationModel }>null || { x: moduleA }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2352: Conversion of type 'null' to type '{ x: IHasVisualizationModel; }' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2873: This kind of expression is always falsy. var f: { x: IHasVisualizationModel } = <{ x: IHasVisualizationModel }>null ? { x: moduleA } : null; + ~ +!!! error TS2322: Type '{ x: typeof import("aliasUsageInOrExpression_moduleA"); } | null' is not assignable to type '{ x: IHasVisualizationModel; }'. +!!! error TS2322: Type 'null' is not assignable to type '{ x: IHasVisualizationModel; }'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2352: Conversion of type 'null' to type '{ x: IHasVisualizationModel; }' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2873: This kind of expression is always falsy. -==== aliasUsageInOrExpression_backbone.ts (0 errors) ==== +==== aliasUsageInOrExpression_backbone.ts (1 errors) ==== export class Model { public someData: string; + ~~~~~~~~ +!!! error TS2564: Property 'someData' has no initializer and is not definitely assigned in the constructor. } ==== aliasUsageInOrExpression_moduleA.ts (0 errors) ==== diff --git a/tests/baselines/reference/aliasUsageInOrExpression.types b/tests/baselines/reference/aliasUsageInOrExpression.types index ab24f27750295..0d7c457833f86 100644 --- a/tests/baselines/reference/aliasUsageInOrExpression.types +++ b/tests/baselines/reference/aliasUsageInOrExpression.types @@ -47,8 +47,8 @@ var d2: IHasVisualizationModel = i || moduleA; var d2: IHasVisualizationModel = moduleA || i; >d2 : IHasVisualizationModel > : ^^^^^^^^^^^^^^^^^^^^^^ ->moduleA || i : IHasVisualizationModel -> : ^^^^^^^^^^^^^^^^^^^^^^ +>moduleA || i : typeof moduleA +> : ^^^^^^^^^^^^^^ >moduleA : typeof moduleA > : ^^^^^^^^^^^^^^ >i : IHasVisualizationModel @@ -77,8 +77,8 @@ var f: { x: IHasVisualizationModel } = <{ x: IHasVisualizationModel }>null ? { x > : ^^^^^ ^^^ >x : IHasVisualizationModel > : ^^^^^^^^^^^^^^^^^^^^^^ -><{ x: IHasVisualizationModel }>null ? { x: moduleA } : null : { x: typeof moduleA; } -> : ^^^^^^^^^^^^^^^^^^^^^^ +><{ x: IHasVisualizationModel }>null ? { x: moduleA } : null : { x: typeof moduleA; } | null +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ><{ x: IHasVisualizationModel }>null : { x: IHasVisualizationModel; } > : ^^^^^ ^^^ >x : IHasVisualizationModel diff --git a/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.errors.txt b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.errors.txt new file mode 100644 index 0000000000000..15fa323d79543 --- /dev/null +++ b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.errors.txt @@ -0,0 +1,31 @@ +aliasUsageInTypeArgumentOfExtendsClause_backbone.ts(2,12): error TS2564: Property 'someData' has no initializer and is not definitely assigned in the constructor. +aliasUsageInTypeArgumentOfExtendsClause_main.ts(7,5): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. + + +==== aliasUsageInTypeArgumentOfExtendsClause_main.ts (1 errors) ==== + import Backbone = require("./aliasUsageInTypeArgumentOfExtendsClause_backbone"); + import moduleA = require("./aliasUsageInTypeArgumentOfExtendsClause_moduleA"); + interface IHasVisualizationModel { + VisualizationModel: typeof Backbone.Model; + } + class C { + x: T; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. + } + class D extends C { + x = moduleA; + } +==== aliasUsageInTypeArgumentOfExtendsClause_backbone.ts (1 errors) ==== + export class Model { + public someData: string; + ~~~~~~~~ +!!! error TS2564: Property 'someData' has no initializer and is not definitely assigned in the constructor. + } + +==== aliasUsageInTypeArgumentOfExtendsClause_moduleA.ts (0 errors) ==== + import Backbone = require("./aliasUsageInTypeArgumentOfExtendsClause_backbone"); + export class VisualizationModel extends Backbone.Model { + // interesting stuff here + } + \ No newline at end of file diff --git a/tests/baselines/reference/aliasUsageInVarAssignment.errors.txt b/tests/baselines/reference/aliasUsageInVarAssignment.errors.txt new file mode 100644 index 0000000000000..e2da482ffc92c --- /dev/null +++ b/tests/baselines/reference/aliasUsageInVarAssignment.errors.txt @@ -0,0 +1,27 @@ +aliasUsageInVarAssignment_backbone.ts(2,12): error TS2564: Property 'someData' has no initializer and is not definitely assigned in the constructor. +aliasUsageInVarAssignment_main.ts(7,25): error TS2454: Variable 'i' is used before being assigned. + + +==== aliasUsageInVarAssignment_main.ts (1 errors) ==== + import Backbone = require("./aliasUsageInVarAssignment_backbone"); + import moduleA = require("./aliasUsageInVarAssignment_moduleA"); + interface IHasVisualizationModel { + VisualizationModel: typeof Backbone.Model; + } + var i: IHasVisualizationModel; + var m: typeof moduleA = i; + ~ +!!! error TS2454: Variable 'i' is used before being assigned. +==== aliasUsageInVarAssignment_backbone.ts (1 errors) ==== + export class Model { + public someData: string; + ~~~~~~~~ +!!! error TS2564: Property 'someData' has no initializer and is not definitely assigned in the constructor. + } + +==== aliasUsageInVarAssignment_moduleA.ts (0 errors) ==== + import Backbone = require("./aliasUsageInVarAssignment_backbone"); + export class VisualizationModel extends Backbone.Model { + // interesting stuff here + } + \ No newline at end of file diff --git a/tests/baselines/reference/allowSyntheticDefaultImports3.errors.txt b/tests/baselines/reference/allowSyntheticDefaultImports3.errors.txt index 46ca261dcf94d..3a2bb5b72e135 100644 --- a/tests/baselines/reference/allowSyntheticDefaultImports3.errors.txt +++ b/tests/baselines/reference/allowSyntheticDefaultImports3.errors.txt @@ -1,6 +1,7 @@ error TS5107: Option 'allowSyntheticDefaultImports=false' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. error TS5107: Option 'module=System' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. a.ts(1,8): error TS1192: Module '"b"' has no default export. +b.ts(2,2): error TS2564: Property 'member' has no initializer and is not definitely assigned in the constructor. !!! error TS5107: Option 'allowSyntheticDefaultImports=false' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. @@ -11,8 +12,10 @@ a.ts(1,8): error TS1192: Module '"b"' has no default export. !!! error TS1192: Module '"b"' has no default export. export var x = new Namespace.Foo(); -==== b.ts (0 errors) ==== +==== b.ts (1 errors) ==== export class Foo { member: string; + ~~~~~~ +!!! error TS2564: Property 'member' has no initializer and is not definitely assigned in the constructor. } \ No newline at end of file diff --git a/tests/baselines/reference/allowUnescapedParagraphAndLineSeparatorsInStringLiteral.js b/tests/baselines/reference/allowUnescapedParagraphAndLineSeparatorsInStringLiteral.js index c54c62dd3d2f0..7db1b6d5465a3 100644 --- a/tests/baselines/reference/allowUnescapedParagraphAndLineSeparatorsInStringLiteral.js +++ b/tests/baselines/reference/allowUnescapedParagraphAndLineSeparatorsInStringLiteral.js @@ -27,6 +27,7 @@ var arr = [ ]; //// [allowUnescapedParagraphAndLineSeparatorsInStringLiteral.js] +"use strict"; // Strings containing unescaped line / paragraph separators // Using both single quotes, double quotes and template literals var stringContainingUnescapedLineSeparator1 = "
STRING_CONTENT
"; diff --git a/tests/baselines/reference/alwaysStrict.types b/tests/baselines/reference/alwaysStrict.types index 07f1ada053cf9..146ad10dee810 100644 --- a/tests/baselines/reference/alwaysStrict.types +++ b/tests/baselines/reference/alwaysStrict.types @@ -8,6 +8,6 @@ function f() { var arguments = []; >arguments : any[] > : ^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ } diff --git a/tests/baselines/reference/alwaysStrictAlreadyUseStrict.types b/tests/baselines/reference/alwaysStrictAlreadyUseStrict.types index 3c9539d27bda6..08528082ae5be 100644 --- a/tests/baselines/reference/alwaysStrictAlreadyUseStrict.types +++ b/tests/baselines/reference/alwaysStrictAlreadyUseStrict.types @@ -12,6 +12,6 @@ function f() { var a = []; >a : any[] > : ^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ } diff --git a/tests/baselines/reference/alwaysStrictDeprecation.errors.txt b/tests/baselines/reference/alwaysStrictDeprecation.errors.txt new file mode 100644 index 0000000000000..022c45ebf2369 --- /dev/null +++ b/tests/baselines/reference/alwaysStrictDeprecation.errors.txt @@ -0,0 +1,15 @@ +/foo/tsconfig.json(3,25): error TS5107: Option 'alwaysStrict=false' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. + + +==== /foo/tsconfig.json (1 errors) ==== + { + "compilerOptions": { + "alwaysStrict": false + ~~~~~ +!!! error TS5107: Option 'alwaysStrict=false' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. + } + } + +==== /foo/a.ts (0 errors) ==== + const a = 1; + \ No newline at end of file diff --git a/tests/baselines/reference/alwaysStrictDeprecation.js b/tests/baselines/reference/alwaysStrictDeprecation.js new file mode 100644 index 0000000000000..fb6ba5d645bfc --- /dev/null +++ b/tests/baselines/reference/alwaysStrictDeprecation.js @@ -0,0 +1,8 @@ +//// [tests/cases/compiler/alwaysStrictDeprecation.ts] //// + +//// [a.ts] +const a = 1; + + +//// [a.js] +const a = 1; diff --git a/tests/baselines/reference/alwaysStrictDeprecation.symbols b/tests/baselines/reference/alwaysStrictDeprecation.symbols new file mode 100644 index 0000000000000..b7f2e1f27ecd7 --- /dev/null +++ b/tests/baselines/reference/alwaysStrictDeprecation.symbols @@ -0,0 +1,6 @@ +//// [tests/cases/compiler/alwaysStrictDeprecation.ts] //// + +=== /foo/a.ts === +const a = 1; +>a : Symbol(a, Decl(a.ts, 0, 5)) + diff --git a/tests/baselines/reference/alwaysStrictDeprecation.types b/tests/baselines/reference/alwaysStrictDeprecation.types new file mode 100644 index 0000000000000..e333b2124670c --- /dev/null +++ b/tests/baselines/reference/alwaysStrictDeprecation.types @@ -0,0 +1,9 @@ +//// [tests/cases/compiler/alwaysStrictDeprecation.ts] //// + +=== /foo/a.ts === +const a = 1; +>a : 1 +> : ^ +>1 : 1 +> : ^ + diff --git a/tests/baselines/reference/alwaysStrictDeprecationSilenced.js b/tests/baselines/reference/alwaysStrictDeprecationSilenced.js new file mode 100644 index 0000000000000..a4e577a98d7e2 --- /dev/null +++ b/tests/baselines/reference/alwaysStrictDeprecationSilenced.js @@ -0,0 +1,8 @@ +//// [tests/cases/compiler/alwaysStrictDeprecationSilenced.ts] //// + +//// [a.ts] +const a = 1; + + +//// [a.js] +const a = 1; diff --git a/tests/baselines/reference/alwaysStrictDeprecationSilenced.symbols b/tests/baselines/reference/alwaysStrictDeprecationSilenced.symbols new file mode 100644 index 0000000000000..6156f09729ded --- /dev/null +++ b/tests/baselines/reference/alwaysStrictDeprecationSilenced.symbols @@ -0,0 +1,6 @@ +//// [tests/cases/compiler/alwaysStrictDeprecationSilenced.ts] //// + +=== /foo/a.ts === +const a = 1; +>a : Symbol(a, Decl(a.ts, 0, 5)) + diff --git a/tests/baselines/reference/alwaysStrictDeprecationSilenced.types b/tests/baselines/reference/alwaysStrictDeprecationSilenced.types new file mode 100644 index 0000000000000..3797936457f1d --- /dev/null +++ b/tests/baselines/reference/alwaysStrictDeprecationSilenced.types @@ -0,0 +1,9 @@ +//// [tests/cases/compiler/alwaysStrictDeprecationSilenced.ts] //// + +=== /foo/a.ts === +const a = 1; +>a : 1 +> : ^ +>1 : 1 +> : ^ + diff --git a/tests/baselines/reference/alwaysStrictES6.types b/tests/baselines/reference/alwaysStrictES6.types index 810f1df237033..b74a698c3cd2b 100644 --- a/tests/baselines/reference/alwaysStrictES6.types +++ b/tests/baselines/reference/alwaysStrictES6.types @@ -8,6 +8,6 @@ function f() { var arguments = []; >arguments : any[] > : ^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ } diff --git a/tests/baselines/reference/alwaysStrictModule.types b/tests/baselines/reference/alwaysStrictModule.types index 3b252aa993f23..0dda587830eaf 100644 --- a/tests/baselines/reference/alwaysStrictModule.types +++ b/tests/baselines/reference/alwaysStrictModule.types @@ -12,7 +12,7 @@ namespace M { var arguments = []; >arguments : any[] > : ^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ } } diff --git a/tests/baselines/reference/alwaysStrictModule2.types b/tests/baselines/reference/alwaysStrictModule2.types index 56ca19f0b36b0..6a5470124da7c 100644 --- a/tests/baselines/reference/alwaysStrictModule2.types +++ b/tests/baselines/reference/alwaysStrictModule2.types @@ -12,8 +12,8 @@ namespace M { var arguments = []; >arguments : any[] > : ^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ } } @@ -29,7 +29,7 @@ namespace M { var arguments = []; >arguments : any[] > : ^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ } } diff --git a/tests/baselines/reference/alwaysStrictNoImplicitUseStrict.types b/tests/baselines/reference/alwaysStrictNoImplicitUseStrict.types index 7199bbe3c816b..94fff0555ba38 100644 --- a/tests/baselines/reference/alwaysStrictNoImplicitUseStrict.types +++ b/tests/baselines/reference/alwaysStrictNoImplicitUseStrict.types @@ -12,7 +12,7 @@ namespace M { var arguments = []; >arguments : any[] > : ^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ } } diff --git a/tests/baselines/reference/ambientAccessors(target=es2015).js b/tests/baselines/reference/ambientAccessors(target=es2015).js index f9835d3460dd9..d88518695b26d 100644 --- a/tests/baselines/reference/ambientAccessors(target=es2015).js +++ b/tests/baselines/reference/ambientAccessors(target=es2015).js @@ -17,6 +17,7 @@ declare class C { } //// [ambientAccessors.js] +"use strict"; //// [ambientAccessors.d.ts] diff --git a/tests/baselines/reference/ambientAccessors(target=es5).js b/tests/baselines/reference/ambientAccessors(target=es5).js index f9835d3460dd9..d88518695b26d 100644 --- a/tests/baselines/reference/ambientAccessors(target=es5).js +++ b/tests/baselines/reference/ambientAccessors(target=es5).js @@ -17,6 +17,7 @@ declare class C { } //// [ambientAccessors.js] +"use strict"; //// [ambientAccessors.d.ts] diff --git a/tests/baselines/reference/ambientClassDeclarationWithExtends.js b/tests/baselines/reference/ambientClassDeclarationWithExtends.js index 1b7bcf88b2084..b1d00a84c2dc6 100644 --- a/tests/baselines/reference/ambientClassDeclarationWithExtends.js +++ b/tests/baselines/reference/ambientClassDeclarationWithExtends.js @@ -24,15 +24,18 @@ var f: E = new F(); //// [ambientClassDeclarationExtends_singleFile.js] +"use strict"; var D; (function (D) { var x; })(D || (D = {})); var d = new D(); //// [ambientClassDeclarationExtends_file1.js] +"use strict"; var F; (function (F) { var y; })(F || (F = {})); //// [ambientClassDeclarationExtends_file2.js] +"use strict"; var f = new F(); diff --git a/tests/baselines/reference/ambientClassMergesOverloadsWithInterface.js b/tests/baselines/reference/ambientClassMergesOverloadsWithInterface.js index 65fa42abc0c1c..a07d4c7932958 100644 --- a/tests/baselines/reference/ambientClassMergesOverloadsWithInterface.js +++ b/tests/baselines/reference/ambientClassMergesOverloadsWithInterface.js @@ -12,3 +12,4 @@ interface C { //// [ambientClassMergesOverloadsWithInterface.js] +"use strict"; diff --git a/tests/baselines/reference/ambientClassOverloadForFunction.js b/tests/baselines/reference/ambientClassOverloadForFunction.js index cda770e893fdc..b3193ccce912e 100644 --- a/tests/baselines/reference/ambientClassOverloadForFunction.js +++ b/tests/baselines/reference/ambientClassOverloadForFunction.js @@ -6,5 +6,6 @@ function foo() { return null; } //// [ambientClassOverloadForFunction.js] +"use strict"; ; function foo() { return null; } diff --git a/tests/baselines/reference/ambientConstLiterals.js b/tests/baselines/reference/ambientConstLiterals.js index ebdf5daeff362..d6d02c6d3195a 100644 --- a/tests/baselines/reference/ambientConstLiterals.js +++ b/tests/baselines/reference/ambientConstLiterals.js @@ -24,6 +24,7 @@ const c13 = Math.random() > 0.5 ? "abc" : "def"; const c14 = Math.random() > 0.5 ? 123 : 456; //// [ambientConstLiterals.js] +"use strict"; function f(x) { return x; } diff --git a/tests/baselines/reference/ambientDeclarations.js b/tests/baselines/reference/ambientDeclarations.js index 51c77dcb33df3..28b568f6cea64 100644 --- a/tests/baselines/reference/ambientDeclarations.js +++ b/tests/baselines/reference/ambientDeclarations.js @@ -79,6 +79,7 @@ declare module 'external1' { //// [ambientDeclarations.js] +"use strict"; var x = E3.B; // Ambient module members are always exported with or without export keyword var p = M1.x; diff --git a/tests/baselines/reference/ambientDeclarationsExternal.js b/tests/baselines/reference/ambientDeclarationsExternal.js index 872ca9f1f8041..1bfbc90825013 100644 --- a/tests/baselines/reference/ambientDeclarationsExternal.js +++ b/tests/baselines/reference/ambientDeclarationsExternal.js @@ -24,6 +24,7 @@ var n: number; //// [decls.js] +"use strict"; // Ambient external import declaration referencing ambient external module using top level module name //// [consumer.js] "use strict"; diff --git a/tests/baselines/reference/ambientDeclarationsPatterns_merging1.js b/tests/baselines/reference/ambientDeclarationsPatterns_merging1.js index 7ffe5313a13c1..a3213e1881844 100644 --- a/tests/baselines/reference/ambientDeclarationsPatterns_merging1.js +++ b/tests/baselines/reference/ambientDeclarationsPatterns_merging1.js @@ -17,6 +17,7 @@ import { everywhere, onlyInA } from "b.foo"; // Error //// [types.js] +"use strict"; //// [testA.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tests/baselines/reference/ambientDeclarationsPatterns_merging2.js b/tests/baselines/reference/ambientDeclarationsPatterns_merging2.js index 97c32855f449e..1833511e82b08 100644 --- a/tests/baselines/reference/ambientDeclarationsPatterns_merging2.js +++ b/tests/baselines/reference/ambientDeclarationsPatterns_merging2.js @@ -19,6 +19,7 @@ declare module "a.foo" { } //// [types.js] +"use strict"; //// [testA.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tests/baselines/reference/ambientDeclarationsPatterns_merging3.js b/tests/baselines/reference/ambientDeclarationsPatterns_merging3.js index 63645257d8e7c..67a35bc03c37d 100644 --- a/tests/baselines/reference/ambientDeclarationsPatterns_merging3.js +++ b/tests/baselines/reference/ambientDeclarationsPatterns_merging3.js @@ -15,6 +15,7 @@ ohno.a // oh no //// [types.js] +"use strict"; //// [test.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tests/baselines/reference/ambientDeclarationsPatterns_tooManyAsterisks.js b/tests/baselines/reference/ambientDeclarationsPatterns_tooManyAsterisks.js index 912a1132ba3e5..0e881b7e50f35 100644 --- a/tests/baselines/reference/ambientDeclarationsPatterns_tooManyAsterisks.js +++ b/tests/baselines/reference/ambientDeclarationsPatterns_tooManyAsterisks.js @@ -5,3 +5,4 @@ declare module "too*many*asterisks" { } //// [ambientDeclarationsPatterns_tooManyAsterisks.js] +"use strict"; diff --git a/tests/baselines/reference/ambientEnum1.js b/tests/baselines/reference/ambientEnum1.js index f79ceb09810ae..acff38d706129 100644 --- a/tests/baselines/reference/ambientEnum1.js +++ b/tests/baselines/reference/ambientEnum1.js @@ -11,3 +11,4 @@ } //// [ambientEnum1.js] +"use strict"; diff --git a/tests/baselines/reference/ambientEnumDeclaration1.js b/tests/baselines/reference/ambientEnumDeclaration1.js index 392815014a0cf..33ef6b0b93304 100644 --- a/tests/baselines/reference/ambientEnumDeclaration1.js +++ b/tests/baselines/reference/ambientEnumDeclaration1.js @@ -12,4 +12,5 @@ declare enum E { } //// [ambientEnumDeclaration1.js] +"use strict"; // In ambient enum declarations, all values specified in enum member declarations must be classified as constant enum expressions. diff --git a/tests/baselines/reference/ambientEnumDeclaration2.js b/tests/baselines/reference/ambientEnumDeclaration2.js index 52b0c859f0c0c..d20d8b43873cf 100644 --- a/tests/baselines/reference/ambientEnumDeclaration2.js +++ b/tests/baselines/reference/ambientEnumDeclaration2.js @@ -15,5 +15,6 @@ declare const enum E1 { } //// [ambientEnumDeclaration2.js] +"use strict"; // In ambient enum declarations that specify no const modifier, enum member declarations // that omit a value are considered computed members (as opposed to having auto- incremented values assigned). diff --git a/tests/baselines/reference/ambientEnumElementInitializer1.js b/tests/baselines/reference/ambientEnumElementInitializer1.js index 6d149cc3789bb..0348763b44570 100644 --- a/tests/baselines/reference/ambientEnumElementInitializer1.js +++ b/tests/baselines/reference/ambientEnumElementInitializer1.js @@ -6,3 +6,4 @@ declare enum E { } //// [ambientEnumElementInitializer1.js] +"use strict"; diff --git a/tests/baselines/reference/ambientEnumElementInitializer2.js b/tests/baselines/reference/ambientEnumElementInitializer2.js index 1521ff937cc39..ffa306c0af7d9 100644 --- a/tests/baselines/reference/ambientEnumElementInitializer2.js +++ b/tests/baselines/reference/ambientEnumElementInitializer2.js @@ -6,3 +6,4 @@ declare enum E { } //// [ambientEnumElementInitializer2.js] +"use strict"; diff --git a/tests/baselines/reference/ambientEnumElementInitializer3.js b/tests/baselines/reference/ambientEnumElementInitializer3.js index c490d76afef61..b2c1bce9f2893 100644 --- a/tests/baselines/reference/ambientEnumElementInitializer3.js +++ b/tests/baselines/reference/ambientEnumElementInitializer3.js @@ -6,3 +6,4 @@ declare enum E { } //// [ambientEnumElementInitializer3.js] +"use strict"; diff --git a/tests/baselines/reference/ambientEnumElementInitializer4.js b/tests/baselines/reference/ambientEnumElementInitializer4.js index 57c0c83c79238..3bd38ea249089 100644 --- a/tests/baselines/reference/ambientEnumElementInitializer4.js +++ b/tests/baselines/reference/ambientEnumElementInitializer4.js @@ -6,3 +6,4 @@ declare enum E { } //// [ambientEnumElementInitializer4.js] +"use strict"; diff --git a/tests/baselines/reference/ambientEnumElementInitializer5.js b/tests/baselines/reference/ambientEnumElementInitializer5.js index c262e98e9b9e8..57f90f616714b 100644 --- a/tests/baselines/reference/ambientEnumElementInitializer5.js +++ b/tests/baselines/reference/ambientEnumElementInitializer5.js @@ -6,3 +6,4 @@ declare enum E { } //// [ambientEnumElementInitializer5.js] +"use strict"; diff --git a/tests/baselines/reference/ambientEnumElementInitializer6.js b/tests/baselines/reference/ambientEnumElementInitializer6.js index 59e6b64781a86..8e4ead9804355 100644 --- a/tests/baselines/reference/ambientEnumElementInitializer6.js +++ b/tests/baselines/reference/ambientEnumElementInitializer6.js @@ -8,3 +8,4 @@ declare namespace M { } //// [ambientEnumElementInitializer6.js] +"use strict"; diff --git a/tests/baselines/reference/ambientErrors.js b/tests/baselines/reference/ambientErrors.js index 3997413b62abc..314361829881b 100644 --- a/tests/baselines/reference/ambientErrors.js +++ b/tests/baselines/reference/ambientErrors.js @@ -62,4 +62,5 @@ declare module 'bar' { //// [ambientErrors.js] +"use strict"; ; diff --git a/tests/baselines/reference/ambientErrors1.js b/tests/baselines/reference/ambientErrors1.js index 2e941b4cd7f23..5cd257080f2d6 100644 --- a/tests/baselines/reference/ambientErrors1.js +++ b/tests/baselines/reference/ambientErrors1.js @@ -4,3 +4,4 @@ declare var x = 4; //// [ambientErrors1.js] +"use strict"; diff --git a/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.js b/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.js index 36293e56b69e3..ba2caa15aa766 100644 --- a/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.js +++ b/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.js @@ -6,3 +6,4 @@ namespace M { } //// [ambientExternalModuleInsideNonAmbient.js] +"use strict"; diff --git a/tests/baselines/reference/ambientExternalModuleMerging.js b/tests/baselines/reference/ambientExternalModuleMerging.js index 9dffd75fc8c50..9af61b168d926 100644 --- a/tests/baselines/reference/ambientExternalModuleMerging.js +++ b/tests/baselines/reference/ambientExternalModuleMerging.js @@ -25,3 +25,4 @@ define(["require", "exports", "M"], function (require, exports, M) { var y = M.y; }); //// [ambientExternalModuleMerging_declare.js] +"use strict"; diff --git a/tests/baselines/reference/ambientExternalModuleReopen.js b/tests/baselines/reference/ambientExternalModuleReopen.js index aa8b45cf292a8..00930f0e09f4f 100644 --- a/tests/baselines/reference/ambientExternalModuleReopen.js +++ b/tests/baselines/reference/ambientExternalModuleReopen.js @@ -9,3 +9,4 @@ declare module 'fs' { } //// [ambientExternalModuleReopen.js] +"use strict"; diff --git a/tests/baselines/reference/ambientExternalModuleWithInternalImportDeclaration.js b/tests/baselines/reference/ambientExternalModuleWithInternalImportDeclaration.js index 8f3739c11b49b..7ea2ff7d6d488 100644 --- a/tests/baselines/reference/ambientExternalModuleWithInternalImportDeclaration.js +++ b/tests/baselines/reference/ambientExternalModuleWithInternalImportDeclaration.js @@ -19,6 +19,7 @@ import A = require('M'); var c = new A(); //// [ambientExternalModuleWithInternalImportDeclaration_0.js] +"use strict"; //// [ambientExternalModuleWithInternalImportDeclaration_1.js] define(["require", "exports", "M"], function (require, exports, A) { "use strict"; diff --git a/tests/baselines/reference/ambientExternalModuleWithRelativeExternalImportDeclaration.js b/tests/baselines/reference/ambientExternalModuleWithRelativeExternalImportDeclaration.js index 10c7fecb2c8fc..2f946802a1dc7 100644 --- a/tests/baselines/reference/ambientExternalModuleWithRelativeExternalImportDeclaration.js +++ b/tests/baselines/reference/ambientExternalModuleWithRelativeExternalImportDeclaration.js @@ -13,3 +13,4 @@ declare module "OuterModule" { } //// [ambientExternalModuleWithRelativeExternalImportDeclaration.js] +"use strict"; diff --git a/tests/baselines/reference/ambientExternalModuleWithRelativeModuleName.js b/tests/baselines/reference/ambientExternalModuleWithRelativeModuleName.js index 1dc10e694ca28..b13af46f1524d 100644 --- a/tests/baselines/reference/ambientExternalModuleWithRelativeModuleName.js +++ b/tests/baselines/reference/ambientExternalModuleWithRelativeModuleName.js @@ -10,3 +10,4 @@ declare module ".\\relativeModule" { } //// [ambientExternalModuleWithRelativeModuleName.js] +"use strict"; diff --git a/tests/baselines/reference/ambientExternalModuleWithoutInternalImportDeclaration.js b/tests/baselines/reference/ambientExternalModuleWithoutInternalImportDeclaration.js index 7f53c9b6e037e..16f1e753dfce3 100644 --- a/tests/baselines/reference/ambientExternalModuleWithoutInternalImportDeclaration.js +++ b/tests/baselines/reference/ambientExternalModuleWithoutInternalImportDeclaration.js @@ -18,6 +18,7 @@ import A = require('M'); var c = new A(); //// [ambientExternalModuleWithoutInternalImportDeclaration_0.js] +"use strict"; //// [ambientExternalModuleWithoutInternalImportDeclaration_1.js] define(["require", "exports", "M"], function (require, exports, A) { "use strict"; diff --git a/tests/baselines/reference/ambientFundule.js b/tests/baselines/reference/ambientFundule.js index 6ede114d99e92..c4c6a6d5d9a60 100644 --- a/tests/baselines/reference/ambientFundule.js +++ b/tests/baselines/reference/ambientFundule.js @@ -6,3 +6,4 @@ declare namespace f { var x } declare function f(x); //// [ambientFundule.js] +"use strict"; diff --git a/tests/baselines/reference/ambientGetters(target=es2015).js b/tests/baselines/reference/ambientGetters(target=es2015).js index df95e36dbfd3e..741c0a517e014 100644 --- a/tests/baselines/reference/ambientGetters(target=es2015).js +++ b/tests/baselines/reference/ambientGetters(target=es2015).js @@ -10,3 +10,4 @@ declare class B { } //// [ambientGetters.js] +"use strict"; diff --git a/tests/baselines/reference/ambientGetters(target=es5).js b/tests/baselines/reference/ambientGetters(target=es5).js index df95e36dbfd3e..741c0a517e014 100644 --- a/tests/baselines/reference/ambientGetters(target=es5).js +++ b/tests/baselines/reference/ambientGetters(target=es5).js @@ -10,3 +10,4 @@ declare class B { } //// [ambientGetters.js] +"use strict"; diff --git a/tests/baselines/reference/ambientInsideNonAmbient.js b/tests/baselines/reference/ambientInsideNonAmbient.js index c6388d9939ca2..14053755d6f0f 100644 --- a/tests/baselines/reference/ambientInsideNonAmbient.js +++ b/tests/baselines/reference/ambientInsideNonAmbient.js @@ -18,6 +18,7 @@ namespace M2 { } //// [ambientInsideNonAmbient.js] +"use strict"; var M; (function (M) { })(M || (M = {})); diff --git a/tests/baselines/reference/ambientModuleExports.js b/tests/baselines/reference/ambientModuleExports.js index e4ea4d04c9619..67fb6f6480922 100644 --- a/tests/baselines/reference/ambientModuleExports.js +++ b/tests/baselines/reference/ambientModuleExports.js @@ -22,6 +22,7 @@ Foo2.b; var c2 = new Foo2.C(); //// [ambientModuleExports.js] +"use strict"; Foo.a(); Foo.b; var c = new Foo.C(); diff --git a/tests/baselines/reference/ambientModuleWithClassDeclarationWithExtends.js b/tests/baselines/reference/ambientModuleWithClassDeclarationWithExtends.js index 89af25fa662b2..c9eb7454f87be 100644 --- a/tests/baselines/reference/ambientModuleWithClassDeclarationWithExtends.js +++ b/tests/baselines/reference/ambientModuleWithClassDeclarationWithExtends.js @@ -7,3 +7,4 @@ declare namespace foo { } //// [ambientModuleWithClassDeclarationWithExtends.js] +"use strict"; diff --git a/tests/baselines/reference/ambientModuleWithTemplateLiterals.js b/tests/baselines/reference/ambientModuleWithTemplateLiterals.js index e2fce1a4cd796..c9a5a4a43f775 100644 --- a/tests/baselines/reference/ambientModuleWithTemplateLiterals.js +++ b/tests/baselines/reference/ambientModuleWithTemplateLiterals.js @@ -23,6 +23,7 @@ Foo.d; Foo.e; //// [ambientModuleWithTemplateLiterals.js] +"use strict"; Foo.a; Foo.b; Foo.c; diff --git a/tests/baselines/reference/ambientModules.js b/tests/baselines/reference/ambientModules.js index 2bf38460e61c1..500a11a5237b5 100644 --- a/tests/baselines/reference/ambientModules.js +++ b/tests/baselines/reference/ambientModules.js @@ -5,5 +5,6 @@ declare namespace Foo.Bar { export var foo; }; Foo.Bar.foo = 5; //// [ambientModules.js] +"use strict"; ; Foo.Bar.foo = 5; diff --git a/tests/baselines/reference/ambientRequireFunction(module=commonjs).js b/tests/baselines/reference/ambientRequireFunction(module=commonjs).js index 430403e508cff..4b1edf09d8fc0 100644 --- a/tests/baselines/reference/ambientRequireFunction(module=commonjs).js +++ b/tests/baselines/reference/ambientRequireFunction(module=commonjs).js @@ -14,6 +14,7 @@ const fs = require("fs"); const text = fs.readFileSync("/a/b/c"); //// [app.js] +"use strict"; /// const fs = require("fs"); const text = fs.readFileSync("/a/b/c"); diff --git a/tests/baselines/reference/ambientRequireFunction(module=preserve).js b/tests/baselines/reference/ambientRequireFunction(module=preserve).js index 430403e508cff..4b1edf09d8fc0 100644 --- a/tests/baselines/reference/ambientRequireFunction(module=preserve).js +++ b/tests/baselines/reference/ambientRequireFunction(module=preserve).js @@ -14,6 +14,7 @@ const fs = require("fs"); const text = fs.readFileSync("/a/b/c"); //// [app.js] +"use strict"; /// const fs = require("fs"); const text = fs.readFileSync("/a/b/c"); diff --git a/tests/baselines/reference/ambientShorthand_declarationEmit.js b/tests/baselines/reference/ambientShorthand_declarationEmit.js index 45f27c35b3f37..757c1e0b9c7bc 100644 --- a/tests/baselines/reference/ambientShorthand_declarationEmit.js +++ b/tests/baselines/reference/ambientShorthand_declarationEmit.js @@ -5,6 +5,7 @@ declare module "foo"; //// [ambientShorthand_declarationEmit.js] +"use strict"; //// [ambientShorthand_declarationEmit.d.ts] diff --git a/tests/baselines/reference/ambientStatement1.js b/tests/baselines/reference/ambientStatement1.js index 4143238a2b802..e91dfc8db84e9 100644 --- a/tests/baselines/reference/ambientStatement1.js +++ b/tests/baselines/reference/ambientStatement1.js @@ -8,3 +8,4 @@ } //// [ambientStatement1.js] +"use strict"; diff --git a/tests/baselines/reference/ambientWithStatements.errors.txt b/tests/baselines/reference/ambientWithStatements.errors.txt index bef1bb8c98da0..8d04ac6a78d20 100644 --- a/tests/baselines/reference/ambientWithStatements.errors.txt +++ b/tests/baselines/reference/ambientWithStatements.errors.txt @@ -1,10 +1,12 @@ ambientWithStatements.ts(2,5): error TS1036: Statements are not allowed in ambient contexts. ambientWithStatements.ts(3,5): error TS1104: A 'continue' statement can only be used within an enclosing iteration statement. +ambientWithStatements.ts(10,5): error TS1344: 'A label is not allowed here. ambientWithStatements.ts(11,5): error TS1108: A 'return' statement can only be used within a function body. +ambientWithStatements.ts(25,5): error TS1101: 'with' statements are not allowed in strict mode. ambientWithStatements.ts(25,5): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. -==== ambientWithStatements.ts (4 errors) ==== +==== ambientWithStatements.ts (6 errors) ==== declare namespace M { break; ~~~~~ @@ -19,6 +21,8 @@ ambientWithStatements.ts(25,5): error TS2410: The 'with' statement is not suppor if (true) { } else { } 1; L: var y; + ~ +!!! error TS1344: 'A label is not allowed here. return; ~~~~~~ !!! error TS1108: A 'return' statement can only be used within a function body. @@ -36,6 +40,8 @@ ambientWithStatements.ts(25,5): error TS2410: The 'with' statement is not suppor finally { } with (x) { + ~~~~ +!!! error TS1101: 'with' statements are not allowed in strict mode. ~~~~~~~~ !!! error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. } diff --git a/tests/baselines/reference/ambientWithStatements.js b/tests/baselines/reference/ambientWithStatements.js index d56d11b02142e..860f4d3012866 100644 --- a/tests/baselines/reference/ambientWithStatements.js +++ b/tests/baselines/reference/ambientWithStatements.js @@ -30,3 +30,4 @@ declare namespace M { } //// [ambientWithStatements.js] +"use strict"; diff --git a/tests/baselines/reference/ambiguousCallsWhereReturnTypesAgree.js b/tests/baselines/reference/ambiguousCallsWhereReturnTypesAgree.js index 6d3892807e237..2e48791022f86 100644 --- a/tests/baselines/reference/ambiguousCallsWhereReturnTypesAgree.js +++ b/tests/baselines/reference/ambiguousCallsWhereReturnTypesAgree.js @@ -31,6 +31,7 @@ class TestClass2 { //// [ambiguousCallsWhereReturnTypesAgree.js] +"use strict"; class TestClass { bar(x) { } diff --git a/tests/baselines/reference/ambiguousGenericAssertion1.js b/tests/baselines/reference/ambiguousGenericAssertion1.js index 7c0b0e667cc0a..d4b960dd65c95 100644 --- a/tests/baselines/reference/ambiguousGenericAssertion1.js +++ b/tests/baselines/reference/ambiguousGenericAssertion1.js @@ -8,6 +8,7 @@ var r3 = <(x: T) => T>f; // ambiguous, appears to the parser as a << operatio //// [ambiguousGenericAssertion1.js] +"use strict"; function f(x) { return null; } var r = (x) => x; var r2 = f; // valid diff --git a/tests/baselines/reference/ambiguousOverload.js b/tests/baselines/reference/ambiguousOverload.js index 725b7dafa9039..179f527f99985 100644 --- a/tests/baselines/reference/ambiguousOverload.js +++ b/tests/baselines/reference/ambiguousOverload.js @@ -14,6 +14,7 @@ var x2: string = foof2("s", null); var y2: number = foof2("s", null); //// [ambiguousOverload.js] +"use strict"; function foof(bar) { return bar; } ; var x = foof("s", null); diff --git a/tests/baselines/reference/ambiguousOverloadResolution.js b/tests/baselines/reference/ambiguousOverloadResolution.js index c844269d597ce..9dc3da0ee734c 100644 --- a/tests/baselines/reference/ambiguousOverloadResolution.js +++ b/tests/baselines/reference/ambiguousOverloadResolution.js @@ -11,6 +11,7 @@ var x: B; var t: number = f(x, x); // Not an error //// [ambiguousOverloadResolution.js] +"use strict"; class A { } class B extends A { diff --git a/tests/baselines/reference/anonterface.js b/tests/baselines/reference/anonterface.js index c7e0fa4431e57..bc6bb34b203e4 100644 --- a/tests/baselines/reference/anonterface.js +++ b/tests/baselines/reference/anonterface.js @@ -17,6 +17,7 @@ c.m(function(n) { return "hello: "+n; },18); //// [anonterface.js] +"use strict"; var M; (function (M) { class C { diff --git a/tests/baselines/reference/anonymousClassExpression1.js b/tests/baselines/reference/anonymousClassExpression1.js index 3e5146cc886ec..e788a154841b1 100644 --- a/tests/baselines/reference/anonymousClassExpression1.js +++ b/tests/baselines/reference/anonymousClassExpression1.js @@ -6,6 +6,7 @@ function f() { } //// [anonymousClassExpression1.js] +"use strict"; function f() { return typeof class { } === "function"; diff --git a/tests/baselines/reference/anonymousClassExpression2.js b/tests/baselines/reference/anonymousClassExpression2.js index 015ed36417ebb..71d57f34b2676 100644 --- a/tests/baselines/reference/anonymousClassExpression2.js +++ b/tests/baselines/reference/anonymousClassExpression2.js @@ -21,6 +21,7 @@ while (0) { //// [anonymousClassExpression2.js] +"use strict"; // Fixes #14860 // note: repros with `while (0);` too // but it's less inscrutable and more obvious to put it *inside* the loop diff --git a/tests/baselines/reference/anonymousModules.js b/tests/baselines/reference/anonymousModules.js index 179b05c2c8805..7ff515c33fe22 100644 --- a/tests/baselines/reference/anonymousModules.js +++ b/tests/baselines/reference/anonymousModules.js @@ -16,6 +16,7 @@ module { } //// [anonymousModules.js] +"use strict"; module; { export var foo = 1; diff --git a/tests/baselines/reference/anyAndUnknownHaveFalsyComponents.js b/tests/baselines/reference/anyAndUnknownHaveFalsyComponents.js index 57b210842881a..ee1b8e9c8f219 100644 --- a/tests/baselines/reference/anyAndUnknownHaveFalsyComponents.js +++ b/tests/baselines/reference/anyAndUnknownHaveFalsyComponents.js @@ -31,6 +31,7 @@ function foo2() { //// [anyAndUnknownHaveFalsyComponents.js] +"use strict"; const y1 = x1 && 3; function foo1() { return Object.assign({ display: "block" }, (isTreeHeader1 && { diff --git a/tests/baselines/reference/anyAsConstructor.js b/tests/baselines/reference/anyAsConstructor.js index 52e6fdd48a5aa..cde9ca2aaa115 100644 --- a/tests/baselines/reference/anyAsConstructor.js +++ b/tests/baselines/reference/anyAsConstructor.js @@ -13,6 +13,7 @@ var c = new x(x); var d = new x(x); // no error //// [anyAsConstructor.js] +"use strict"; // any is considered an untyped function call // can be called except with type arguments which is an error var x; diff --git a/tests/baselines/reference/anyAsFunctionCall.js b/tests/baselines/reference/anyAsFunctionCall.js index bb7714cc48dc0..6de7c05f3cc1e 100644 --- a/tests/baselines/reference/anyAsFunctionCall.js +++ b/tests/baselines/reference/anyAsFunctionCall.js @@ -10,6 +10,7 @@ var b = x('hello'); var c = x(x); //// [anyAsFunctionCall.js] +"use strict"; // any is considered an untyped function call // can be called except with type arguments which is an error var x; diff --git a/tests/baselines/reference/anyAsGenericFunctionCall.errors.txt b/tests/baselines/reference/anyAsGenericFunctionCall.errors.txt index 93bd28361b362..93493eb25a2f2 100644 --- a/tests/baselines/reference/anyAsGenericFunctionCall.errors.txt +++ b/tests/baselines/reference/anyAsGenericFunctionCall.errors.txt @@ -1,10 +1,11 @@ anyAsGenericFunctionCall.ts(5,9): error TS2347: Untyped function calls may not accept type arguments. anyAsGenericFunctionCall.ts(6,9): error TS2347: Untyped function calls may not accept type arguments. +anyAsGenericFunctionCall.ts(8,11): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. anyAsGenericFunctionCall.ts(9,9): error TS2347: Untyped function calls may not accept type arguments. anyAsGenericFunctionCall.ts(10,9): error TS2347: Untyped function calls may not accept type arguments. -==== anyAsGenericFunctionCall.ts (4 errors) ==== +==== anyAsGenericFunctionCall.ts (5 errors) ==== // any is considered an untyped function call // can be called except with type arguments which is an error @@ -17,6 +18,8 @@ anyAsGenericFunctionCall.ts(10,9): error TS2347: Untyped function calls may not !!! error TS2347: Untyped function calls may not accept type arguments. class C { foo: string; } + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. var c = x(x); ~~~~~~~ !!! error TS2347: Untyped function calls may not accept type arguments. diff --git a/tests/baselines/reference/anyAsGenericFunctionCall.js b/tests/baselines/reference/anyAsGenericFunctionCall.js index 9f7f9469360f2..55830bc09e570 100644 --- a/tests/baselines/reference/anyAsGenericFunctionCall.js +++ b/tests/baselines/reference/anyAsGenericFunctionCall.js @@ -13,6 +13,7 @@ var c = x(x); var d = x(x); //// [anyAsGenericFunctionCall.js] +"use strict"; // any is considered an untyped function call // can be called except with type arguments which is an error var x; diff --git a/tests/baselines/reference/anyAsReturnTypeForNewOnCall.js b/tests/baselines/reference/anyAsReturnTypeForNewOnCall.js index cbb8d921a64b1..2258b64a07b2a 100644 --- a/tests/baselines/reference/anyAsReturnTypeForNewOnCall.js +++ b/tests/baselines/reference/anyAsReturnTypeForNewOnCall.js @@ -17,6 +17,7 @@ var xx = o.x; //// [anyAsReturnTypeForNewOnCall.js] +"use strict"; function Point(x, y) { this.x = x; this.y = y; diff --git a/tests/baselines/reference/anyAssignabilityInInheritance.js b/tests/baselines/reference/anyAssignabilityInInheritance.js index e297c39e595c0..4fd1eb556bc5a 100644 --- a/tests/baselines/reference/anyAssignabilityInInheritance.js +++ b/tests/baselines/reference/anyAssignabilityInInheritance.js @@ -91,6 +91,7 @@ declare function foo18(x: any): any; var r3 = foo3(a); // any //// [anyAssignabilityInInheritance.js] +"use strict"; // any is not a subtype of any other types, errors expected on all the below derived classes unless otherwise noted var a; 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) diff --git a/tests/baselines/reference/anyAssignableToEveryType.errors.txt b/tests/baselines/reference/anyAssignableToEveryType.errors.txt new file mode 100644 index 0000000000000..b547920a9c06f --- /dev/null +++ b/tests/baselines/reference/anyAssignableToEveryType.errors.txt @@ -0,0 +1,51 @@ +anyAssignableToEveryType.ts(4,5): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. + + +==== anyAssignableToEveryType.ts (1 errors) ==== + var a: any; + + class C { + foo: string; + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. + } + var ac: C; + interface I { + foo: string; + } + var ai: I; + + enum E { A } + var ae: E; + + var b: number = a; + var c: string = a; + var d: boolean = a; + var e: Date = a; + var f: any = a; + var g: void = a; + var h: Object = a; + var i: {} = a; + var j: () => {} = a; + var k: Function = a; + var l: (x: number) => string = a; + ac = a; + ai = a; + ae = a; + var m: number[] = a; + var n: { foo: string } = a; + var o: (x: T) => T = a; + var p: Number = a; + var q: String = a; + + function foo(x: T, y: U, z: V) { + x = a; + y = a; + z = a; + } + + //function foo(x: T, y: U, z: V) { + // x = a; + // y = a; + // z = a; + //} \ No newline at end of file diff --git a/tests/baselines/reference/anyAssignableToEveryType.js b/tests/baselines/reference/anyAssignableToEveryType.js index 89616436c6a38..de8211a3e9ee2 100644 --- a/tests/baselines/reference/anyAssignableToEveryType.js +++ b/tests/baselines/reference/anyAssignableToEveryType.js @@ -48,6 +48,7 @@ function foo(x: T, y: U, z: V) { //} //// [anyAssignableToEveryType.js] +"use strict"; var a; class C { } diff --git a/tests/baselines/reference/anyAssignableToEveryType.types b/tests/baselines/reference/anyAssignableToEveryType.types index e298b59a6d888..b4d1af548a07e 100644 --- a/tests/baselines/reference/anyAssignableToEveryType.types +++ b/tests/baselines/reference/anyAssignableToEveryType.types @@ -3,6 +3,7 @@ === anyAssignableToEveryType.ts === var a: any; >a : any +> : ^^^ class C { >C : C @@ -39,50 +40,61 @@ var b: number = a; >b : number > : ^^^^^^ >a : any +> : ^^^ var c: string = a; >c : string > : ^^^^^^ >a : any +> : ^^^ var d: boolean = a; >d : boolean > : ^^^^^^^ >a : any +> : ^^^ var e: Date = a; >e : Date > : ^^^^ >a : any +> : ^^^ var f: any = a; >f : any +> : ^^^ >a : any +> : ^^^ var g: void = a; >g : void > : ^^^^ >a : any +> : ^^^ var h: Object = a; >h : Object > : ^^^^^^ >a : any +> : ^^^ var i: {} = a; >i : {} > : ^^ >a : any +> : ^^^ var j: () => {} = a; >j : () => {} > : ^^^^^^ >a : any +> : ^^^ var k: Function = a; >k : Function > : ^^^^^^^^ >a : any +> : ^^^ var l: (x: number) => string = a; >l : (x: number) => string @@ -90,29 +102,37 @@ var l: (x: number) => string = a; >x : number > : ^^^^^^ >a : any +> : ^^^ ac = a; >ac = a : any +> : ^^^ >ac : C > : ^ >a : any +> : ^^^ ai = a; >ai = a : any +> : ^^^ >ai : I > : ^ >a : any +> : ^^^ ae = a; >ae = a : any +> : ^^^ >ae : E > : ^ >a : any +> : ^^^ var m: number[] = a; >m : number[] > : ^^^^^^^^ >a : any +> : ^^^ var n: { foo: string } = a; >n : { foo: string; } @@ -120,6 +140,7 @@ var n: { foo: string } = a; >foo : string > : ^^^^^^ >a : any +> : ^^^ var o: (x: T) => T = a; >o : (x: T) => T @@ -127,16 +148,19 @@ var o: (x: T) => T = a; >x : T > : ^ >a : any +> : ^^^ var p: Number = a; >p : Number > : ^^^^^^ >a : any +> : ^^^ var q: String = a; >q : String > : ^^^^^^ >a : any +> : ^^^ function foo(x: T, y: U, z: V) { >foo : (x: T, y: U, z: V) => void @@ -150,21 +174,27 @@ function foo(x: T, y: U, z: V) { x = a; >x = a : any +> : ^^^ >x : T > : ^ >a : any +> : ^^^ y = a; >y = a : any +> : ^^^ >y : U > : ^ >a : any +> : ^^^ z = a; >z = a : any +> : ^^^ >z : V > : ^ >a : any +> : ^^^ } //function foo(x: T, y: U, z: V) { diff --git a/tests/baselines/reference/anyAssignableToEveryType2.js b/tests/baselines/reference/anyAssignableToEveryType2.js index b2b39eb69861a..588df2126d84d 100644 --- a/tests/baselines/reference/anyAssignableToEveryType2.js +++ b/tests/baselines/reference/anyAssignableToEveryType2.js @@ -133,6 +133,7 @@ interface I20 { //// [anyAssignableToEveryType2.js] +"use strict"; // any is not a subtype of any other types, but is assignable, all the below should work class A { } diff --git a/tests/baselines/reference/anyDeclare.js b/tests/baselines/reference/anyDeclare.js index 6e16859b59892..ec3f5bdfbf786 100644 --- a/tests/baselines/reference/anyDeclare.js +++ b/tests/baselines/reference/anyDeclare.js @@ -9,6 +9,7 @@ namespace myMod { //// [anyDeclare.js] +"use strict"; var myMod; (function (myMod) { var myFn; diff --git a/tests/baselines/reference/anyIdenticalToItself.js b/tests/baselines/reference/anyIdenticalToItself.js index 7a4289adcd754..5f7462fb5d867 100644 --- a/tests/baselines/reference/anyIdenticalToItself.js +++ b/tests/baselines/reference/anyIdenticalToItself.js @@ -15,6 +15,7 @@ class C { } //// [anyIdenticalToItself.js] +"use strict"; function foo(x, y) { } class C { get X() { diff --git a/tests/baselines/reference/anyIndexedAccessArrayNoException.js b/tests/baselines/reference/anyIndexedAccessArrayNoException.js index 8765f4bd55936..425456ae4b74c 100644 --- a/tests/baselines/reference/anyIndexedAccessArrayNoException.js +++ b/tests/baselines/reference/anyIndexedAccessArrayNoException.js @@ -5,4 +5,5 @@ var x: any[[]]; //// [anyIndexedAccessArrayNoException.js] +"use strict"; var x; diff --git a/tests/baselines/reference/anyInferenceAnonymousFunctions.errors.txt b/tests/baselines/reference/anyInferenceAnonymousFunctions.errors.txt new file mode 100644 index 0000000000000..3418a2cc88665 --- /dev/null +++ b/tests/baselines/reference/anyInferenceAnonymousFunctions.errors.txt @@ -0,0 +1,35 @@ +anyInferenceAnonymousFunctions.ts(3,1): error TS2454: Variable 'paired' is used before being assigned. +anyInferenceAnonymousFunctions.ts(9,1): error TS2454: Variable 'paired' is used before being assigned. +anyInferenceAnonymousFunctions.ts(14,1): error TS2454: Variable 'paired' is used before being assigned. +anyInferenceAnonymousFunctions.ts(16,1): error TS2454: Variable 'paired' is used before being assigned. +anyInferenceAnonymousFunctions.ts(17,1): error TS2454: Variable 'paired' is used before being assigned. + + +==== anyInferenceAnonymousFunctions.ts (5 errors) ==== + var paired: any[]; + + paired.reduce(function (a1, a2) { + ~~~~~~ +!!! error TS2454: Variable 'paired' is used before being assigned. + + return a1.concat({}); + + } , []); + + paired.reduce((b1, b2) => { + ~~~~~~ +!!! error TS2454: Variable 'paired' is used before being assigned. + + return b1.concat({}); + } , []); + + paired.reduce((b3, b4) => b3.concat({}), []); + ~~~~~~ +!!! error TS2454: Variable 'paired' is used before being assigned. + + paired.map((c1) => c1.count); + ~~~~~~ +!!! error TS2454: Variable 'paired' is used before being assigned. + paired.map(function (c2) { return c2.count; }); + ~~~~~~ +!!! error TS2454: Variable 'paired' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/anyInferenceAnonymousFunctions.js b/tests/baselines/reference/anyInferenceAnonymousFunctions.js index 473446d4ff15e..2fe4b86fa45d4 100644 --- a/tests/baselines/reference/anyInferenceAnonymousFunctions.js +++ b/tests/baselines/reference/anyInferenceAnonymousFunctions.js @@ -20,6 +20,7 @@ paired.map((c1) => c1.count); paired.map(function (c2) { return c2.count; }); //// [anyInferenceAnonymousFunctions.js] +"use strict"; var paired; paired.reduce(function (a1, a2) { return a1.concat({}); diff --git a/tests/baselines/reference/anyInferenceAnonymousFunctions.types b/tests/baselines/reference/anyInferenceAnonymousFunctions.types index aa32f70f996f5..1f65f83b2c3ec 100644 --- a/tests/baselines/reference/anyInferenceAnonymousFunctions.types +++ b/tests/baselines/reference/anyInferenceAnonymousFunctions.types @@ -7,6 +7,7 @@ var paired: any[]; paired.reduce(function (a1, a2) { >paired.reduce(function (a1, a2) { return a1.concat({});} , []) : any +> : ^^^ >paired.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } > : ^^^ ^^^ ^^^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^ >paired : any[] @@ -16,11 +17,15 @@ paired.reduce(function (a1, a2) { >function (a1, a2) { return a1.concat({});} : (a1: any, a2: any) => any > : ^ ^^^^^^^ ^^^^^^^^^^^^^ >a1 : any +> : ^^^ >a2 : any +> : ^^^ return a1.concat({}); >a1.concat({}) : any +> : ^^^ >a1.concat : any +> : ^^^ >a1 : any > : ^^^ >concat : any @@ -29,11 +34,12 @@ paired.reduce(function (a1, a2) { > : ^^ } , []); ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ paired.reduce((b1, b2) => { >paired.reduce((b1, b2) => { return b1.concat({});} , []) : any +> : ^^^ >paired.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } > : ^^^ ^^^ ^^^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^ >paired : any[] @@ -43,11 +49,15 @@ paired.reduce((b1, b2) => { >(b1, b2) => { return b1.concat({});} : (b1: any, b2: any) => any > : ^ ^^^^^^^ ^^^^^^^^^^^^^ >b1 : any +> : ^^^ >b2 : any +> : ^^^ return b1.concat({}); >b1.concat({}) : any +> : ^^^ >b1.concat : any +> : ^^^ >b1 : any > : ^^^ >concat : any @@ -56,11 +66,12 @@ paired.reduce((b1, b2) => { > : ^^ } , []); ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ paired.reduce((b3, b4) => b3.concat({}), []); >paired.reduce((b3, b4) => b3.concat({}), []) : any +> : ^^^ >paired.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } > : ^^^ ^^^ ^^^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^ >paired : any[] @@ -70,17 +81,21 @@ paired.reduce((b3, b4) => b3.concat({}), []); >(b3, b4) => b3.concat({}) : (b3: any, b4: any) => any > : ^ ^^^^^^^ ^^^^^^^^^^^^^ >b3 : any +> : ^^^ >b4 : any +> : ^^^ >b3.concat({}) : any +> : ^^^ >b3.concat : any +> : ^^^ >b3 : any > : ^^^ >concat : any > : ^^^ >{} : {} > : ^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ paired.map((c1) => c1.count); >paired.map((c1) => c1.count) : any[] @@ -94,7 +109,9 @@ paired.map((c1) => c1.count); >(c1) => c1.count : (c1: any) => any > : ^ ^^^^^^^^^^^^^ >c1 : any +> : ^^^ >c1.count : any +> : ^^^ >c1 : any > : ^^^ >count : any @@ -112,7 +129,9 @@ paired.map(function (c2) { return c2.count; }); >function (c2) { return c2.count; } : (c2: any) => any > : ^ ^^^^^^^^^^^^^ >c2 : any +> : ^^^ >c2.count : any +> : ^^^ >c2 : any > : ^^^ >count : any diff --git a/tests/baselines/reference/anyIsAssignableToObject.js b/tests/baselines/reference/anyIsAssignableToObject.js index f132f9bc052c0..78af3ada67bd4 100644 --- a/tests/baselines/reference/anyIsAssignableToObject.js +++ b/tests/baselines/reference/anyIsAssignableToObject.js @@ -10,3 +10,4 @@ interface Q extends P { // Check assignability here. Any is assignable to {} } //// [anyIsAssignableToObject.js] +"use strict"; diff --git a/tests/baselines/reference/anyIsAssignableToVoid.js b/tests/baselines/reference/anyIsAssignableToVoid.js index 5aa2bda86ee2e..1e6a44d2470e6 100644 --- a/tests/baselines/reference/anyIsAssignableToVoid.js +++ b/tests/baselines/reference/anyIsAssignableToVoid.js @@ -10,3 +10,4 @@ interface Q extends P { // check assignability here. any is assignable to void. } //// [anyIsAssignableToVoid.js] +"use strict"; diff --git a/tests/baselines/reference/anyMappedTypesError.js b/tests/baselines/reference/anyMappedTypesError.js index a4f361804e1ec..9d7930007ac57 100644 --- a/tests/baselines/reference/anyMappedTypesError.js +++ b/tests/baselines/reference/anyMappedTypesError.js @@ -4,3 +4,4 @@ type Foo = {[P in "bar"]}; //// [anyMappedTypesError.js] +"use strict"; diff --git a/tests/baselines/reference/anyPlusAny1.js b/tests/baselines/reference/anyPlusAny1.js index 328a2e7024e5e..2f44c2b55764f 100644 --- a/tests/baselines/reference/anyPlusAny1.js +++ b/tests/baselines/reference/anyPlusAny1.js @@ -6,6 +6,7 @@ x.name = "hello"; var z = x + x; //// [anyPlusAny1.js] +"use strict"; var x; x.name = "hello"; var z = x + x; diff --git a/tests/baselines/reference/anyPropertyAccess.js b/tests/baselines/reference/anyPropertyAccess.js index c197c44b60834..ece61b2c49573 100644 --- a/tests/baselines/reference/anyPropertyAccess.js +++ b/tests/baselines/reference/anyPropertyAccess.js @@ -10,6 +10,7 @@ var e = x[0].foo; var f = x['0'].bar; //// [anyPropertyAccess.js] +"use strict"; var x; var a = x.foo; var b = x['foo']; diff --git a/tests/baselines/reference/apparentTypeSubtyping.errors.txt b/tests/baselines/reference/apparentTypeSubtyping.errors.txt index 19b55197ec454..afec8c2bd0b73 100644 --- a/tests/baselines/reference/apparentTypeSubtyping.errors.txt +++ b/tests/baselines/reference/apparentTypeSubtyping.errors.txt @@ -1,14 +1,20 @@ +apparentTypeSubtyping.ts(5,5): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. apparentTypeSubtyping.ts(10,5): error TS2416: Property 'x' in type 'Derived' is not assignable to the same property in base type 'Base'. Type 'String' is not assignable to type 'string'. 'string' is a primitive, but 'String' is a wrapper object. Prefer using 'string' when possible. +apparentTypeSubtyping.ts(10,5): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. +apparentTypeSubtyping.ts(14,5): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. +apparentTypeSubtyping.ts(20,5): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. -==== apparentTypeSubtyping.ts (1 errors) ==== +==== apparentTypeSubtyping.ts (5 errors) ==== // subtype checks use the apparent type of the target type // S is a subtype of a type T, and T is a supertype of S, if one of the following is true, where S' denotes the apparent type (section 3.8.1) of S: class Base { x: U; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. } // is String (S) a subtype of U extends String (T)? Would only be true if we used the apparent type of U (T) @@ -18,14 +24,20 @@ apparentTypeSubtyping.ts(10,5): error TS2416: Property 'x' in type 'Derived' !!! error TS2416: Property 'x' in type 'Derived' is not assignable to the same property in base type 'Base'. !!! error TS2416: Type 'String' is not assignable to type 'string'. !!! error TS2416: 'string' is a primitive, but 'String' is a wrapper object. Prefer using 'string' when possible. + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. } class Base2 { x: String; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. static s: String; } // is U extends String (S) a subtype of String (T)? Apparent type of U is String so it succeeds class Derived2 extends Base2 { // error because of the prototype's not matching, not because of the instance side x: U; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. } \ No newline at end of file diff --git a/tests/baselines/reference/apparentTypeSubtyping.js b/tests/baselines/reference/apparentTypeSubtyping.js index e94cce20f046e..26546cd046203 100644 --- a/tests/baselines/reference/apparentTypeSubtyping.js +++ b/tests/baselines/reference/apparentTypeSubtyping.js @@ -24,6 +24,7 @@ class Derived2 extends Base2 { // error because of the prototy } //// [apparentTypeSubtyping.js] +"use strict"; // subtype checks use the apparent type of the target type // S is a subtype of a type T, and T is a supertype of S, if one of the following is true, where S' denotes the apparent type (section 3.8.1) of S: class Base { diff --git a/tests/baselines/reference/apparentTypeSupertype.errors.txt b/tests/baselines/reference/apparentTypeSupertype.errors.txt index 12a6c2e0e412d..87bf18336e402 100644 --- a/tests/baselines/reference/apparentTypeSupertype.errors.txt +++ b/tests/baselines/reference/apparentTypeSupertype.errors.txt @@ -1,15 +1,19 @@ +apparentTypeSupertype.ts(5,5): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. apparentTypeSupertype.ts(10,5): error TS2416: Property 'x' in type 'Derived' is not assignable to the same property in base type 'Base'. Type 'U' is not assignable to type 'string'. Type 'String' is not assignable to type 'string'. 'string' is a primitive, but 'String' is a wrapper object. Prefer using 'string' when possible. +apparentTypeSupertype.ts(10,5): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. -==== apparentTypeSupertype.ts (1 errors) ==== +==== apparentTypeSupertype.ts (3 errors) ==== // subtype checks use the apparent type of the target type // S is a subtype of a type T, and T is a supertype of S, if one of the following is true, where S' denotes the apparent type (section 3.8.1) of S: class Base { x: string; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. } // is String (S) a subtype of U extends String (T)? Would only be true if we used the apparent type of U (T) @@ -20,4 +24,6 @@ apparentTypeSupertype.ts(10,5): error TS2416: Property 'x' in type 'Derived' !!! error TS2416: Type 'U' is not assignable to type 'string'. !!! error TS2416: Type 'String' is not assignable to type 'string'. !!! error TS2416: 'string' is a primitive, but 'String' is a wrapper object. Prefer using 'string' when possible. + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. } \ No newline at end of file diff --git a/tests/baselines/reference/apparentTypeSupertype.js b/tests/baselines/reference/apparentTypeSupertype.js index bf4e3f8a71966..c7accf01b4745 100644 --- a/tests/baselines/reference/apparentTypeSupertype.js +++ b/tests/baselines/reference/apparentTypeSupertype.js @@ -14,6 +14,7 @@ class Derived extends Base { // error } //// [apparentTypeSupertype.js] +"use strict"; // subtype checks use the apparent type of the target type // S is a subtype of a type T, and T is a supertype of S, if one of the following is true, where S' denotes the apparent type (section 3.8.1) of S: class Base { diff --git a/tests/baselines/reference/argsInScope.js b/tests/baselines/reference/argsInScope.js index 9183bef01141a..e568c7279a8ad 100644 --- a/tests/baselines/reference/argsInScope.js +++ b/tests/baselines/reference/argsInScope.js @@ -14,6 +14,7 @@ c.P(1,2,3); //// [argsInScope.js] +"use strict"; class C { P(ii, j, k) { for (var i = 0; i < arguments.length; i++) { diff --git a/tests/baselines/reference/argumentExpressionContextualTyping.errors.txt b/tests/baselines/reference/argumentExpressionContextualTyping.errors.txt index ab629cbf13786..1df431bb3651c 100644 --- a/tests/baselines/reference/argumentExpressionContextualTyping.errors.txt +++ b/tests/baselines/reference/argumentExpressionContextualTyping.errors.txt @@ -1,3 +1,11 @@ +argumentExpressionContextualTyping.ts(2,19): error TS7031: Binding element 'a' implicitly has an 'any' type. +argumentExpressionContextualTyping.ts(2,22): error TS7031: Binding element 'b' implicitly has an 'any' type. +argumentExpressionContextualTyping.ts(2,30): error TS7031: Binding element 'c' implicitly has an 'any' type. +argumentExpressionContextualTyping.ts(2,33): error TS7031: Binding element 'd' implicitly has an 'any' type. +argumentExpressionContextualTyping.ts(2,36): error TS7031: Binding element 'e' implicitly has an 'any' type. +argumentExpressionContextualTyping.ts(3,19): error TS7031: Binding element 'a' implicitly has an 'any' type. +argumentExpressionContextualTyping.ts(3,35): error TS7031: Binding element 'c' implicitly has an 'any' type. +argumentExpressionContextualTyping.ts(3,38): error TS7031: Binding element 'd' implicitly has an 'any' type. argumentExpressionContextualTyping.ts(16,5): error TS2345: Argument of type '(string | number | boolean)[]' is not assignable to parameter of type '[string, number, boolean]'. Target requires 3 element(s) but source may have fewer. argumentExpressionContextualTyping.ts(17,5): error TS2345: Argument of type '[string, number, true, ...(string | number | boolean)[]]' is not assignable to parameter of type '[string, number, boolean]'. @@ -8,10 +16,26 @@ argumentExpressionContextualTyping.ts(18,5): error TS2345: Argument of type '{ x Target requires 2 element(s) but source may have fewer. -==== argumentExpressionContextualTyping.ts (3 errors) ==== +==== argumentExpressionContextualTyping.ts (11 errors) ==== // In a typed function call, argument expressions are contextually typed by their corresponding parameter types. function foo({x: [a, b], y: {c, d, e}}) { } + ~ +!!! error TS7031: Binding element 'a' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'b' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'c' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'd' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'e' implicitly has an 'any' type. function bar({x: [a, b = 10], y: {c, d, e = { f:1 }}}) { } + ~ +!!! error TS7031: Binding element 'a' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'c' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'd' implicitly has an 'any' type. function baz(x: [string, number, boolean]) { } var o = { x: ["string", 1], y: { c: true, d: "world", e: 3 } }; diff --git a/tests/baselines/reference/argumentExpressionContextualTyping.js b/tests/baselines/reference/argumentExpressionContextualTyping.js index 0ab90a276c6a1..257d565fc6858 100644 --- a/tests/baselines/reference/argumentExpressionContextualTyping.js +++ b/tests/baselines/reference/argumentExpressionContextualTyping.js @@ -21,6 +21,7 @@ baz(["string", 1, true, ...array]); // Error foo(o); // Error because x has an array type namely (string|number)[] //// [argumentExpressionContextualTyping.js] +"use strict"; // In a typed function call, argument expressions are contextually typed by their corresponding parameter types. function foo({ x: [a, b], y: { c, d, e } }) { } function bar({ x: [a, b = 10], y: { c, d, e = { f: 1 } } }) { } diff --git a/tests/baselines/reference/argumentExpressionContextualTyping.types b/tests/baselines/reference/argumentExpressionContextualTyping.types index 16a04fc21512e..9530e238e90ae 100644 --- a/tests/baselines/reference/argumentExpressionContextualTyping.types +++ b/tests/baselines/reference/argumentExpressionContextualTyping.types @@ -21,8 +21,8 @@ function foo({x: [a, b], y: {c, d, e}}) { } > : ^^^ function bar({x: [a, b = 10], y: {c, d, e = { f:1 }}}) { } ->bar : ({ x: [a, b], y: { c, d, e } }: { x: [any, number?]; y: { c: any; d: any; e?: { f: number; }; }; }) => void -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>bar : ({ x: [a, b], y: { c, d, e } }: { x: [any, (number | undefined)?]; y: { c: any; d: any; e?: { f: number; } | undefined; }; }) => void +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >x : any > : ^^^ >a : any diff --git a/tests/baselines/reference/arguments.js b/tests/baselines/reference/arguments.js index 8e008f9182160..1e4f89bc7eec7 100644 --- a/tests/baselines/reference/arguments.js +++ b/tests/baselines/reference/arguments.js @@ -17,6 +17,7 @@ interface I { } //// [arguments.js] +"use strict"; function f() { var x = arguments[12]; (() => arguments)(); diff --git a/tests/baselines/reference/argumentsAsPropertyName.js b/tests/baselines/reference/argumentsAsPropertyName.js index 165050408ea2b..00384d853c06a 100644 --- a/tests/baselines/reference/argumentsAsPropertyName.js +++ b/tests/baselines/reference/argumentsAsPropertyName.js @@ -18,6 +18,7 @@ function myFunction(myType: MyType) { } //// [argumentsAsPropertyName.js] +"use strict"; function myFunction(myType) { for (let i = 0; i < 10; i++) { use(myType.arguments[i]); diff --git a/tests/baselines/reference/argumentsAsPropertyName2.js b/tests/baselines/reference/argumentsAsPropertyName2.js index 46d94dbf3a2dd..5452e31ad277e 100644 --- a/tests/baselines/reference/argumentsAsPropertyName2.js +++ b/tests/baselines/reference/argumentsAsPropertyName2.js @@ -15,6 +15,7 @@ function foo() { //// [argumentsAsPropertyName2.js] +"use strict"; // target: es5 function foo() { for (let x = 0; x < 1; ++x) { diff --git a/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt b/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt index 6f0eacb5dff5a..e603cc83c1632 100644 --- a/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt +++ b/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt @@ -1,10 +1,16 @@ +argumentsBindsToFunctionScopeArgumentList.ts(1,5): error TS1100: Invalid use of 'arguments' in strict mode. +argumentsBindsToFunctionScopeArgumentList.ts(3,5): error TS1100: Invalid use of 'arguments' in strict mode. argumentsBindsToFunctionScopeArgumentList.ts(3,5): error TS2322: Type 'number' is not assignable to type 'IArguments'. -==== argumentsBindsToFunctionScopeArgumentList.ts (1 errors) ==== +==== argumentsBindsToFunctionScopeArgumentList.ts (3 errors) ==== var arguments = 10; + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. function foo(a) { arguments = 10; /// This shouldnt be of type number and result in error. ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + ~~~~~~~~~ !!! error TS2322: Type 'number' is not assignable to type 'IArguments'. } \ No newline at end of file diff --git a/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.js b/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.js index b18f1cc7d05f8..8cd10362943b0 100644 --- a/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.js +++ b/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.js @@ -7,6 +7,7 @@ function foo(a) { } //// [argumentsBindsToFunctionScopeArgumentList.js] +"use strict"; var arguments = 10; function foo(a) { arguments = 10; /// This shouldnt be of type number and result in error. diff --git a/tests/baselines/reference/argumentsObjectIterator01_ES5(target=es2015).js b/tests/baselines/reference/argumentsObjectIterator01_ES5(target=es2015).js index 31f46e6e4481c..aa3b43874e801 100644 --- a/tests/baselines/reference/argumentsObjectIterator01_ES5(target=es2015).js +++ b/tests/baselines/reference/argumentsObjectIterator01_ES5(target=es2015).js @@ -10,6 +10,7 @@ function doubleAndReturnAsArray(x: number, y: number, z: number): [number, numbe } //// [argumentsObjectIterator01_ES5.js] +"use strict"; function doubleAndReturnAsArray(x, y, z) { let result = []; for (let arg of arguments) { diff --git a/tests/baselines/reference/argumentsObjectIterator01_ES5(target=es2015).types b/tests/baselines/reference/argumentsObjectIterator01_ES5(target=es2015).types index 029ea74a7bc8e..a11cf7e23f531 100644 --- a/tests/baselines/reference/argumentsObjectIterator01_ES5(target=es2015).types +++ b/tests/baselines/reference/argumentsObjectIterator01_ES5(target=es2015).types @@ -14,8 +14,8 @@ function doubleAndReturnAsArray(x: number, y: number, z: number): [number, numbe let result = []; >result : any[] > : ^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ for (let arg of arguments) { >arg : any diff --git a/tests/baselines/reference/argumentsObjectIterator01_ES5(target=es5).js b/tests/baselines/reference/argumentsObjectIterator01_ES5(target=es5).js index 25980e36dd272..50d6cbc01a3e0 100644 --- a/tests/baselines/reference/argumentsObjectIterator01_ES5(target=es5).js +++ b/tests/baselines/reference/argumentsObjectIterator01_ES5(target=es5).js @@ -10,6 +10,7 @@ function doubleAndReturnAsArray(x: number, y: number, z: number): [number, numbe } //// [argumentsObjectIterator01_ES5.js] +"use strict"; function doubleAndReturnAsArray(x, y, z) { var result = []; for (var _i = 0, arguments_1 = arguments; _i < arguments_1.length; _i++) { diff --git a/tests/baselines/reference/argumentsObjectIterator01_ES5(target=es5).types b/tests/baselines/reference/argumentsObjectIterator01_ES5(target=es5).types index 343bbec3a9a92..2491e7e821da3 100644 --- a/tests/baselines/reference/argumentsObjectIterator01_ES5(target=es5).types +++ b/tests/baselines/reference/argumentsObjectIterator01_ES5(target=es5).types @@ -14,8 +14,8 @@ function doubleAndReturnAsArray(x: number, y: number, z: number): [number, numbe let result = []; >result : any[] > : ^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ for (let arg of arguments) { >arg : any diff --git a/tests/baselines/reference/argumentsObjectIterator01_ES6.js b/tests/baselines/reference/argumentsObjectIterator01_ES6.js index 13f198a7cb9bf..cccb75f9dd310 100644 --- a/tests/baselines/reference/argumentsObjectIterator01_ES6.js +++ b/tests/baselines/reference/argumentsObjectIterator01_ES6.js @@ -10,6 +10,7 @@ function doubleAndReturnAsArray(x: number, y: number, z: number): [number, numbe } //// [argumentsObjectIterator01_ES6.js] +"use strict"; function doubleAndReturnAsArray(x, y, z) { let result = []; for (let arg of arguments) { diff --git a/tests/baselines/reference/argumentsObjectIterator01_ES6.types b/tests/baselines/reference/argumentsObjectIterator01_ES6.types index b0d3bf5978267..0401c85015fbe 100644 --- a/tests/baselines/reference/argumentsObjectIterator01_ES6.types +++ b/tests/baselines/reference/argumentsObjectIterator01_ES6.types @@ -14,8 +14,8 @@ function doubleAndReturnAsArray(x: number, y: number, z: number): [number, numbe let result = []; >result : any[] > : ^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ for (let arg of arguments) { >arg : any diff --git a/tests/baselines/reference/argumentsObjectIterator02_ES5(target=es2015).js b/tests/baselines/reference/argumentsObjectIterator02_ES5(target=es2015).js index d1a28404a2925..d41bc1d595fcb 100644 --- a/tests/baselines/reference/argumentsObjectIterator02_ES5(target=es2015).js +++ b/tests/baselines/reference/argumentsObjectIterator02_ES5(target=es2015).js @@ -14,6 +14,7 @@ function doubleAndReturnAsArray(x: number, y: number, z: number): [number, numbe //// [argumentsObjectIterator02_ES5.js] +"use strict"; function doubleAndReturnAsArray(x, y, z) { let blah = arguments[Symbol.iterator]; let result = []; diff --git a/tests/baselines/reference/argumentsObjectIterator02_ES5(target=es2015).types b/tests/baselines/reference/argumentsObjectIterator02_ES5(target=es2015).types index a93506d96710c..5ef4caceee36d 100644 --- a/tests/baselines/reference/argumentsObjectIterator02_ES5(target=es2015).types +++ b/tests/baselines/reference/argumentsObjectIterator02_ES5(target=es2015).types @@ -28,8 +28,8 @@ function doubleAndReturnAsArray(x: number, y: number, z: number): [number, numbe let result = []; >result : any[] > : ^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ for (let arg of blah()) { >arg : any diff --git a/tests/baselines/reference/argumentsObjectIterator02_ES5(target=es5).js b/tests/baselines/reference/argumentsObjectIterator02_ES5(target=es5).js index 418475942c596..92aec1ffa0f3e 100644 --- a/tests/baselines/reference/argumentsObjectIterator02_ES5(target=es5).js +++ b/tests/baselines/reference/argumentsObjectIterator02_ES5(target=es5).js @@ -14,6 +14,7 @@ function doubleAndReturnAsArray(x: number, y: number, z: number): [number, numbe //// [argumentsObjectIterator02_ES5.js] +"use strict"; function doubleAndReturnAsArray(x, y, z) { var blah = arguments[Symbol.iterator]; var result = []; diff --git a/tests/baselines/reference/argumentsObjectIterator02_ES5(target=es5).types b/tests/baselines/reference/argumentsObjectIterator02_ES5(target=es5).types index dcb5bd09e0a07..bea36e4452de3 100644 --- a/tests/baselines/reference/argumentsObjectIterator02_ES5(target=es5).types +++ b/tests/baselines/reference/argumentsObjectIterator02_ES5(target=es5).types @@ -28,8 +28,8 @@ function doubleAndReturnAsArray(x: number, y: number, z: number): [number, numbe let result = []; >result : any[] > : ^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ for (let arg of blah()) { >arg : any diff --git a/tests/baselines/reference/argumentsObjectIterator02_ES6.js b/tests/baselines/reference/argumentsObjectIterator02_ES6.js index 66ec96865e46c..0bfd5540377bb 100644 --- a/tests/baselines/reference/argumentsObjectIterator02_ES6.js +++ b/tests/baselines/reference/argumentsObjectIterator02_ES6.js @@ -14,6 +14,7 @@ function doubleAndReturnAsArray(x: number, y: number, z: number): [number, numbe //// [argumentsObjectIterator02_ES6.js] +"use strict"; function doubleAndReturnAsArray(x, y, z) { let blah = arguments[Symbol.iterator]; let result = []; diff --git a/tests/baselines/reference/argumentsObjectIterator02_ES6.types b/tests/baselines/reference/argumentsObjectIterator02_ES6.types index f77b4259cf9cd..a3df3d9b226a9 100644 --- a/tests/baselines/reference/argumentsObjectIterator02_ES6.types +++ b/tests/baselines/reference/argumentsObjectIterator02_ES6.types @@ -28,8 +28,8 @@ function doubleAndReturnAsArray(x: number, y: number, z: number): [number, numbe let result = []; >result : any[] > : ^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ for (let arg of blah()) { >arg : any diff --git a/tests/baselines/reference/argumentsObjectIterator03_ES5(target=es2015).js b/tests/baselines/reference/argumentsObjectIterator03_ES5(target=es2015).js index b1ea2af47f1d4..70ea3e309f936 100644 --- a/tests/baselines/reference/argumentsObjectIterator03_ES5(target=es2015).js +++ b/tests/baselines/reference/argumentsObjectIterator03_ES5(target=es2015).js @@ -10,6 +10,7 @@ function asReversedTuple(a: number, b: string, c: boolean): [boolean, string, nu //// [argumentsObjectIterator03_ES5.js] +"use strict"; function asReversedTuple(a, b, c) { let [x, y, z] = arguments; return [z, y, x]; diff --git a/tests/baselines/reference/argumentsObjectIterator03_ES5(target=es5).js b/tests/baselines/reference/argumentsObjectIterator03_ES5(target=es5).js index 56492b7277331..9ec97ab30a26c 100644 --- a/tests/baselines/reference/argumentsObjectIterator03_ES5(target=es5).js +++ b/tests/baselines/reference/argumentsObjectIterator03_ES5(target=es5).js @@ -10,6 +10,7 @@ function asReversedTuple(a: number, b: string, c: boolean): [boolean, string, nu //// [argumentsObjectIterator03_ES5.js] +"use strict"; function asReversedTuple(a, b, c) { var x = arguments[0], y = arguments[1], z = arguments[2]; return [z, y, x]; diff --git a/tests/baselines/reference/argumentsObjectIterator03_ES6.js b/tests/baselines/reference/argumentsObjectIterator03_ES6.js index 39815757c9442..d3a7770adad85 100644 --- a/tests/baselines/reference/argumentsObjectIterator03_ES6.js +++ b/tests/baselines/reference/argumentsObjectIterator03_ES6.js @@ -10,6 +10,7 @@ function asReversedTuple(a: number, b: string, c: boolean): [boolean, string, nu //// [argumentsObjectIterator03_ES6.js] +"use strict"; function asReversedTuple(a, b, c) { let [x, y, z] = arguments; return [z, y, x]; diff --git a/tests/baselines/reference/argumentsPropertyNameInJsMode1.js b/tests/baselines/reference/argumentsPropertyNameInJsMode1.js index d3d9b4dcf8d67..03375e9f31a08 100644 --- a/tests/baselines/reference/argumentsPropertyNameInJsMode1.js +++ b/tests/baselines/reference/argumentsPropertyNameInJsMode1.js @@ -13,6 +13,7 @@ f2(1, 2, 3); //// [a.js] +"use strict"; const foo = { f1: (params) => { } }; diff --git a/tests/baselines/reference/argumentsPropertyNameInJsMode2.js b/tests/baselines/reference/argumentsPropertyNameInJsMode2.js index c32df3f1b4bb4..bfa2bfe582b0d 100644 --- a/tests/baselines/reference/argumentsPropertyNameInJsMode2.js +++ b/tests/baselines/reference/argumentsPropertyNameInJsMode2.js @@ -9,6 +9,7 @@ f(1, 2, 3); //// [a.js] +"use strict"; function f(x) { arguments; } diff --git a/tests/baselines/reference/argumentsReferenceInConstructor1_Js.types b/tests/baselines/reference/argumentsReferenceInConstructor1_Js.types index e09b0138ee9f1..eef1c64b8b161 100644 --- a/tests/baselines/reference/argumentsReferenceInConstructor1_Js.types +++ b/tests/baselines/reference/argumentsReferenceInConstructor1_Js.types @@ -11,7 +11,8 @@ class A { * @param {object} [foo={}] */ constructor(foo = {}) { ->foo : any +>foo : object | undefined +> : ^^^^^^^^^^^^^^^^^^ >{} : {} > : ^^ @@ -19,13 +20,16 @@ class A { * @type object */ this.arguments = foo; ->this.arguments = foo : any ->this.arguments : any +>this.arguments = foo : object +> : ^^^^^^ +>this.arguments : object +> : ^^^^^^ >this : this > : ^^^^ ->arguments : any -> : ^^^ ->foo : any +>arguments : object +> : ^^^^^^ +>foo : object +> : ^^^^^^ } } diff --git a/tests/baselines/reference/argumentsReferenceInConstructor2_Js.types b/tests/baselines/reference/argumentsReferenceInConstructor2_Js.types index 34e1b75313a71..a898cc8115c6b 100644 --- a/tests/baselines/reference/argumentsReferenceInConstructor2_Js.types +++ b/tests/baselines/reference/argumentsReferenceInConstructor2_Js.types @@ -11,7 +11,8 @@ class A { * @param {object} [foo={}] */ constructor(foo = {}) { ->foo : any +>foo : object | undefined +> : ^^^^^^^^^^^^^^^^^^ >{} : {} > : ^^ @@ -19,13 +20,16 @@ class A { * @type object */ this["arguments"] = foo; ->this["arguments"] = foo : any ->this["arguments"] : any +>this["arguments"] = foo : object +> : ^^^^^^ +>this["arguments"] : object +> : ^^^^^^ >this : this > : ^^^^ >"arguments" : "arguments" > : ^^^^^^^^^^^ ->foo : any +>foo : object +> : ^^^^^^ } } diff --git a/tests/baselines/reference/argumentsReferenceInConstructor3_Js.types b/tests/baselines/reference/argumentsReferenceInConstructor3_Js.types index effca32f412c6..7037172942b0c 100644 --- a/tests/baselines/reference/argumentsReferenceInConstructor3_Js.types +++ b/tests/baselines/reference/argumentsReferenceInConstructor3_Js.types @@ -31,7 +31,8 @@ class B extends A { * @param {object} [foo={}] */ constructor(foo = {}) { ->foo : any +>foo : object | undefined +> : ^^^^^^^^^^^^^^^^^^ >{} : {} > : ^^ @@ -45,24 +46,28 @@ class B extends A { * @type object */ this.foo = foo; ->this.foo = foo : any ->this.foo : any +>this.foo = foo : object +> : ^^^^^^ +>this.foo : object +> : ^^^^^^ >this : this > : ^^^^ ->foo : any -> : ^^^ ->foo : any +>foo : object +> : ^^^^^^ +>foo : object +> : ^^^^^^ /** * @type object */ this.bar = super.arguments.foo; >this.bar = super.arguments.foo : error ->this.bar : any +>this.bar : object +> : ^^^^^^ >this : this > : ^^^^ ->bar : any -> : ^^^ +>bar : object +> : ^^^^^^ >super.arguments.foo : error >super.arguments : { bar: {}; } > : ^^^^^^^^^^^^ diff --git a/tests/baselines/reference/argumentsReferenceInConstructor4_Js.types b/tests/baselines/reference/argumentsReferenceInConstructor4_Js.types index 194ef50e8b55a..0bcd47137587f 100644 --- a/tests/baselines/reference/argumentsReferenceInConstructor4_Js.types +++ b/tests/baselines/reference/argumentsReferenceInConstructor4_Js.types @@ -11,8 +11,8 @@ class A { * @param {object} [foo={}] */ constructor(foo = {}) { ->foo : any -> : ^^^ +>foo : object | undefined +> : ^^^^^^^^^^^^^^^^^^ >{} : {} > : ^^ @@ -26,23 +26,23 @@ class A { * @type object */ this.foo = foo; ->this.foo = foo : any -> : ^^^ ->this.foo : any -> : ^^^ +>this.foo = foo : object +> : ^^^^^^ +>this.foo : object +> : ^^^^^^ >this : this > : ^^^^ ->foo : any -> : ^^^ ->foo : any -> : ^^^ +>foo : object +> : ^^^^^^ +>foo : object +> : ^^^^^^ /** * @type object */ const arguments = this.arguments; ->arguments : any -> : ^^^ +>arguments : object +> : ^^^^^^ >this.arguments : { bar: {}; } > : ^^^^^^^^^^^^ >this : this @@ -56,16 +56,16 @@ class A { this.bar = arguments.bar; >this.bar = arguments.bar : any > : ^^^ ->this.bar : any -> : ^^^ +>this.bar : object +> : ^^^^^^ >this : this > : ^^^^ ->bar : any -> : ^^^ +>bar : object +> : ^^^^^^ >arguments.bar : any > : ^^^ ->arguments : any -> : ^^^ +>arguments : object +> : ^^^^^^ >bar : any > : ^^^ @@ -75,16 +75,16 @@ class A { this.baz = arguments[key]; >this.baz = arguments[key] : any > : ^^^ ->this.baz : any -> : ^^^ +>this.baz : object +> : ^^^^^^ >this : this > : ^^^^ ->baz : any -> : ^^^ +>baz : object +> : ^^^^^^ >arguments[key] : any > : ^^^ ->arguments : any -> : ^^^ +>arguments : object +> : ^^^^^^ >key : "bar" > : ^^^^^ @@ -92,16 +92,16 @@ class A { * @type object */ this.options = arguments; ->this.options = arguments : any -> : ^^^ ->this.options : any -> : ^^^ +>this.options = arguments : object +> : ^^^^^^ +>this.options : object +> : ^^^^^^ >this : this > : ^^^^ ->options : any -> : ^^^ ->arguments : any -> : ^^^ +>options : object +> : ^^^^^^ +>arguments : object +> : ^^^^^^ } get arguments() { diff --git a/tests/baselines/reference/argumentsReferenceInConstructor5_Js.types b/tests/baselines/reference/argumentsReferenceInConstructor5_Js.types index c78d574c6014e..fb8e9799da667 100644 --- a/tests/baselines/reference/argumentsReferenceInConstructor5_Js.types +++ b/tests/baselines/reference/argumentsReferenceInConstructor5_Js.types @@ -24,7 +24,8 @@ class A { * @param {object} [foo={}] */ constructor(foo = {}) { ->foo : any +>foo : object | undefined +> : ^^^^^^^^^^^^^^^^^^ >{} : {} > : ^^ @@ -32,13 +33,16 @@ class A { * @type object */ this.foo = foo; ->this.foo = foo : any ->this.foo : any +>this.foo = foo : object +> : ^^^^^^ +>this.foo : object +> : ^^^^^^ >this : this > : ^^^^ ->foo : any -> : ^^^ ->foo : any +>foo : object +> : ^^^^^^ +>foo : object +> : ^^^^^^ /** * @type object @@ -46,11 +50,12 @@ class A { this.bar = bar.arguments; >this.bar = bar.arguments : {} > : ^^ ->this.bar : any +>this.bar : object +> : ^^^^^^ >this : this > : ^^^^ ->bar : any -> : ^^^ +>bar : object +> : ^^^^^^ >bar.arguments : {} > : ^^ >bar : { arguments: {}; } diff --git a/tests/baselines/reference/argumentsReferenceInConstructor6_Js.types b/tests/baselines/reference/argumentsReferenceInConstructor6_Js.types index b6800a8bbf40d..5adbc1efd2dd9 100644 --- a/tests/baselines/reference/argumentsReferenceInConstructor6_Js.types +++ b/tests/baselines/reference/argumentsReferenceInConstructor6_Js.types @@ -12,11 +12,12 @@ class A { this.foo = arguments; >this.foo = arguments : IArguments > : ^^^^^^^^^^ ->this.foo : any +>this.foo : object +> : ^^^^^^ >this : this > : ^^^^ ->foo : any -> : ^^^ +>foo : object +> : ^^^^^^ >arguments : IArguments > : ^^^^^^^^^^ } diff --git a/tests/baselines/reference/argumentsReferenceInMethod1_Js.js b/tests/baselines/reference/argumentsReferenceInMethod1_Js.js index b5864817af5ab..58fbf9b180cc1 100644 --- a/tests/baselines/reference/argumentsReferenceInMethod1_Js.js +++ b/tests/baselines/reference/argumentsReferenceInMethod1_Js.js @@ -25,5 +25,5 @@ declare class A { /** * @type object */ - arguments: object; + arguments: object | undefined; } diff --git a/tests/baselines/reference/argumentsReferenceInMethod1_Js.types b/tests/baselines/reference/argumentsReferenceInMethod1_Js.types index f5fc941a917d6..8ee3aa9c92903 100644 --- a/tests/baselines/reference/argumentsReferenceInMethod1_Js.types +++ b/tests/baselines/reference/argumentsReferenceInMethod1_Js.types @@ -11,7 +11,8 @@ class A { m(foo = {}) { >m : (foo?: object) => void > : ^ ^^^ ^^^^^^^^^ ->foo : any +>foo : object | undefined +> : ^^^^^^^^^^^^^^^^^^ >{} : {} > : ^^ @@ -19,13 +20,16 @@ class A { * @type object */ this.arguments = foo; ->this.arguments = foo : any ->this.arguments : any +>this.arguments = foo : object +> : ^^^^^^ +>this.arguments : object | undefined +> : ^^^^^^^^^^^^^^^^^^ >this : this > : ^^^^ ->arguments : any -> : ^^^ ->foo : any +>arguments : object | undefined +> : ^^^^^^^^^^^^^^^^^^ +>foo : object +> : ^^^^^^ } } diff --git a/tests/baselines/reference/argumentsReferenceInMethod2_Js.js b/tests/baselines/reference/argumentsReferenceInMethod2_Js.js index d2de1c8d44813..2fd81cdf33ef0 100644 --- a/tests/baselines/reference/argumentsReferenceInMethod2_Js.js +++ b/tests/baselines/reference/argumentsReferenceInMethod2_Js.js @@ -25,5 +25,5 @@ declare class A { /** * @type object */ - arguments: object; + arguments: object | undefined; } diff --git a/tests/baselines/reference/argumentsReferenceInMethod2_Js.types b/tests/baselines/reference/argumentsReferenceInMethod2_Js.types index 9bc96385aab30..f0d6259181131 100644 --- a/tests/baselines/reference/argumentsReferenceInMethod2_Js.types +++ b/tests/baselines/reference/argumentsReferenceInMethod2_Js.types @@ -11,7 +11,8 @@ class A { m(foo = {}) { >m : (foo?: object) => void > : ^ ^^^ ^^^^^^^^^ ->foo : any +>foo : object | undefined +> : ^^^^^^^^^^^^^^^^^^ >{} : {} > : ^^ @@ -19,13 +20,16 @@ class A { * @type object */ this["arguments"] = foo; ->this["arguments"] = foo : any ->this["arguments"] : any +>this["arguments"] = foo : object +> : ^^^^^^ +>this["arguments"] : object | undefined +> : ^^^^^^^^^^^^^^^^^^ >this : this > : ^^^^ >"arguments" : "arguments" > : ^^^^^^^^^^^ ->foo : any +>foo : object +> : ^^^^^^ } } diff --git a/tests/baselines/reference/argumentsReferenceInMethod3_Js.js b/tests/baselines/reference/argumentsReferenceInMethod3_Js.js index 33a44f7a99f22..135556c11ab02 100644 --- a/tests/baselines/reference/argumentsReferenceInMethod3_Js.js +++ b/tests/baselines/reference/argumentsReferenceInMethod3_Js.js @@ -41,9 +41,9 @@ declare class B extends A { /** * @type object */ - x: object; + x: object | undefined; /** * @type object */ - y: object; + y: object | undefined; } diff --git a/tests/baselines/reference/argumentsReferenceInMethod3_Js.types b/tests/baselines/reference/argumentsReferenceInMethod3_Js.types index 5f322ba978964..d59386d4a8ab8 100644 --- a/tests/baselines/reference/argumentsReferenceInMethod3_Js.types +++ b/tests/baselines/reference/argumentsReferenceInMethod3_Js.types @@ -31,7 +31,8 @@ class B extends A { m(foo = {}) { >m : (foo?: object) => void > : ^ ^^^ ^^^^^^^^^ ->foo : any +>foo : object | undefined +> : ^^^^^^^^^^^^^^^^^^ >{} : {} > : ^^ @@ -39,13 +40,16 @@ class B extends A { * @type object */ this.x = foo; ->this.x = foo : any ->this.x : any +>this.x = foo : object +> : ^^^^^^ +>this.x : object | undefined +> : ^^^^^^^^^^^^^^^^^^ >this : this > : ^^^^ ->x : any -> : ^^^ ->foo : any +>x : object | undefined +> : ^^^^^^^^^^^^^^^^^^ +>foo : object +> : ^^^^^^ /** * @type object @@ -53,11 +57,12 @@ class B extends A { this.y = super.arguments.bar; >this.y = super.arguments.bar : {} > : ^^ ->this.y : any +>this.y : object | undefined +> : ^^^^^^^^^^^^^^^^^^ >this : this > : ^^^^ ->y : any -> : ^^^ +>y : object | undefined +> : ^^^^^^^^^^^^^^^^^^ >super.arguments.bar : {} > : ^^ >super.arguments : { bar: {}; } diff --git a/tests/baselines/reference/argumentsReferenceInMethod4_Js.js b/tests/baselines/reference/argumentsReferenceInMethod4_Js.js index e01ac01a44271..a8e4d9af9b063 100644 --- a/tests/baselines/reference/argumentsReferenceInMethod4_Js.js +++ b/tests/baselines/reference/argumentsReferenceInMethod4_Js.js @@ -51,19 +51,19 @@ declare class A { /** * @type object */ - foo: object; + foo: object | undefined; /** * @type object */ - bar: object; + bar: object | undefined; /** * @type object */ - baz: object; + baz: object | undefined; /** * @type object */ - options: object; + options: object | undefined; get arguments(): { bar: {}; }; diff --git a/tests/baselines/reference/argumentsReferenceInMethod4_Js.types b/tests/baselines/reference/argumentsReferenceInMethod4_Js.types index db10e95112324..a4b506bad9faf 100644 --- a/tests/baselines/reference/argumentsReferenceInMethod4_Js.types +++ b/tests/baselines/reference/argumentsReferenceInMethod4_Js.types @@ -11,8 +11,8 @@ class A { m(foo = {}) { >m : (foo?: object) => void > : ^ ^^^ ^^^^^^^^^ ->foo : any -> : ^^^ +>foo : object | undefined +> : ^^^^^^^^^^^^^^^^^^ >{} : {} > : ^^ @@ -26,23 +26,23 @@ class A { * @type object */ this.foo = foo; ->this.foo = foo : any -> : ^^^ ->this.foo : any -> : ^^^ +>this.foo = foo : object +> : ^^^^^^ +>this.foo : object | undefined +> : ^^^^^^^^^^^^^^^^^^ >this : this > : ^^^^ ->foo : any -> : ^^^ ->foo : any -> : ^^^ +>foo : object | undefined +> : ^^^^^^^^^^^^^^^^^^ +>foo : object +> : ^^^^^^ /** * @type object */ const arguments = this.arguments; ->arguments : any -> : ^^^ +>arguments : object +> : ^^^^^^ >this.arguments : { bar: {}; } > : ^^^^^^^^^^^^ >this : this @@ -56,16 +56,16 @@ class A { this.bar = arguments.bar; >this.bar = arguments.bar : any > : ^^^ ->this.bar : any -> : ^^^ +>this.bar : object | undefined +> : ^^^^^^^^^^^^^^^^^^ >this : this > : ^^^^ ->bar : any -> : ^^^ +>bar : object | undefined +> : ^^^^^^^^^^^^^^^^^^ >arguments.bar : any > : ^^^ ->arguments : any -> : ^^^ +>arguments : object +> : ^^^^^^ >bar : any > : ^^^ @@ -75,16 +75,16 @@ class A { this.baz = arguments[key]; >this.baz = arguments[key] : any > : ^^^ ->this.baz : any -> : ^^^ +>this.baz : object | undefined +> : ^^^^^^^^^^^^^^^^^^ >this : this > : ^^^^ ->baz : any -> : ^^^ +>baz : object | undefined +> : ^^^^^^^^^^^^^^^^^^ >arguments[key] : any > : ^^^ ->arguments : any -> : ^^^ +>arguments : object +> : ^^^^^^ >key : "bar" > : ^^^^^ @@ -92,16 +92,16 @@ class A { * @type object */ this.options = arguments; ->this.options = arguments : any -> : ^^^ ->this.options : any -> : ^^^ +>this.options = arguments : object +> : ^^^^^^ +>this.options : object | undefined +> : ^^^^^^^^^^^^^^^^^^ >this : this > : ^^^^ ->options : any -> : ^^^ ->arguments : any -> : ^^^ +>options : object | undefined +> : ^^^^^^^^^^^^^^^^^^ +>arguments : object +> : ^^^^^^ } get arguments() { diff --git a/tests/baselines/reference/argumentsReferenceInMethod5_Js.js b/tests/baselines/reference/argumentsReferenceInMethod5_Js.js index 4e1d7c797b9d4..df69c5880f284 100644 --- a/tests/baselines/reference/argumentsReferenceInMethod5_Js.js +++ b/tests/baselines/reference/argumentsReferenceInMethod5_Js.js @@ -37,9 +37,9 @@ declare class A { /** * @type object */ - foo: object; + foo: object | undefined; /** * @type object */ - bar: object; + bar: object | undefined; } diff --git a/tests/baselines/reference/argumentsReferenceInMethod5_Js.types b/tests/baselines/reference/argumentsReferenceInMethod5_Js.types index fff0abb3125dc..6a0f7fc89e8a1 100644 --- a/tests/baselines/reference/argumentsReferenceInMethod5_Js.types +++ b/tests/baselines/reference/argumentsReferenceInMethod5_Js.types @@ -24,7 +24,8 @@ class A { m(foo = {}) { >m : (foo?: object) => void > : ^ ^^^ ^^^^^^^^^ ->foo : any +>foo : object | undefined +> : ^^^^^^^^^^^^^^^^^^ >{} : {} > : ^^ @@ -32,13 +33,16 @@ class A { * @type object */ this.foo = foo; ->this.foo = foo : any ->this.foo : any +>this.foo = foo : object +> : ^^^^^^ +>this.foo : object | undefined +> : ^^^^^^^^^^^^^^^^^^ >this : this > : ^^^^ ->foo : any -> : ^^^ ->foo : any +>foo : object | undefined +> : ^^^^^^^^^^^^^^^^^^ +>foo : object +> : ^^^^^^ /** * @type object @@ -46,11 +50,12 @@ class A { this.bar = bar.arguments; >this.bar = bar.arguments : {} > : ^^ ->this.bar : any +>this.bar : object | undefined +> : ^^^^^^^^^^^^^^^^^^ >this : this > : ^^^^ ->bar : any -> : ^^^ +>bar : object | undefined +> : ^^^^^^^^^^^^^^^^^^ >bar.arguments : {} > : ^^ >bar : { arguments: {}; } diff --git a/tests/baselines/reference/argumentsReferenceInMethod6_Js.js b/tests/baselines/reference/argumentsReferenceInMethod6_Js.js index c351f653e7b37..457255f569449 100644 --- a/tests/baselines/reference/argumentsReferenceInMethod6_Js.js +++ b/tests/baselines/reference/argumentsReferenceInMethod6_Js.js @@ -19,5 +19,5 @@ declare class A { /** * @type object */ - foo: object; + foo: object | undefined; } diff --git a/tests/baselines/reference/argumentsReferenceInMethod6_Js.types b/tests/baselines/reference/argumentsReferenceInMethod6_Js.types index 080b85ac88364..1c0c7366cec81 100644 --- a/tests/baselines/reference/argumentsReferenceInMethod6_Js.types +++ b/tests/baselines/reference/argumentsReferenceInMethod6_Js.types @@ -15,11 +15,12 @@ class A { this.foo = arguments; >this.foo = arguments : IArguments > : ^^^^^^^^^^ ->this.foo : any +>this.foo : object | undefined +> : ^^^^^^^^^^^^^^^^^^ >this : this > : ^^^^ ->foo : any -> : ^^^ +>foo : object | undefined +> : ^^^^^^^^^^^^^^^^^^ >arguments : IArguments > : ^^^^^^^^^^ } diff --git a/tests/baselines/reference/argumentsReferenceInMethod7_Js.js b/tests/baselines/reference/argumentsReferenceInMethod7_Js.js index 1acc1eecb3d8c..1d07510d06471 100644 --- a/tests/baselines/reference/argumentsReferenceInMethod7_Js.js +++ b/tests/baselines/reference/argumentsReferenceInMethod7_Js.js @@ -19,5 +19,5 @@ declare class A { /** * @type Function */ - callee: Function; + callee: Function | undefined; } diff --git a/tests/baselines/reference/argumentsReferenceInMethod7_Js.types b/tests/baselines/reference/argumentsReferenceInMethod7_Js.types index c0bca1b8f0e11..ff9016328386c 100644 --- a/tests/baselines/reference/argumentsReferenceInMethod7_Js.types +++ b/tests/baselines/reference/argumentsReferenceInMethod7_Js.types @@ -15,12 +15,12 @@ class A { this.callee = arguments.callee; >this.callee = arguments.callee : Function > : ^^^^^^^^ ->this.callee : Function -> : ^^^^^^^^ +>this.callee : Function | undefined +> : ^^^^^^^^^^^^^^^^^^^^ >this : this > : ^^^^ ->callee : Function -> : ^^^^^^^^ +>callee : Function | undefined +> : ^^^^^^^^^^^^^^^^^^^^ >arguments.callee : Function > : ^^^^^^^^ >arguments : IArguments diff --git a/tests/baselines/reference/argumentsReferenceInObjectLiteral_Js.errors.txt b/tests/baselines/reference/argumentsReferenceInObjectLiteral_Js.errors.txt index 1c26e2e60116b..4ab9073c95059 100644 --- a/tests/baselines/reference/argumentsReferenceInObjectLiteral_Js.errors.txt +++ b/tests/baselines/reference/argumentsReferenceInObjectLiteral_Js.errors.txt @@ -1,7 +1,8 @@ /a.js(16,9): error TS18004: No value exists in scope for the shorthand property 'arguments'. Either declare one or provide an initializer. +/a.js(21,11): error TS1100: Invalid use of 'arguments' in strict mode. -==== /a.js (1 errors) ==== +==== /a.js (2 errors) ==== const a = () => { return { arguments: [], @@ -25,6 +26,8 @@ const d = () => { const arguments = undefined; + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. return { arguments, }; diff --git a/tests/baselines/reference/argumentsReferenceInObjectLiteral_Js.js b/tests/baselines/reference/argumentsReferenceInObjectLiteral_Js.js index d2b7a2997e9e9..76020266477fe 100644 --- a/tests/baselines/reference/argumentsReferenceInObjectLiteral_Js.js +++ b/tests/baselines/reference/argumentsReferenceInObjectLiteral_Js.js @@ -29,6 +29,7 @@ const d = () => { //// [a.js] +"use strict"; const a = () => { return { arguments: [], diff --git a/tests/baselines/reference/argumentsUsedInClassFieldInitializerOrStaticInitializationBlock.js b/tests/baselines/reference/argumentsUsedInClassFieldInitializerOrStaticInitializationBlock.js index 23f2ad2259a4c..9a9a727f17b53 100644 --- a/tests/baselines/reference/argumentsUsedInClassFieldInitializerOrStaticInitializationBlock.js +++ b/tests/baselines/reference/argumentsUsedInClassFieldInitializerOrStaticInitializationBlock.js @@ -116,6 +116,7 @@ function D7() { //// [argumentsUsedInClassFieldInitializerOrStaticInitializationBlock.js] +"use strict"; function A() { return class T { constructor() { diff --git a/tests/baselines/reference/argumentsUsedInObjectLiteralProperty.js b/tests/baselines/reference/argumentsUsedInObjectLiteralProperty.js index 010d4d4477e7a..c13fbffe1d7af 100644 --- a/tests/baselines/reference/argumentsUsedInObjectLiteralProperty.js +++ b/tests/baselines/reference/argumentsUsedInObjectLiteralProperty.js @@ -10,6 +10,7 @@ class A { } //// [argumentsUsedInObjectLiteralProperty.js] +"use strict"; class A { static createSelectableViewModel(initialState, selectedValue) { return { diff --git a/tests/baselines/reference/arithAssignTyping.js b/tests/baselines/reference/arithAssignTyping.js index 99261d44127b9..226612425edbd 100644 --- a/tests/baselines/reference/arithAssignTyping.js +++ b/tests/baselines/reference/arithAssignTyping.js @@ -17,6 +17,7 @@ f >>>= 1; // error f ^= 1; // error //// [arithAssignTyping.js] +"use strict"; class f { } f += ''; // error diff --git a/tests/baselines/reference/arithmeticOnInvalidTypes.errors.txt b/tests/baselines/reference/arithmeticOnInvalidTypes.errors.txt index ff669a0970ec6..f99ec3b54fc1f 100644 --- a/tests/baselines/reference/arithmeticOnInvalidTypes.errors.txt +++ b/tests/baselines/reference/arithmeticOnInvalidTypes.errors.txt @@ -1,30 +1,54 @@ +arithmeticOnInvalidTypes.ts(3,9): error TS2454: Variable 'x' is used before being assigned. arithmeticOnInvalidTypes.ts(3,9): error TS2365: Operator '+' cannot be applied to types 'Number' and 'Number'. +arithmeticOnInvalidTypes.ts(3,13): error TS2454: Variable 'y' is used before being assigned. arithmeticOnInvalidTypes.ts(4,10): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. +arithmeticOnInvalidTypes.ts(4,10): error TS2454: Variable 'x' is used before being assigned. arithmeticOnInvalidTypes.ts(4,14): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. +arithmeticOnInvalidTypes.ts(4,14): error TS2454: Variable 'y' is used before being assigned. arithmeticOnInvalidTypes.ts(5,10): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. +arithmeticOnInvalidTypes.ts(5,10): error TS2454: Variable 'x' is used before being assigned. arithmeticOnInvalidTypes.ts(5,14): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. +arithmeticOnInvalidTypes.ts(5,14): error TS2454: Variable 'y' is used before being assigned. arithmeticOnInvalidTypes.ts(6,10): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. +arithmeticOnInvalidTypes.ts(6,10): error TS2454: Variable 'x' is used before being assigned. arithmeticOnInvalidTypes.ts(6,14): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. +arithmeticOnInvalidTypes.ts(6,14): error TS2454: Variable 'y' is used before being assigned. -==== arithmeticOnInvalidTypes.ts (7 errors) ==== +==== arithmeticOnInvalidTypes.ts (15 errors) ==== var x: Number; var y: Number; var z = x + y; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. ~~~~~ !!! error TS2365: Operator '+' cannot be applied to types 'Number' and 'Number'. + ~ +!!! error TS2454: Variable 'y' is used before being assigned. var z2 = x - y; ~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. + ~ +!!! error TS2454: Variable 'x' is used before being assigned. ~ !!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. + ~ +!!! error TS2454: Variable 'y' is used before being assigned. var z3 = x * y; ~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. + ~ +!!! error TS2454: Variable 'x' is used before being assigned. ~ !!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. + ~ +!!! error TS2454: Variable 'y' is used before being assigned. var z4 = x / y; ~ !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + ~ +!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. ~ -!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. \ No newline at end of file +!!! error TS2454: Variable 'y' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/arithmeticOnInvalidTypes.js b/tests/baselines/reference/arithmeticOnInvalidTypes.js index 9cb3dfa524a47..107db3f38d996 100644 --- a/tests/baselines/reference/arithmeticOnInvalidTypes.js +++ b/tests/baselines/reference/arithmeticOnInvalidTypes.js @@ -9,6 +9,7 @@ var z3 = x * y; var z4 = x / y; //// [arithmeticOnInvalidTypes.js] +"use strict"; var x; var y; var z = x + y; diff --git a/tests/baselines/reference/arithmeticOnInvalidTypes2.js b/tests/baselines/reference/arithmeticOnInvalidTypes2.js index a449340adfde3..f34749a907fe8 100644 --- a/tests/baselines/reference/arithmeticOnInvalidTypes2.js +++ b/tests/baselines/reference/arithmeticOnInvalidTypes2.js @@ -10,6 +10,7 @@ var obj = function f(a: T, b: T) { }; //// [arithmeticOnInvalidTypes2.js] +"use strict"; var obj = function f(a, b) { var z1 = a + b; var z2 = a - b; diff --git a/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.errors.txt b/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.errors.txt new file mode 100644 index 0000000000000..3c6984879a25d --- /dev/null +++ b/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.errors.txt @@ -0,0 +1,255 @@ +arithmeticOperatorWithAnyAndNumber.ts(6,15): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(10,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(11,15): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(12,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(12,15): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(16,15): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(20,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(21,15): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(22,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(22,15): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(26,15): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(30,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(31,15): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(32,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(32,15): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(36,15): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(40,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(41,15): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(42,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(42,15): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(46,16): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(50,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(51,16): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(52,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(52,16): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(56,16): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(60,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(61,16): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(62,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(62,16): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(66,17): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(70,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(71,17): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(72,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(72,17): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(76,15): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(80,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(81,15): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(82,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(82,15): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(86,15): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(90,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(91,15): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(92,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(92,15): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(96,15): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(100,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(101,15): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(102,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithAnyAndNumber.ts(102,15): error TS2454: Variable 'b' is used before being assigned. + + +==== arithmeticOperatorWithAnyAndNumber.ts (50 errors) ==== + var a: any; + var b: number; + + // operator * + var ra1 = a * a; + var ra2 = a * b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var ra3 = a * 0; + var ra4 = 0 * a; + var ra5 = 0 * 0; + var ra6 = b * 0; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var ra7 = 0 * b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var ra8 = b * b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + + // operator / + var rb1 = a / a; + var rb2 = a / b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rb3 = a / 0; + var rb4 = 0 / a; + var rb5 = 0 / 0; + var rb6 = b / 0; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rb7 = 0 / b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rb8 = b / b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + + // operator % + var rc1 = a % a; + var rc2 = a % b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rc3 = a % 0; + var rc4 = 0 % a; + var rc5 = 0 % 0; + var rc6 = b % 0; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rc7 = 0 % b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rc8 = b % b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + + // operator - + var rd1 = a - a; + var rd2 = a - b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rd3 = a - 0; + var rd4 = 0 - a; + var rd5 = 0 - 0; + var rd6 = b - 0; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rd7 = 0 - b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rd8 = b - b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + + // operator << + var re1 = a << a; + var re2 = a << b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var re3 = a << 0; + var re4 = 0 << a; + var re5 = 0 << 0; + var re6 = b << 0; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var re7 = 0 << b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var re8 = b << b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + + // operator >> + var rf1 = a >> a; + var rf2 = a >> b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rf3 = a >> 0; + var rf4 = 0 >> a; + var rf5 = 0 >> 0; + var rf6 = b >> 0; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rf7 = 0 >> b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rf8 = b >> b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + + // operator >>> + var rg1 = a >>> a; + var rg2 = a >>> b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rg3 = a >>> 0; + var rg4 = 0 >>> a; + var rg5 = 0 >>> 0; + var rg6 = b >>> 0; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rg7 = 0 >>> b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rg8 = b >>> b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + + // operator & + var rh1 = a & a; + var rh2 = a & b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rh3 = a & 0; + var rh4 = 0 & a; + var rh5 = 0 & 0; + var rh6 = b & 0; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rh7 = 0 & b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rh8 = b & b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + + // operator ^ + var ri1 = a ^ a; + var ri2 = a ^ b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var ri3 = a ^ 0; + var ri4 = 0 ^ a; + var ri5 = 0 ^ 0; + var ri6 = b ^ 0; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var ri7 = 0 ^ b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var ri8 = b ^ b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + + // operator | + var rj1 = a | a; + var rj2 = a | b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rj3 = a | 0; + var rj4 = 0 | a; + var rj5 = 0 | 0; + var rj6 = b | 0; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rj7 = 0 | b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rj8 = b | b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.js b/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.js index f2cef2c8e2791..e5c6babe0db89 100644 --- a/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.js +++ b/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.js @@ -105,6 +105,7 @@ var rj7 = 0 | b; var rj8 = b | b; //// [arithmeticOperatorWithAnyAndNumber.js] +"use strict"; var a; var b; // operator * diff --git a/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.types b/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.types index c9782a42ea6bf..b0c890941dab8 100644 --- a/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.types +++ b/tests/baselines/reference/arithmeticOperatorWithAnyAndNumber.types @@ -3,6 +3,7 @@ === arithmeticOperatorWithAnyAndNumber.ts === var a: any; >a : any +> : ^^^ var b: number; >b : number @@ -15,7 +16,9 @@ var ra1 = a * a; >a * a : number > : ^^^^^^ >a : any +> : ^^^ >a : any +> : ^^^ var ra2 = a * b; >ra2 : number @@ -23,6 +26,7 @@ var ra2 = a * b; >a * b : number > : ^^^^^^ >a : any +> : ^^^ >b : number > : ^^^^^^ @@ -32,6 +36,7 @@ var ra3 = a * 0; >a * 0 : number > : ^^^^^^ >a : any +> : ^^^ >0 : 0 > : ^ @@ -43,6 +48,7 @@ var ra4 = 0 * a; >0 : 0 > : ^ >a : any +> : ^^^ var ra5 = 0 * 0; >ra5 : number @@ -91,7 +97,9 @@ var rb1 = a / a; >a / a : number > : ^^^^^^ >a : any +> : ^^^ >a : any +> : ^^^ var rb2 = a / b; >rb2 : number @@ -99,6 +107,7 @@ var rb2 = a / b; >a / b : number > : ^^^^^^ >a : any +> : ^^^ >b : number > : ^^^^^^ @@ -108,6 +117,7 @@ var rb3 = a / 0; >a / 0 : number > : ^^^^^^ >a : any +> : ^^^ >0 : 0 > : ^ @@ -119,6 +129,7 @@ var rb4 = 0 / a; >0 : 0 > : ^ >a : any +> : ^^^ var rb5 = 0 / 0; >rb5 : number @@ -167,7 +178,9 @@ var rc1 = a % a; >a % a : number > : ^^^^^^ >a : any +> : ^^^ >a : any +> : ^^^ var rc2 = a % b; >rc2 : number @@ -175,6 +188,7 @@ var rc2 = a % b; >a % b : number > : ^^^^^^ >a : any +> : ^^^ >b : number > : ^^^^^^ @@ -184,6 +198,7 @@ var rc3 = a % 0; >a % 0 : number > : ^^^^^^ >a : any +> : ^^^ >0 : 0 > : ^ @@ -195,6 +210,7 @@ var rc4 = 0 % a; >0 : 0 > : ^ >a : any +> : ^^^ var rc5 = 0 % 0; >rc5 : number @@ -243,7 +259,9 @@ var rd1 = a - a; >a - a : number > : ^^^^^^ >a : any +> : ^^^ >a : any +> : ^^^ var rd2 = a - b; >rd2 : number @@ -251,6 +269,7 @@ var rd2 = a - b; >a - b : number > : ^^^^^^ >a : any +> : ^^^ >b : number > : ^^^^^^ @@ -260,6 +279,7 @@ var rd3 = a - 0; >a - 0 : number > : ^^^^^^ >a : any +> : ^^^ >0 : 0 > : ^ @@ -271,6 +291,7 @@ var rd4 = 0 - a; >0 : 0 > : ^ >a : any +> : ^^^ var rd5 = 0 - 0; >rd5 : number @@ -319,7 +340,9 @@ var re1 = a << a; >a << a : number > : ^^^^^^ >a : any +> : ^^^ >a : any +> : ^^^ var re2 = a << b; >re2 : number @@ -327,6 +350,7 @@ var re2 = a << b; >a << b : number > : ^^^^^^ >a : any +> : ^^^ >b : number > : ^^^^^^ @@ -336,6 +360,7 @@ var re3 = a << 0; >a << 0 : number > : ^^^^^^ >a : any +> : ^^^ >0 : 0 > : ^ @@ -347,6 +372,7 @@ var re4 = 0 << a; >0 : 0 > : ^ >a : any +> : ^^^ var re5 = 0 << 0; >re5 : number @@ -395,7 +421,9 @@ var rf1 = a >> a; >a >> a : number > : ^^^^^^ >a : any +> : ^^^ >a : any +> : ^^^ var rf2 = a >> b; >rf2 : number @@ -403,6 +431,7 @@ var rf2 = a >> b; >a >> b : number > : ^^^^^^ >a : any +> : ^^^ >b : number > : ^^^^^^ @@ -412,6 +441,7 @@ var rf3 = a >> 0; >a >> 0 : number > : ^^^^^^ >a : any +> : ^^^ >0 : 0 > : ^ @@ -423,6 +453,7 @@ var rf4 = 0 >> a; >0 : 0 > : ^ >a : any +> : ^^^ var rf5 = 0 >> 0; >rf5 : number @@ -471,7 +502,9 @@ var rg1 = a >>> a; >a >>> a : number > : ^^^^^^ >a : any +> : ^^^ >a : any +> : ^^^ var rg2 = a >>> b; >rg2 : number @@ -479,6 +512,7 @@ var rg2 = a >>> b; >a >>> b : number > : ^^^^^^ >a : any +> : ^^^ >b : number > : ^^^^^^ @@ -488,6 +522,7 @@ var rg3 = a >>> 0; >a >>> 0 : number > : ^^^^^^ >a : any +> : ^^^ >0 : 0 > : ^ @@ -499,6 +534,7 @@ var rg4 = 0 >>> a; >0 : 0 > : ^ >a : any +> : ^^^ var rg5 = 0 >>> 0; >rg5 : number @@ -547,7 +583,9 @@ var rh1 = a & a; >a & a : number > : ^^^^^^ >a : any +> : ^^^ >a : any +> : ^^^ var rh2 = a & b; >rh2 : number @@ -555,6 +593,7 @@ var rh2 = a & b; >a & b : number > : ^^^^^^ >a : any +> : ^^^ >b : number > : ^^^^^^ @@ -564,6 +603,7 @@ var rh3 = a & 0; >a & 0 : number > : ^^^^^^ >a : any +> : ^^^ >0 : 0 > : ^ @@ -575,6 +615,7 @@ var rh4 = 0 & a; >0 : 0 > : ^ >a : any +> : ^^^ var rh5 = 0 & 0; >rh5 : number @@ -623,7 +664,9 @@ var ri1 = a ^ a; >a ^ a : number > : ^^^^^^ >a : any +> : ^^^ >a : any +> : ^^^ var ri2 = a ^ b; >ri2 : number @@ -631,6 +674,7 @@ var ri2 = a ^ b; >a ^ b : number > : ^^^^^^ >a : any +> : ^^^ >b : number > : ^^^^^^ @@ -640,6 +684,7 @@ var ri3 = a ^ 0; >a ^ 0 : number > : ^^^^^^ >a : any +> : ^^^ >0 : 0 > : ^ @@ -651,6 +696,7 @@ var ri4 = 0 ^ a; >0 : 0 > : ^ >a : any +> : ^^^ var ri5 = 0 ^ 0; >ri5 : number @@ -699,7 +745,9 @@ var rj1 = a | a; >a | a : number > : ^^^^^^ >a : any +> : ^^^ >a : any +> : ^^^ var rj2 = a | b; >rj2 : number @@ -707,6 +755,7 @@ var rj2 = a | b; >a | b : number > : ^^^^^^ >a : any +> : ^^^ >b : number > : ^^^^^^ @@ -716,6 +765,7 @@ var rj3 = a | 0; >a | 0 : number > : ^^^^^^ >a : any +> : ^^^ >0 : 0 > : ^ @@ -727,6 +777,7 @@ var rj4 = 0 | a; >0 : 0 > : ^ >a : any +> : ^^^ var rj5 = 0 | 0; >rj5 : number diff --git a/tests/baselines/reference/arithmeticOperatorWithEnum.errors.txt b/tests/baselines/reference/arithmeticOperatorWithEnum.errors.txt new file mode 100644 index 0000000000000..6626a0f8c1917 --- /dev/null +++ b/tests/baselines/reference/arithmeticOperatorWithEnum.errors.txt @@ -0,0 +1,453 @@ +arithmeticOperatorWithEnum.ts(13,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(14,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(14,15): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(15,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(15,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(16,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(17,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(17,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(19,17): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(23,12): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(27,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(28,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(28,15): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(29,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(29,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(30,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(31,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(31,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(33,17): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(37,12): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(41,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(42,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(42,15): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(43,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(43,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(44,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(45,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(45,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(47,17): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(51,12): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(55,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(56,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(56,15): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(57,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(57,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(58,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(59,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(59,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(61,17): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(65,12): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(69,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(70,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(70,16): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(71,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(71,16): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(72,16): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(73,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(73,16): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(75,18): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(79,12): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(83,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(84,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(84,16): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(85,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(85,16): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(86,16): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(87,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(87,16): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(89,18): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(93,12): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(97,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(98,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(98,17): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(99,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(99,17): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(100,17): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(101,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(101,17): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(103,19): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(107,12): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(111,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(112,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(112,15): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(113,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(113,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(114,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(115,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(115,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(117,17): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(121,12): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(125,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(126,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(126,15): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(127,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(127,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(128,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(129,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(129,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(131,17): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(135,12): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(139,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(140,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(140,15): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(141,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(141,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(142,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(143,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(143,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnum.ts(145,17): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnum.ts(149,12): error TS2454: Variable 'b' is used before being assigned. + + +==== arithmeticOperatorWithEnum.ts (100 errors) ==== + // operands of an enum type are treated as having the primitive type Number. + + enum E { + a, + b + } + + var a: any; + var b: number; + var c: E; + + // operator * + var ra1 = c * a; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var ra2 = c * b; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var ra3 = c * c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var ra4 = a * c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var ra5 = b * c; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var ra6 = E.a * a; + var ra7 = E.a * b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var ra8 = E.a * E.b; + var ra9 = E.a * 1; + var ra10 = a * E.b; + var ra11 = b * E.b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var ra12 = 1 * E.b; + + // operator / + var rb1 = c / a; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rb2 = c / b; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rb3 = c / c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rb4 = a / c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rb5 = b / c; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rb6 = E.a / a; + var rb7 = E.a / b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rb8 = E.a / E.b; + var rb9 = E.a / 1; + var rb10 = a / E.b; + var rb11 = b / E.b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rb12 = 1 / E.b; + + // operator % + var rc1 = c % a; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rc2 = c % b; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rc3 = c % c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rc4 = a % c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rc5 = b % c; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rc6 = E.a % a; + var rc7 = E.a % b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rc8 = E.a % E.b; + var rc9 = E.a % 1; + var rc10 = a % E.b; + var rc11 = b % E.b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rc12 = 1 % E.b; + + // operator - + var rd1 = c - a; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rd2 = c - b; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rd3 = c - c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rd4 = a - c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rd5 = b - c; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rd6 = E.a - a; + var rd7 = E.a - b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rd8 = E.a - E.b; + var rd9 = E.a - 1; + var rd10 = a - E.b; + var rd11 = b - E.b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rd12 = 1 - E.b; + + // operator << + var re1 = c << a; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var re2 = c << b; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var re3 = c << c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var re4 = a << c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var re5 = b << c; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var re6 = E.a << a; + var re7 = E.a << b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var re8 = E.a << E.b; + var re9 = E.a << 1; + var re10 = a << E.b; + var re11 = b << E.b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var re12 = 1 << E.b; + + // operator >> + var rf1 = c >> a; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rf2 = c >> b; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rf3 = c >> c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rf4 = a >> c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rf5 = b >> c; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rf6 = E.a >> a; + var rf7 = E.a >> b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rf8 = E.a >> E.b; + var rf9 = E.a >> 1; + var rf10 = a >> E.b; + var rf11 = b >> E.b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rf12 = 1 >> E.b; + + // operator >>> + var rg1 = c >>> a; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rg2 = c >>> b; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rg3 = c >>> c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rg4 = a >>> c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rg5 = b >>> c; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rg6 = E.a >>> a; + var rg7 = E.a >>> b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rg8 = E.a >>> E.b; + var rg9 = E.a >>> 1; + var rg10 = a >>> E.b; + var rg11 = b >>> E.b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rg12 = 1 >>> E.b; + + // operator & + var rh1 = c & a; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rh2 = c & b; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rh3 = c & c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rh4 = a & c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rh5 = b & c; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rh6 = E.a & a; + var rh7 = E.a & b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rh8 = E.a & E.b; + var rh9 = E.a & 1; + var rh10 = a & E.b; + var rh11 = b & E.b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rh12 = 1 & E.b; + + // operator ^ + var ri1 = c ^ a; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var ri2 = c ^ b; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var ri3 = c ^ c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var ri4 = a ^ c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var ri5 = b ^ c; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var ri6 = E.a ^ a; + var ri7 = E.a ^ b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var ri8 = E.a ^ E.b; + var ri9 = E.a ^ 1; + var ri10 = a ^ E.b; + var ri11 = b ^ E.b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var ri12 = 1 ^ E.b; + + // operator | + var rj1 = c | a; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rj2 = c | b; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rj3 = c | c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rj4 = a | c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rj5 = b | c; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rj6 = E.a | a; + var rj7 = E.a | b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rj8 = E.a | E.b; + var rj9 = E.a | 1; + var rj10 = a | E.b; + var rj11 = b | E.b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rj12 = 1 | E.b; \ No newline at end of file diff --git a/tests/baselines/reference/arithmeticOperatorWithEnum.js b/tests/baselines/reference/arithmeticOperatorWithEnum.js index 23bdb09964f37..a6e6014f4aa4b 100644 --- a/tests/baselines/reference/arithmeticOperatorWithEnum.js +++ b/tests/baselines/reference/arithmeticOperatorWithEnum.js @@ -153,6 +153,7 @@ var rj11 = b | E.b; var rj12 = 1 | E.b; //// [arithmeticOperatorWithEnum.js] +"use strict"; // operands of an enum type are treated as having the primitive type Number. var E; (function (E) { diff --git a/tests/baselines/reference/arithmeticOperatorWithEnum.types b/tests/baselines/reference/arithmeticOperatorWithEnum.types index d04461ae65482..a781b47cd942e 100644 --- a/tests/baselines/reference/arithmeticOperatorWithEnum.types +++ b/tests/baselines/reference/arithmeticOperatorWithEnum.types @@ -18,6 +18,7 @@ enum E { var a: any; >a : any +> : ^^^ var b: number; >b : number @@ -36,6 +37,7 @@ var ra1 = c * a; >c : E > : ^ >a : any +> : ^^^ var ra2 = c * b; >ra2 : number @@ -63,6 +65,7 @@ var ra4 = a * c; >a * c : number > : ^^^^^^ >a : any +> : ^^^ >c : E > : ^ @@ -88,6 +91,7 @@ var ra6 = E.a * a; >a : E.a > : ^^^ >a : any +> : ^^^ var ra7 = E.a * b; >ra7 : number @@ -141,6 +145,7 @@ var ra10 = a * E.b; >a * E.b : number > : ^^^^^^ >a : any +> : ^^^ >E.b : E.b > : ^^^ >E : typeof E @@ -185,6 +190,7 @@ var rb1 = c / a; >c : E > : ^ >a : any +> : ^^^ var rb2 = c / b; >rb2 : number @@ -212,6 +218,7 @@ var rb4 = a / c; >a / c : number > : ^^^^^^ >a : any +> : ^^^ >c : E > : ^ @@ -237,6 +244,7 @@ var rb6 = E.a / a; >a : E.a > : ^^^ >a : any +> : ^^^ var rb7 = E.a / b; >rb7 : number @@ -290,6 +298,7 @@ var rb10 = a / E.b; >a / E.b : number > : ^^^^^^ >a : any +> : ^^^ >E.b : E.b > : ^^^ >E : typeof E @@ -334,6 +343,7 @@ var rc1 = c % a; >c : E > : ^ >a : any +> : ^^^ var rc2 = c % b; >rc2 : number @@ -361,6 +371,7 @@ var rc4 = a % c; >a % c : number > : ^^^^^^ >a : any +> : ^^^ >c : E > : ^ @@ -386,6 +397,7 @@ var rc6 = E.a % a; >a : E.a > : ^^^ >a : any +> : ^^^ var rc7 = E.a % b; >rc7 : number @@ -439,6 +451,7 @@ var rc10 = a % E.b; >a % E.b : number > : ^^^^^^ >a : any +> : ^^^ >E.b : E.b > : ^^^ >E : typeof E @@ -483,6 +496,7 @@ var rd1 = c - a; >c : E > : ^ >a : any +> : ^^^ var rd2 = c - b; >rd2 : number @@ -510,6 +524,7 @@ var rd4 = a - c; >a - c : number > : ^^^^^^ >a : any +> : ^^^ >c : E > : ^ @@ -535,6 +550,7 @@ var rd6 = E.a - a; >a : E.a > : ^^^ >a : any +> : ^^^ var rd7 = E.a - b; >rd7 : number @@ -588,6 +604,7 @@ var rd10 = a - E.b; >a - E.b : number > : ^^^^^^ >a : any +> : ^^^ >E.b : E.b > : ^^^ >E : typeof E @@ -632,6 +649,7 @@ var re1 = c << a; >c : E > : ^ >a : any +> : ^^^ var re2 = c << b; >re2 : number @@ -659,6 +677,7 @@ var re4 = a << c; >a << c : number > : ^^^^^^ >a : any +> : ^^^ >c : E > : ^ @@ -684,6 +703,7 @@ var re6 = E.a << a; >a : E.a > : ^^^ >a : any +> : ^^^ var re7 = E.a << b; >re7 : number @@ -737,6 +757,7 @@ var re10 = a << E.b; >a << E.b : number > : ^^^^^^ >a : any +> : ^^^ >E.b : E.b > : ^^^ >E : typeof E @@ -781,6 +802,7 @@ var rf1 = c >> a; >c : E > : ^ >a : any +> : ^^^ var rf2 = c >> b; >rf2 : number @@ -808,6 +830,7 @@ var rf4 = a >> c; >a >> c : number > : ^^^^^^ >a : any +> : ^^^ >c : E > : ^ @@ -833,6 +856,7 @@ var rf6 = E.a >> a; >a : E.a > : ^^^ >a : any +> : ^^^ var rf7 = E.a >> b; >rf7 : number @@ -886,6 +910,7 @@ var rf10 = a >> E.b; >a >> E.b : number > : ^^^^^^ >a : any +> : ^^^ >E.b : E.b > : ^^^ >E : typeof E @@ -930,6 +955,7 @@ var rg1 = c >>> a; >c : E > : ^ >a : any +> : ^^^ var rg2 = c >>> b; >rg2 : number @@ -957,6 +983,7 @@ var rg4 = a >>> c; >a >>> c : number > : ^^^^^^ >a : any +> : ^^^ >c : E > : ^ @@ -982,6 +1009,7 @@ var rg6 = E.a >>> a; >a : E.a > : ^^^ >a : any +> : ^^^ var rg7 = E.a >>> b; >rg7 : number @@ -1035,6 +1063,7 @@ var rg10 = a >>> E.b; >a >>> E.b : number > : ^^^^^^ >a : any +> : ^^^ >E.b : E.b > : ^^^ >E : typeof E @@ -1079,6 +1108,7 @@ var rh1 = c & a; >c : E > : ^ >a : any +> : ^^^ var rh2 = c & b; >rh2 : number @@ -1106,6 +1136,7 @@ var rh4 = a & c; >a & c : number > : ^^^^^^ >a : any +> : ^^^ >c : E > : ^ @@ -1131,6 +1162,7 @@ var rh6 = E.a & a; >a : E.a > : ^^^ >a : any +> : ^^^ var rh7 = E.a & b; >rh7 : number @@ -1184,6 +1216,7 @@ var rh10 = a & E.b; >a & E.b : number > : ^^^^^^ >a : any +> : ^^^ >E.b : E.b > : ^^^ >E : typeof E @@ -1228,6 +1261,7 @@ var ri1 = c ^ a; >c : E > : ^ >a : any +> : ^^^ var ri2 = c ^ b; >ri2 : number @@ -1255,6 +1289,7 @@ var ri4 = a ^ c; >a ^ c : number > : ^^^^^^ >a : any +> : ^^^ >c : E > : ^ @@ -1280,6 +1315,7 @@ var ri6 = E.a ^ a; >a : E.a > : ^^^ >a : any +> : ^^^ var ri7 = E.a ^ b; >ri7 : number @@ -1333,6 +1369,7 @@ var ri10 = a ^ E.b; >a ^ E.b : number > : ^^^^^^ >a : any +> : ^^^ >E.b : E.b > : ^^^ >E : typeof E @@ -1377,6 +1414,7 @@ var rj1 = c | a; >c : E > : ^ >a : any +> : ^^^ var rj2 = c | b; >rj2 : number @@ -1404,6 +1442,7 @@ var rj4 = a | c; >a | c : number > : ^^^^^^ >a : any +> : ^^^ >c : E > : ^ @@ -1429,6 +1468,7 @@ var rj6 = E.a | a; >a : E.a > : ^^^ >a : any +> : ^^^ var rj7 = E.a | b; >rj7 : number @@ -1482,6 +1522,7 @@ var rj10 = a | E.b; >a | E.b : number > : ^^^^^^ >a : any +> : ^^^ >E.b : E.b > : ^^^ >E : typeof E diff --git a/tests/baselines/reference/arithmeticOperatorWithEnumUnion.errors.txt b/tests/baselines/reference/arithmeticOperatorWithEnumUnion.errors.txt new file mode 100644 index 0000000000000..4906c1471d268 --- /dev/null +++ b/tests/baselines/reference/arithmeticOperatorWithEnumUnion.errors.txt @@ -0,0 +1,457 @@ +arithmeticOperatorWithEnumUnion.ts(17,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(18,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(18,15): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(19,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(19,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(20,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(21,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(21,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(23,17): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(27,12): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(31,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(32,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(32,15): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(33,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(33,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(34,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(35,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(35,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(37,17): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(41,12): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(45,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(46,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(46,15): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(47,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(47,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(48,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(49,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(49,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(51,17): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(55,12): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(59,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(60,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(60,15): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(61,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(61,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(62,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(63,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(63,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(65,17): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(69,12): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(73,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(74,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(74,16): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(75,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(75,16): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(76,16): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(77,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(77,16): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(79,18): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(83,12): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(87,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(88,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(88,16): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(89,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(89,16): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(90,16): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(91,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(91,16): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(93,18): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(97,12): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(101,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(102,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(102,17): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(103,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(103,17): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(104,17): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(105,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(105,17): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(107,19): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(111,12): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(115,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(116,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(116,15): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(117,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(117,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(118,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(119,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(119,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(121,17): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(125,12): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(129,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(130,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(130,15): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(131,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(131,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(132,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(133,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(133,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(135,17): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(139,12): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(143,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(144,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(144,15): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(145,11): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(145,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(146,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(147,11): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(147,15): error TS2454: Variable 'c' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(149,17): error TS2454: Variable 'b' is used before being assigned. +arithmeticOperatorWithEnumUnion.ts(153,12): error TS2454: Variable 'b' is used before being assigned. + + +==== arithmeticOperatorWithEnumUnion.ts (100 errors) ==== + // operands of an enum type are treated as having the primitive type Number. + + enum E { + a, + b + } + enum F { + c, + d + } + + var a: any; + var b: number; + var c: E | F; + + // operator * + var ra1 = c * a; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var ra2 = c * b; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var ra3 = c * c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var ra4 = a * c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var ra5 = b * c; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var ra6 = E.a * a; + var ra7 = E.a * b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var ra8 = E.a * E.b; + var ra9 = E.a * 1; + var ra10 = a * E.b; + var ra11 = b * E.b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var ra12 = 1 * E.b; + + // operator / + var rb1 = c / a; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rb2 = c / b; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rb3 = c / c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rb4 = a / c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rb5 = b / c; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rb6 = E.a / a; + var rb7 = E.a / b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rb8 = E.a / E.b; + var rb9 = E.a / 1; + var rb10 = a / E.b; + var rb11 = b / E.b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rb12 = 1 / E.b; + + // operator % + var rc1 = c % a; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rc2 = c % b; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rc3 = c % c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rc4 = a % c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rc5 = b % c; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rc6 = E.a % a; + var rc7 = E.a % b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rc8 = E.a % E.b; + var rc9 = E.a % 1; + var rc10 = a % E.b; + var rc11 = b % E.b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rc12 = 1 % E.b; + + // operator - + var rd1 = c - a; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rd2 = c - b; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rd3 = c - c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rd4 = a - c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rd5 = b - c; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rd6 = E.a - a; + var rd7 = E.a - b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rd8 = E.a - E.b; + var rd9 = E.a - 1; + var rd10 = a - E.b; + var rd11 = b - E.b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rd12 = 1 - E.b; + + // operator << + var re1 = c << a; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var re2 = c << b; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var re3 = c << c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var re4 = a << c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var re5 = b << c; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var re6 = E.a << a; + var re7 = E.a << b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var re8 = E.a << E.b; + var re9 = E.a << 1; + var re10 = a << E.b; + var re11 = b << E.b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var re12 = 1 << E.b; + + // operator >> + var rf1 = c >> a; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rf2 = c >> b; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rf3 = c >> c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rf4 = a >> c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rf5 = b >> c; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rf6 = E.a >> a; + var rf7 = E.a >> b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rf8 = E.a >> E.b; + var rf9 = E.a >> 1; + var rf10 = a >> E.b; + var rf11 = b >> E.b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rf12 = 1 >> E.b; + + // operator >>> + var rg1 = c >>> a; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rg2 = c >>> b; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rg3 = c >>> c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rg4 = a >>> c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rg5 = b >>> c; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rg6 = E.a >>> a; + var rg7 = E.a >>> b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rg8 = E.a >>> E.b; + var rg9 = E.a >>> 1; + var rg10 = a >>> E.b; + var rg11 = b >>> E.b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rg12 = 1 >>> E.b; + + // operator & + var rh1 = c & a; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rh2 = c & b; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rh3 = c & c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rh4 = a & c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rh5 = b & c; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rh6 = E.a & a; + var rh7 = E.a & b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rh8 = E.a & E.b; + var rh9 = E.a & 1; + var rh10 = a & E.b; + var rh11 = b & E.b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rh12 = 1 & E.b; + + // operator ^ + var ri1 = c ^ a; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var ri2 = c ^ b; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var ri3 = c ^ c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var ri4 = a ^ c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var ri5 = b ^ c; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var ri6 = E.a ^ a; + var ri7 = E.a ^ b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var ri8 = E.a ^ E.b; + var ri9 = E.a ^ 1; + var ri10 = a ^ E.b; + var ri11 = b ^ E.b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var ri12 = 1 ^ E.b; + + // operator | + var rj1 = c | a; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rj2 = c | b; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rj3 = c | c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rj4 = a | c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rj5 = b | c; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var rj6 = E.a | a; + var rj7 = E.a | b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rj8 = E.a | E.b; + var rj9 = E.a | 1; + var rj10 = a | E.b; + var rj11 = b | E.b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rj12 = 1 | E.b; \ No newline at end of file diff --git a/tests/baselines/reference/arithmeticOperatorWithEnumUnion.js b/tests/baselines/reference/arithmeticOperatorWithEnumUnion.js index d25ed239166d1..111b12017a9b1 100644 --- a/tests/baselines/reference/arithmeticOperatorWithEnumUnion.js +++ b/tests/baselines/reference/arithmeticOperatorWithEnumUnion.js @@ -157,6 +157,7 @@ var rj11 = b | E.b; var rj12 = 1 | E.b; //// [arithmeticOperatorWithEnumUnion.js] +"use strict"; // operands of an enum type are treated as having the primitive type Number. var E; (function (E) { diff --git a/tests/baselines/reference/arithmeticOperatorWithEnumUnion.types b/tests/baselines/reference/arithmeticOperatorWithEnumUnion.types index adddb60902b79..a70b93c200ada 100644 --- a/tests/baselines/reference/arithmeticOperatorWithEnumUnion.types +++ b/tests/baselines/reference/arithmeticOperatorWithEnumUnion.types @@ -30,6 +30,7 @@ enum F { var a: any; >a : any +> : ^^^ var b: number; >b : number @@ -48,6 +49,7 @@ var ra1 = c * a; >c : E | F > : ^^^^^ >a : any +> : ^^^ var ra2 = c * b; >ra2 : number @@ -75,6 +77,7 @@ var ra4 = a * c; >a * c : number > : ^^^^^^ >a : any +> : ^^^ >c : E | F > : ^^^^^ @@ -100,6 +103,7 @@ var ra6 = E.a * a; >a : E.a > : ^^^ >a : any +> : ^^^ var ra7 = E.a * b; >ra7 : number @@ -153,6 +157,7 @@ var ra10 = a * E.b; >a * E.b : number > : ^^^^^^ >a : any +> : ^^^ >E.b : E.b > : ^^^ >E : typeof E @@ -197,6 +202,7 @@ var rb1 = c / a; >c : E | F > : ^^^^^ >a : any +> : ^^^ var rb2 = c / b; >rb2 : number @@ -224,6 +230,7 @@ var rb4 = a / c; >a / c : number > : ^^^^^^ >a : any +> : ^^^ >c : E | F > : ^^^^^ @@ -249,6 +256,7 @@ var rb6 = E.a / a; >a : E.a > : ^^^ >a : any +> : ^^^ var rb7 = E.a / b; >rb7 : number @@ -302,6 +310,7 @@ var rb10 = a / E.b; >a / E.b : number > : ^^^^^^ >a : any +> : ^^^ >E.b : E.b > : ^^^ >E : typeof E @@ -346,6 +355,7 @@ var rc1 = c % a; >c : E | F > : ^^^^^ >a : any +> : ^^^ var rc2 = c % b; >rc2 : number @@ -373,6 +383,7 @@ var rc4 = a % c; >a % c : number > : ^^^^^^ >a : any +> : ^^^ >c : E | F > : ^^^^^ @@ -398,6 +409,7 @@ var rc6 = E.a % a; >a : E.a > : ^^^ >a : any +> : ^^^ var rc7 = E.a % b; >rc7 : number @@ -451,6 +463,7 @@ var rc10 = a % E.b; >a % E.b : number > : ^^^^^^ >a : any +> : ^^^ >E.b : E.b > : ^^^ >E : typeof E @@ -495,6 +508,7 @@ var rd1 = c - a; >c : E | F > : ^^^^^ >a : any +> : ^^^ var rd2 = c - b; >rd2 : number @@ -522,6 +536,7 @@ var rd4 = a - c; >a - c : number > : ^^^^^^ >a : any +> : ^^^ >c : E | F > : ^^^^^ @@ -547,6 +562,7 @@ var rd6 = E.a - a; >a : E.a > : ^^^ >a : any +> : ^^^ var rd7 = E.a - b; >rd7 : number @@ -600,6 +616,7 @@ var rd10 = a - E.b; >a - E.b : number > : ^^^^^^ >a : any +> : ^^^ >E.b : E.b > : ^^^ >E : typeof E @@ -644,6 +661,7 @@ var re1 = c << a; >c : E | F > : ^^^^^ >a : any +> : ^^^ var re2 = c << b; >re2 : number @@ -671,6 +689,7 @@ var re4 = a << c; >a << c : number > : ^^^^^^ >a : any +> : ^^^ >c : E | F > : ^^^^^ @@ -696,6 +715,7 @@ var re6 = E.a << a; >a : E.a > : ^^^ >a : any +> : ^^^ var re7 = E.a << b; >re7 : number @@ -749,6 +769,7 @@ var re10 = a << E.b; >a << E.b : number > : ^^^^^^ >a : any +> : ^^^ >E.b : E.b > : ^^^ >E : typeof E @@ -793,6 +814,7 @@ var rf1 = c >> a; >c : E | F > : ^^^^^ >a : any +> : ^^^ var rf2 = c >> b; >rf2 : number @@ -820,6 +842,7 @@ var rf4 = a >> c; >a >> c : number > : ^^^^^^ >a : any +> : ^^^ >c : E | F > : ^^^^^ @@ -845,6 +868,7 @@ var rf6 = E.a >> a; >a : E.a > : ^^^ >a : any +> : ^^^ var rf7 = E.a >> b; >rf7 : number @@ -898,6 +922,7 @@ var rf10 = a >> E.b; >a >> E.b : number > : ^^^^^^ >a : any +> : ^^^ >E.b : E.b > : ^^^ >E : typeof E @@ -942,6 +967,7 @@ var rg1 = c >>> a; >c : E | F > : ^^^^^ >a : any +> : ^^^ var rg2 = c >>> b; >rg2 : number @@ -969,6 +995,7 @@ var rg4 = a >>> c; >a >>> c : number > : ^^^^^^ >a : any +> : ^^^ >c : E | F > : ^^^^^ @@ -994,6 +1021,7 @@ var rg6 = E.a >>> a; >a : E.a > : ^^^ >a : any +> : ^^^ var rg7 = E.a >>> b; >rg7 : number @@ -1047,6 +1075,7 @@ var rg10 = a >>> E.b; >a >>> E.b : number > : ^^^^^^ >a : any +> : ^^^ >E.b : E.b > : ^^^ >E : typeof E @@ -1091,6 +1120,7 @@ var rh1 = c & a; >c : E | F > : ^^^^^ >a : any +> : ^^^ var rh2 = c & b; >rh2 : number @@ -1118,6 +1148,7 @@ var rh4 = a & c; >a & c : number > : ^^^^^^ >a : any +> : ^^^ >c : E | F > : ^^^^^ @@ -1143,6 +1174,7 @@ var rh6 = E.a & a; >a : E.a > : ^^^ >a : any +> : ^^^ var rh7 = E.a & b; >rh7 : number @@ -1196,6 +1228,7 @@ var rh10 = a & E.b; >a & E.b : number > : ^^^^^^ >a : any +> : ^^^ >E.b : E.b > : ^^^ >E : typeof E @@ -1240,6 +1273,7 @@ var ri1 = c ^ a; >c : E | F > : ^^^^^ >a : any +> : ^^^ var ri2 = c ^ b; >ri2 : number @@ -1267,6 +1301,7 @@ var ri4 = a ^ c; >a ^ c : number > : ^^^^^^ >a : any +> : ^^^ >c : E | F > : ^^^^^ @@ -1292,6 +1327,7 @@ var ri6 = E.a ^ a; >a : E.a > : ^^^ >a : any +> : ^^^ var ri7 = E.a ^ b; >ri7 : number @@ -1345,6 +1381,7 @@ var ri10 = a ^ E.b; >a ^ E.b : number > : ^^^^^^ >a : any +> : ^^^ >E.b : E.b > : ^^^ >E : typeof E @@ -1389,6 +1426,7 @@ var rj1 = c | a; >c : E | F > : ^^^^^ >a : any +> : ^^^ var rj2 = c | b; >rj2 : number @@ -1416,6 +1454,7 @@ var rj4 = a | c; >a | c : number > : ^^^^^^ >a : any +> : ^^^ >c : E | F > : ^^^^^ @@ -1441,6 +1480,7 @@ var rj6 = E.a | a; >a : E.a > : ^^^ >a : any +> : ^^^ var rj7 = E.a | b; >rj7 : number @@ -1494,6 +1534,7 @@ var rj10 = a | E.b; >a | E.b : number > : ^^^^^^ >a : any +> : ^^^ >E.b : E.b > : ^^^ >E : typeof E diff --git a/tests/baselines/reference/arithmeticOperatorWithInvalidOperands.js b/tests/baselines/reference/arithmeticOperatorWithInvalidOperands.js index e8a6cfa93d418..21b8733c041b5 100644 --- a/tests/baselines/reference/arithmeticOperatorWithInvalidOperands.js +++ b/tests/baselines/reference/arithmeticOperatorWithInvalidOperands.js @@ -584,6 +584,7 @@ var r10h5 = e | E.b; var r10h6 = f | E.b; //// [arithmeticOperatorWithInvalidOperands.js] +"use strict"; // these operators require their operands to be of type Any, the Number primitive type, or // an enum type var E; diff --git a/tests/baselines/reference/arithmeticOperatorWithNullValueAndInvalidOperands.js b/tests/baselines/reference/arithmeticOperatorWithNullValueAndInvalidOperands.js index 9cd24a96541d2..3f40bd5a23aa1 100644 --- a/tests/baselines/reference/arithmeticOperatorWithNullValueAndInvalidOperands.js +++ b/tests/baselines/reference/arithmeticOperatorWithNullValueAndInvalidOperands.js @@ -179,6 +179,7 @@ var r10d2 = '' | null; var r10d3 = {} | null; //// [arithmeticOperatorWithNullValueAndInvalidOperands.js] +"use strict"; // If one operand is the null or undefined value, it is treated as having the type of the // other operand. // operator * diff --git a/tests/baselines/reference/arithmeticOperatorWithNullValueAndValidOperands.js b/tests/baselines/reference/arithmeticOperatorWithNullValueAndValidOperands.js index eef8b00890737..bde29da889a83 100644 --- a/tests/baselines/reference/arithmeticOperatorWithNullValueAndValidOperands.js +++ b/tests/baselines/reference/arithmeticOperatorWithNullValueAndValidOperands.js @@ -113,6 +113,7 @@ var rj7 = 0 | null; var rj8 = E.b | null; //// [arithmeticOperatorWithNullValueAndValidOperands.js] +"use strict"; // If one operand is the null or undefined value, it is treated as having the type of the // other operand. var E; diff --git a/tests/baselines/reference/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.js b/tests/baselines/reference/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.js index 6c8e9babfbfb3..07dbeff6ca773 100644 --- a/tests/baselines/reference/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.js +++ b/tests/baselines/reference/arithmeticOperatorWithOnlyNullValueOrUndefinedValue.js @@ -62,6 +62,7 @@ var rj3 = undefined | null; var rj4 = undefined | undefined; //// [arithmeticOperatorWithOnlyNullValueOrUndefinedValue.js] +"use strict"; // operator * var ra1 = null * null; var ra2 = null * undefined; diff --git a/tests/baselines/reference/arithmeticOperatorWithTypeParameter.js b/tests/baselines/reference/arithmeticOperatorWithTypeParameter.js index 7fbaca72e110f..f7e4dd6a4b1e9 100644 --- a/tests/baselines/reference/arithmeticOperatorWithTypeParameter.js +++ b/tests/baselines/reference/arithmeticOperatorWithTypeParameter.js @@ -132,6 +132,7 @@ function foo(t: T) { } //// [arithmeticOperatorWithTypeParameter.js] +"use strict"; // type parameter type is not valid for arithmetic operand function foo(t) { let a; diff --git a/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndInvalidOperands.js b/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndInvalidOperands.js index a771640b820d3..bf390501ce9bb 100644 --- a/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndInvalidOperands.js +++ b/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndInvalidOperands.js @@ -179,6 +179,7 @@ var r10d2 = '' | undefined; var r10d3 = {} | undefined; //// [arithmeticOperatorWithUndefinedValueAndInvalidOperands.js] +"use strict"; // If one operand is the undefined or undefined value, it is treated as having the type of the // other operand. // operator * diff --git a/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndValidOperands.js b/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndValidOperands.js index b87edf044ecd8..1c0ba6c1e3895 100644 --- a/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndValidOperands.js +++ b/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndValidOperands.js @@ -113,6 +113,7 @@ var rj7 = 0 | undefined; var rj8 = E.b | undefined; //// [arithmeticOperatorWithUndefinedValueAndValidOperands.js] +"use strict"; // If one operand is the undefined or undefined value, it is treated as having the type of the // other operand. var E; diff --git a/tests/baselines/reference/arityAndOrderCompatibility01.js b/tests/baselines/reference/arityAndOrderCompatibility01.js index 5d83b413c9373..4a5db666d9c6d 100644 --- a/tests/baselines/reference/arityAndOrderCompatibility01.js +++ b/tests/baselines/reference/arityAndOrderCompatibility01.js @@ -39,6 +39,7 @@ var o3: [string, number] = y; //// [arityAndOrderCompatibility01.js] +"use strict"; var [a, b, c] = x; var [d, e, f] = y; var [g, h, i] = z; diff --git a/tests/baselines/reference/arityErrorRelatedSpanBindingPattern.js b/tests/baselines/reference/arityErrorRelatedSpanBindingPattern.js index 61e156447ea13..786e816d1ff8b 100644 --- a/tests/baselines/reference/arityErrorRelatedSpanBindingPattern.js +++ b/tests/baselines/reference/arityErrorRelatedSpanBindingPattern.js @@ -11,6 +11,7 @@ bar("", 0); //// [arityErrorRelatedSpanBindingPattern.js] +"use strict"; function foo(a, b, { c }) { } function bar(a, b, [c]) { } foo("", 0); diff --git a/tests/baselines/reference/arrayAssignmentPatternWithAny.js b/tests/baselines/reference/arrayAssignmentPatternWithAny.js index 0476548d87bc6..6c7fca3dd55f7 100644 --- a/tests/baselines/reference/arrayAssignmentPatternWithAny.js +++ b/tests/baselines/reference/arrayAssignmentPatternWithAny.js @@ -6,6 +6,7 @@ var x: string; [x] = a; //// [arrayAssignmentPatternWithAny.js] +"use strict"; var a; var x; [x] = a; diff --git a/tests/baselines/reference/arrayAssignmentTest1.errors.txt b/tests/baselines/reference/arrayAssignmentTest1.errors.txt index 6ff1f037b1214..39b9461c296e4 100644 --- a/tests/baselines/reference/arrayAssignmentTest1.errors.txt +++ b/tests/baselines/reference/arrayAssignmentTest1.errors.txt @@ -1,7 +1,10 @@ -arrayAssignmentTest1.ts(46,5): error TS2741: Property 'IM1' is missing in type 'undefined[]' but required in type 'I1'. -arrayAssignmentTest1.ts(47,5): error TS2739: Type 'undefined[]' is missing the following properties from type 'C1': IM1, C1M1 -arrayAssignmentTest1.ts(48,5): error TS2739: Type 'undefined[]' is missing the following properties from type 'C2': C2M1, IM1, C1M1 -arrayAssignmentTest1.ts(49,5): error TS2741: Property 'CM3M1' is missing in type 'undefined[]' but required in type 'C3'. +arrayAssignmentTest1.ts(6,16): error TS2322: Type 'null' is not assignable to type 'void[]'. +arrayAssignmentTest1.ts(7,15): error TS2322: Type 'null' is not assignable to type 'C1[]'. +arrayAssignmentTest1.ts(10,19): error TS2322: Type 'null' is not assignable to type 'C2[]'. +arrayAssignmentTest1.ts(46,5): error TS2741: Property 'IM1' is missing in type 'never[]' but required in type 'I1'. +arrayAssignmentTest1.ts(47,5): error TS2739: Type 'never[]' is missing the following properties from type 'C1': IM1, C1M1 +arrayAssignmentTest1.ts(48,5): error TS2739: Type 'never[]' is missing the following properties from type 'C2': C2M1, IM1, C1M1 +arrayAssignmentTest1.ts(49,5): error TS2741: Property 'CM3M1' is missing in type 'never[]' but required in type 'C3'. arrayAssignmentTest1.ts(60,1): error TS2322: Type 'C3[]' is not assignable to type 'I1[]'. Property 'IM1' is missing in type 'C3' but required in type 'I1'. arrayAssignmentTest1.ts(64,1): error TS2322: Type 'I1[]' is not assignable to type 'C1[]'. @@ -28,17 +31,23 @@ arrayAssignmentTest1.ts(84,1): error TS2740: Type 'C3' is missing the following arrayAssignmentTest1.ts(85,1): error TS2740: Type 'I1' is missing the following properties from type 'any[]': length, pop, push, concat, and 25 more. -==== arrayAssignmentTest1.ts (19 errors) ==== +==== arrayAssignmentTest1.ts (22 errors) ==== interface I1 { IM1():void[]; } class C1 implements I1 { IM1():void[] {return null;} + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'void[]'. C1M1():C1[] {return null;} + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'C1[]'. } class C2 extends C1 { C2M1():C2[] { return null;} + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'C2[]'. } class C3 { @@ -76,17 +85,17 @@ arrayAssignmentTest1.ts(85,1): error TS2740: Type 'I1' is missing the following var i1_error: I1 = []; // should be an error - is ~~~~~~~~ -!!! error TS2741: Property 'IM1' is missing in type 'undefined[]' but required in type 'I1'. +!!! error TS2741: Property 'IM1' is missing in type 'never[]' but required in type 'I1'. !!! related TS2728 arrayAssignmentTest1.ts:2:2: 'IM1' is declared here. var c1_error: C1 = []; // should be an error - is ~~~~~~~~ -!!! error TS2739: Type 'undefined[]' is missing the following properties from type 'C1': IM1, C1M1 +!!! error TS2739: Type 'never[]' is missing the following properties from type 'C1': IM1, C1M1 var c2_error: C2 = []; // should be an error - is ~~~~~~~~ -!!! error TS2739: Type 'undefined[]' is missing the following properties from type 'C2': C2M1, IM1, C1M1 +!!! error TS2739: Type 'never[]' is missing the following properties from type 'C2': C2M1, IM1, C1M1 var c3_error: C3 = []; // should be an error - is ~~~~~~~~ -!!! error TS2741: Property 'CM3M1' is missing in type 'undefined[]' but required in type 'C3'. +!!! error TS2741: Property 'CM3M1' is missing in type 'never[]' but required in type 'C3'. !!! related TS2728 arrayAssignmentTest1.ts:14:5: 'CM3M1' is declared here. diff --git a/tests/baselines/reference/arrayAssignmentTest1.js b/tests/baselines/reference/arrayAssignmentTest1.js index 6843dc672ba48..ce2e89dc79ed8 100644 --- a/tests/baselines/reference/arrayAssignmentTest1.js +++ b/tests/baselines/reference/arrayAssignmentTest1.js @@ -88,6 +88,7 @@ arr_any = c3; // should be an error - is arr_any = i1; // should be an error - is //// [arrayAssignmentTest1.js] +"use strict"; class C1 { IM1() { return null; } C1M1() { return null; } diff --git a/tests/baselines/reference/arrayAssignmentTest1.types b/tests/baselines/reference/arrayAssignmentTest1.types index 12cc59410518e..1ccc8e105e17a 100644 --- a/tests/baselines/reference/arrayAssignmentTest1.types +++ b/tests/baselines/reference/arrayAssignmentTest1.types @@ -110,74 +110,74 @@ var f1 = function () { return new C1();} var arr_any: any[] = []; >arr_any : any[] > : ^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ var arr_i1: I1[] = []; >arr_i1 : I1[] > : ^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ var arr_c1: C1[] = []; >arr_c1 : C1[] > : ^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ var arr_c2: C2[] = []; >arr_c2 : C2[] > : ^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ var arr_i1_2: I1[] = []; >arr_i1_2 : I1[] > : ^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ var arr_c1_2: C1[] = []; >arr_c1_2 : C1[] > : ^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ var arr_c2_2: C2[] = []; >arr_c2_2 : C2[] > : ^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ var arr_c3: C3[] = []; >arr_c3 : C3[] > : ^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ var i1_error: I1 = []; // should be an error - is >i1_error : I1 > : ^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ var c1_error: C1 = []; // should be an error - is >c1_error : C1 > : ^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ var c2_error: C2 = []; // should be an error - is >c2_error : C2 > : ^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ var c3_error: C3 = []; // should be an error - is >c3_error : C3 > : ^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ arr_any = arr_i1; // should be ok - is diff --git a/tests/baselines/reference/arrayAssignmentTest2.js b/tests/baselines/reference/arrayAssignmentTest2.js index 432c43dd6870c..9169dc4a674ab 100644 --- a/tests/baselines/reference/arrayAssignmentTest2.js +++ b/tests/baselines/reference/arrayAssignmentTest2.js @@ -62,6 +62,7 @@ arr_any = i1; // should be an error - is //// [arrayAssignmentTest2.js] +"use strict"; class C1 { IM1() { return null; } C1M1() { return null; } diff --git a/tests/baselines/reference/arrayAssignmentTest3.errors.txt b/tests/baselines/reference/arrayAssignmentTest3.errors.txt index 029bb3f703640..77ab6c29c106d 100644 --- a/tests/baselines/reference/arrayAssignmentTest3.errors.txt +++ b/tests/baselines/reference/arrayAssignmentTest3.errors.txt @@ -1,5 +1,4 @@ -arrayAssignmentTest3.ts(12,25): error TS2345: Argument of type 'B' is not assignable to parameter of type 'B[]'. - Type 'B' is missing the following properties from type 'B[]': length, pop, push, concat, and 25 more. +arrayAssignmentTest3.ts(12,16): error TS2345: Argument of type 'null' is not assignable to parameter of type 'string'. ==== arrayAssignmentTest3.ts (1 errors) ==== @@ -15,8 +14,7 @@ arrayAssignmentTest3.ts(12,25): error TS2345: Argument of type 'B' is not assign var xx = new a(null, 7, new B()); - ~~~~~~~ -!!! error TS2345: Argument of type 'B' is not assignable to parameter of type 'B[]'. -!!! error TS2345: Type 'B' is missing the following properties from type 'B[]': length, pop, push, concat, and 25 more. + ~~~~ +!!! error TS2345: Argument of type 'null' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/arrayAssignmentTest3.js b/tests/baselines/reference/arrayAssignmentTest3.js index 35e14b292ed9b..414c34c5c37e3 100644 --- a/tests/baselines/reference/arrayAssignmentTest3.js +++ b/tests/baselines/reference/arrayAssignmentTest3.js @@ -17,6 +17,7 @@ var xx = new a(null, 7, new B()); //// [arrayAssignmentTest3.js] +"use strict"; // The following gives no error // Michal saw no error if he used number instead of B, // but I do... diff --git a/tests/baselines/reference/arrayAssignmentTest4.js b/tests/baselines/reference/arrayAssignmentTest4.js index 66c701032999d..81defbd34cb08 100644 --- a/tests/baselines/reference/arrayAssignmentTest4.js +++ b/tests/baselines/reference/arrayAssignmentTest4.js @@ -27,6 +27,7 @@ arr_any = c3; // should be an error - is //// [arrayAssignmentTest4.js] +"use strict"; class C3 { CM3M1() { return 3; } } diff --git a/tests/baselines/reference/arrayAssignmentTest5.errors.txt b/tests/baselines/reference/arrayAssignmentTest5.errors.txt index ffbb476fe8d4c..097e5dcd64b0c 100644 --- a/tests/baselines/reference/arrayAssignmentTest5.errors.txt +++ b/tests/baselines/reference/arrayAssignmentTest5.errors.txt @@ -1,8 +1,10 @@ +arrayAssignmentTest5.ts(21,66): error TS2366: Function lacks ending return statement and return type does not include 'undefined'. arrayAssignmentTest5.ts(23,17): error TS2322: Type 'IToken[]' is not assignable to type 'IStateToken[]'. Property 'state' is missing in type 'IToken' but required in type 'IStateToken'. +arrayAssignmentTest5.ts(29,13): error TS2322: Type 'null' is not assignable to type 'ILineTokens'. -==== arrayAssignmentTest5.ts (1 errors) ==== +==== arrayAssignmentTest5.ts (3 errors) ==== namespace Test { interface IState { } @@ -24,6 +26,8 @@ arrayAssignmentTest5.ts(23,17): error TS2322: Type 'IToken[]' is not assignable } export class Bug implements IMode { public onEnter(line:string, state:IState, offset:number):IAction { + ~~~~~~~ +!!! error TS2366: Function lacks ending return statement and return type does not include 'undefined'. var lineTokens:ILineTokens= this.tokenize(line, state, true); var tokens:IStateToken[]= lineTokens.tokens; ~~~~~~ @@ -36,6 +40,8 @@ arrayAssignmentTest5.ts(23,17): error TS2322: Type 'IToken[]' is not assignable } public tokenize(line:string, state:IState, includeStates:boolean):ILineTokens { return null; + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'ILineTokens'. } } } diff --git a/tests/baselines/reference/arrayAssignmentTest5.js b/tests/baselines/reference/arrayAssignmentTest5.js index e1006e91b81b6..5518894b94606 100644 --- a/tests/baselines/reference/arrayAssignmentTest5.js +++ b/tests/baselines/reference/arrayAssignmentTest5.js @@ -36,6 +36,7 @@ namespace Test { //// [arrayAssignmentTest5.js] +"use strict"; var Test; (function (Test) { class Bug { diff --git a/tests/baselines/reference/arrayAssignmentTest6.errors.txt b/tests/baselines/reference/arrayAssignmentTest6.errors.txt new file mode 100644 index 0000000000000..23731806943e0 --- /dev/null +++ b/tests/baselines/reference/arrayAssignmentTest6.errors.txt @@ -0,0 +1,26 @@ +arrayAssignmentTest6.ts(16,13): error TS2322: Type 'null' is not assignable to type 'ILineTokens'. + + +==== arrayAssignmentTest6.ts (1 errors) ==== + namespace Test { + interface IState { + } + interface IToken { + startIndex: number; + } + interface ILineTokens { + tokens: IToken[]; + endState: IState; + } + interface IMode { + tokenize(line:string, state:IState, includeStates:boolean):ILineTokens; + } + export class Bug implements IMode { + public tokenize(line:string, tokens:IToken[], includeStates:boolean):ILineTokens { + return null; + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'ILineTokens'. + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/arrayAssignmentTest6.js b/tests/baselines/reference/arrayAssignmentTest6.js index 7a521047fc2ce..144d64fd1e84a 100644 --- a/tests/baselines/reference/arrayAssignmentTest6.js +++ b/tests/baselines/reference/arrayAssignmentTest6.js @@ -23,6 +23,7 @@ namespace Test { //// [arrayAssignmentTest6.js] +"use strict"; var Test; (function (Test) { class Bug { diff --git a/tests/baselines/reference/arrayAugment.js b/tests/baselines/reference/arrayAugment.js index 887b7eb854d53..bb33dc5e34785 100644 --- a/tests/baselines/reference/arrayAugment.js +++ b/tests/baselines/reference/arrayAugment.js @@ -11,6 +11,7 @@ var y: string[][]; // Expect no error here //// [arrayAugment.js] +"use strict"; var x = ['']; var y = x.split(4); var y; // Expect no error here diff --git a/tests/baselines/reference/arrayBestCommonTypes.errors.txt b/tests/baselines/reference/arrayBestCommonTypes.errors.txt new file mode 100644 index 0000000000000..4997bb8e791d5 --- /dev/null +++ b/tests/baselines/reference/arrayBestCommonTypes.errors.txt @@ -0,0 +1,623 @@ +arrayBestCommonTypes.ts(16,37): error TS2769: No overload matches this call. + Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | undefined' is not assignable to parameter of type 'boolean'. + Type 'undefined' is not assignable to type 'boolean'. + Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | undefined' is not assignable to parameter of type 'string'. + Type 'undefined' is not assignable to type 'string'. + Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | undefined' is not assignable to parameter of type 'number'. + Type 'undefined' is not assignable to type 'number'. +arrayBestCommonTypes.ts(17,37): error TS2769: No overload matches this call. + Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | undefined' is not assignable to parameter of type 'boolean'. + Type 'undefined' is not assignable to type 'boolean'. + Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | undefined' is not assignable to parameter of type 'string'. + Type 'undefined' is not assignable to type 'string'. + Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | undefined' is not assignable to parameter of type 'number'. + Type 'undefined' is not assignable to type 'number'. +arrayBestCommonTypes.ts(18,37): error TS2769: No overload matches this call. + Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | null' is not assignable to parameter of type 'boolean'. + Type 'null' is not assignable to type 'boolean'. + Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | null' is not assignable to parameter of type 'string'. + Type 'null' is not assignable to type 'string'. + Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | null' is not assignable to parameter of type 'number'. + Type 'null' is not assignable to type 'number'. +arrayBestCommonTypes.ts(19,37): error TS2769: No overload matches this call. + Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | null' is not assignable to parameter of type 'boolean'. + Type 'null' is not assignable to type 'boolean'. + Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | null' is not assignable to parameter of type 'string'. + Type 'null' is not assignable to type 'string'. + Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | null' is not assignable to parameter of type 'number'. + Type 'null' is not assignable to type 'number'. +arrayBestCommonTypes.ts(20,37): error TS2769: No overload matches this call. + Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | null | undefined' is not assignable to parameter of type 'boolean'. + Type 'undefined' is not assignable to type 'boolean'. + Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | null | undefined' is not assignable to parameter of type 'string'. + Type 'undefined' is not assignable to type 'string'. + Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | null | undefined' is not assignable to parameter of type 'number'. + Type 'undefined' is not assignable to type 'number'. +arrayBestCommonTypes.ts(23,37): error TS2769: No overload matches this call. + Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. + Argument of type 'string | undefined' is not assignable to parameter of type 'boolean'. + Type 'undefined' is not assignable to type 'boolean'. + Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. + Argument of type 'string | undefined' is not assignable to parameter of type 'string'. + Type 'undefined' is not assignable to type 'string'. + Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. + Argument of type 'string | undefined' is not assignable to parameter of type 'number'. + Type 'undefined' is not assignable to type 'number'. +arrayBestCommonTypes.ts(24,37): error TS2769: No overload matches this call. + Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. + Argument of type 'string | undefined' is not assignable to parameter of type 'boolean'. + Type 'undefined' is not assignable to type 'boolean'. + Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. + Argument of type 'string | undefined' is not assignable to parameter of type 'string'. + Type 'undefined' is not assignable to type 'string'. + Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. + Argument of type 'string | undefined' is not assignable to parameter of type 'number'. + Type 'undefined' is not assignable to type 'number'. +arrayBestCommonTypes.ts(25,37): error TS2769: No overload matches this call. + Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. + Argument of type 'string | null' is not assignable to parameter of type 'boolean'. + Type 'null' is not assignable to type 'boolean'. + Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. + Argument of type 'string | null' is not assignable to parameter of type 'string'. + Type 'null' is not assignable to type 'string'. + Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. + Argument of type 'string | null' is not assignable to parameter of type 'number'. + Type 'null' is not assignable to type 'number'. +arrayBestCommonTypes.ts(26,37): error TS2769: No overload matches this call. + Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. + Argument of type 'string | null' is not assignable to parameter of type 'boolean'. + Type 'null' is not assignable to type 'boolean'. + Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. + Argument of type 'string | null' is not assignable to parameter of type 'string'. + Type 'null' is not assignable to type 'string'. + Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. + Argument of type 'string | null' is not assignable to parameter of type 'number'. + Type 'null' is not assignable to type 'number'. +arrayBestCommonTypes.ts(27,37): error TS2769: No overload matches this call. + Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. + Argument of type 'string | null | undefined' is not assignable to parameter of type 'boolean'. + Type 'undefined' is not assignable to type 'boolean'. + Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. + Argument of type 'string | null | undefined' is not assignable to parameter of type 'string'. + Type 'undefined' is not assignable to type 'string'. + Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. + Argument of type 'string | null | undefined' is not assignable to parameter of type 'number'. + Type 'undefined' is not assignable to type 'number'. +arrayBestCommonTypes.ts(29,37): error TS2769: No overload matches this call. + Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | null' is not assignable to parameter of type 'boolean'. + Type 'null' is not assignable to type 'boolean'. + Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | null' is not assignable to parameter of type 'string'. + Type 'null' is not assignable to type 'string'. + Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | null' is not assignable to parameter of type 'number'. + Type 'null' is not assignable to type 'number'. +arrayBestCommonTypes.ts(34,52): error TS2322: Type 'undefined' is not assignable to type 'string'. +arrayBestCommonTypes.ts(42,17): error TS2322: Type 'null' is not assignable to type 'iface'. +arrayBestCommonTypes.ts(56,35): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. +arrayBestCommonTypes.ts(56,46): error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. +arrayBestCommonTypes.ts(57,36): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. +arrayBestCommonTypes.ts(57,47): error TS2564: Property 'z' has no initializer and is not definitely assigned in the constructor. +arrayBestCommonTypes.ts(58,34): error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. +arrayBestCommonTypes.ts(69,37): error TS2769: No overload matches this call. + Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | undefined' is not assignable to parameter of type 'boolean'. + Type 'undefined' is not assignable to type 'boolean'. + Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | undefined' is not assignable to parameter of type 'string'. + Type 'undefined' is not assignable to type 'string'. + Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | undefined' is not assignable to parameter of type 'number'. + Type 'undefined' is not assignable to type 'number'. +arrayBestCommonTypes.ts(70,37): error TS2769: No overload matches this call. + Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | undefined' is not assignable to parameter of type 'boolean'. + Type 'undefined' is not assignable to type 'boolean'. + Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | undefined' is not assignable to parameter of type 'string'. + Type 'undefined' is not assignable to type 'string'. + Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | undefined' is not assignable to parameter of type 'number'. + Type 'undefined' is not assignable to type 'number'. +arrayBestCommonTypes.ts(71,37): error TS2769: No overload matches this call. + Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | null' is not assignable to parameter of type 'boolean'. + Type 'null' is not assignable to type 'boolean'. + Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | null' is not assignable to parameter of type 'string'. + Type 'null' is not assignable to type 'string'. + Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | null' is not assignable to parameter of type 'number'. + Type 'null' is not assignable to type 'number'. +arrayBestCommonTypes.ts(72,37): error TS2769: No overload matches this call. + Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | null' is not assignable to parameter of type 'boolean'. + Type 'null' is not assignable to type 'boolean'. + Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | null' is not assignable to parameter of type 'string'. + Type 'null' is not assignable to type 'string'. + Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | null' is not assignable to parameter of type 'number'. + Type 'null' is not assignable to type 'number'. +arrayBestCommonTypes.ts(73,37): error TS2769: No overload matches this call. + Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | null | undefined' is not assignable to parameter of type 'boolean'. + Type 'undefined' is not assignable to type 'boolean'. + Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | null | undefined' is not assignable to parameter of type 'string'. + Type 'undefined' is not assignable to type 'string'. + Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | null | undefined' is not assignable to parameter of type 'number'. + Type 'undefined' is not assignable to type 'number'. +arrayBestCommonTypes.ts(76,37): error TS2769: No overload matches this call. + Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. + Argument of type 'string | undefined' is not assignable to parameter of type 'boolean'. + Type 'undefined' is not assignable to type 'boolean'. + Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. + Argument of type 'string | undefined' is not assignable to parameter of type 'string'. + Type 'undefined' is not assignable to type 'string'. + Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. + Argument of type 'string | undefined' is not assignable to parameter of type 'number'. + Type 'undefined' is not assignable to type 'number'. +arrayBestCommonTypes.ts(77,37): error TS2769: No overload matches this call. + Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. + Argument of type 'string | undefined' is not assignable to parameter of type 'boolean'. + Type 'undefined' is not assignable to type 'boolean'. + Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. + Argument of type 'string | undefined' is not assignable to parameter of type 'string'. + Type 'undefined' is not assignable to type 'string'. + Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. + Argument of type 'string | undefined' is not assignable to parameter of type 'number'. + Type 'undefined' is not assignable to type 'number'. +arrayBestCommonTypes.ts(78,37): error TS2769: No overload matches this call. + Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. + Argument of type 'string | null' is not assignable to parameter of type 'boolean'. + Type 'null' is not assignable to type 'boolean'. + Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. + Argument of type 'string | null' is not assignable to parameter of type 'string'. + Type 'null' is not assignable to type 'string'. + Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. + Argument of type 'string | null' is not assignable to parameter of type 'number'. + Type 'null' is not assignable to type 'number'. +arrayBestCommonTypes.ts(79,37): error TS2769: No overload matches this call. + Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. + Argument of type 'string | null' is not assignable to parameter of type 'boolean'. + Type 'null' is not assignable to type 'boolean'. + Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. + Argument of type 'string | null' is not assignable to parameter of type 'string'. + Type 'null' is not assignable to type 'string'. + Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. + Argument of type 'string | null' is not assignable to parameter of type 'number'. + Type 'null' is not assignable to type 'number'. +arrayBestCommonTypes.ts(80,37): error TS2769: No overload matches this call. + Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. + Argument of type 'string | null | undefined' is not assignable to parameter of type 'boolean'. + Type 'undefined' is not assignable to type 'boolean'. + Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. + Argument of type 'string | null | undefined' is not assignable to parameter of type 'string'. + Type 'undefined' is not assignable to type 'string'. + Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. + Argument of type 'string | null | undefined' is not assignable to parameter of type 'number'. + Type 'undefined' is not assignable to type 'number'. +arrayBestCommonTypes.ts(82,37): error TS2769: No overload matches this call. + Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | null' is not assignable to parameter of type 'boolean'. + Type 'null' is not assignable to type 'boolean'. + Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | null' is not assignable to parameter of type 'string'. + Type 'null' is not assignable to type 'string'. + Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. + Argument of type 'number | null' is not assignable to parameter of type 'number'. + Type 'null' is not assignable to type 'number'. +arrayBestCommonTypes.ts(87,52): error TS2322: Type 'undefined' is not assignable to type 'string'. +arrayBestCommonTypes.ts(95,17): error TS2322: Type 'null' is not assignable to type 'iface'. + + +==== arrayBestCommonTypes.ts (31 errors) ==== + namespace EmptyTypes { + interface iface { } + class base implements iface { } + class base2 implements iface { } + class derived extends base { } + + + class f { + public voidIfAny(x: boolean, y?: boolean): number; + public voidIfAny(x: string, y?: boolean): number; + public voidIfAny(x: number, y?: boolean): number; + public voidIfAny(x: any, y = false): any { return null; } + + public x() { + (this.voidIfAny([4, 2][0])); + (this.voidIfAny([4, 2, undefined][0])); + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | undefined' is not assignable to parameter of type 'boolean'. +!!! error TS2769: Type 'undefined' is not assignable to type 'boolean'. +!!! error TS2769: Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | undefined' is not assignable to parameter of type 'string'. +!!! error TS2769: Type 'undefined' is not assignable to type 'string'. +!!! error TS2769: Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | undefined' is not assignable to parameter of type 'number'. +!!! error TS2769: Type 'undefined' is not assignable to type 'number'. +!!! related TS2793 arrayBestCommonTypes.ts:12:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. + (this.voidIfAny([undefined, 2, 4][0])); + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | undefined' is not assignable to parameter of type 'boolean'. +!!! error TS2769: Type 'undefined' is not assignable to type 'boolean'. +!!! error TS2769: Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | undefined' is not assignable to parameter of type 'string'. +!!! error TS2769: Type 'undefined' is not assignable to type 'string'. +!!! error TS2769: Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | undefined' is not assignable to parameter of type 'number'. +!!! error TS2769: Type 'undefined' is not assignable to type 'number'. +!!! related TS2793 arrayBestCommonTypes.ts:12:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. + (this.voidIfAny([null, 2, 4][0])); + ~~~~~~~~~~~~~~~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | null' is not assignable to parameter of type 'boolean'. +!!! error TS2769: Type 'null' is not assignable to type 'boolean'. +!!! error TS2769: Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | null' is not assignable to parameter of type 'string'. +!!! error TS2769: Type 'null' is not assignable to type 'string'. +!!! error TS2769: Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | null' is not assignable to parameter of type 'number'. +!!! error TS2769: Type 'null' is not assignable to type 'number'. +!!! related TS2793 arrayBestCommonTypes.ts:12:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. + (this.voidIfAny([2, 4, null][0])); + ~~~~~~~~~~~~~~~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | null' is not assignable to parameter of type 'boolean'. +!!! error TS2769: Type 'null' is not assignable to type 'boolean'. +!!! error TS2769: Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | null' is not assignable to parameter of type 'string'. +!!! error TS2769: Type 'null' is not assignable to type 'string'. +!!! error TS2769: Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | null' is not assignable to parameter of type 'number'. +!!! error TS2769: Type 'null' is not assignable to type 'number'. +!!! related TS2793 arrayBestCommonTypes.ts:12:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. + (this.voidIfAny([undefined, 4, null][0])); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | null | undefined' is not assignable to parameter of type 'boolean'. +!!! error TS2769: Type 'undefined' is not assignable to type 'boolean'. +!!! error TS2769: Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | null | undefined' is not assignable to parameter of type 'string'. +!!! error TS2769: Type 'undefined' is not assignable to type 'string'. +!!! error TS2769: Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | null | undefined' is not assignable to parameter of type 'number'. +!!! error TS2769: Type 'undefined' is not assignable to type 'number'. +!!! related TS2793 arrayBestCommonTypes.ts:12:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. + + (this.voidIfAny(['', "q"][0])); + (this.voidIfAny(['', "q", undefined][0])); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'string | undefined' is not assignable to parameter of type 'boolean'. +!!! error TS2769: Type 'undefined' is not assignable to type 'boolean'. +!!! error TS2769: Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'string | undefined' is not assignable to parameter of type 'string'. +!!! error TS2769: Type 'undefined' is not assignable to type 'string'. +!!! error TS2769: Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'string | undefined' is not assignable to parameter of type 'number'. +!!! error TS2769: Type 'undefined' is not assignable to type 'number'. +!!! related TS2793 arrayBestCommonTypes.ts:12:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. + (this.voidIfAny([undefined, "q", ''][0])); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'string | undefined' is not assignable to parameter of type 'boolean'. +!!! error TS2769: Type 'undefined' is not assignable to type 'boolean'. +!!! error TS2769: Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'string | undefined' is not assignable to parameter of type 'string'. +!!! error TS2769: Type 'undefined' is not assignable to type 'string'. +!!! error TS2769: Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'string | undefined' is not assignable to parameter of type 'number'. +!!! error TS2769: Type 'undefined' is not assignable to type 'number'. +!!! related TS2793 arrayBestCommonTypes.ts:12:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. + (this.voidIfAny([null, "q", ''][0])); + ~~~~~~~~~~~~~~~~~~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'string | null' is not assignable to parameter of type 'boolean'. +!!! error TS2769: Type 'null' is not assignable to type 'boolean'. +!!! error TS2769: Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'string | null' is not assignable to parameter of type 'string'. +!!! error TS2769: Type 'null' is not assignable to type 'string'. +!!! error TS2769: Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'string | null' is not assignable to parameter of type 'number'. +!!! error TS2769: Type 'null' is not assignable to type 'number'. +!!! related TS2793 arrayBestCommonTypes.ts:12:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. + (this.voidIfAny(["q", '', null][0])); + ~~~~~~~~~~~~~~~~~~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'string | null' is not assignable to parameter of type 'boolean'. +!!! error TS2769: Type 'null' is not assignable to type 'boolean'. +!!! error TS2769: Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'string | null' is not assignable to parameter of type 'string'. +!!! error TS2769: Type 'null' is not assignable to type 'string'. +!!! error TS2769: Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'string | null' is not assignable to parameter of type 'number'. +!!! error TS2769: Type 'null' is not assignable to type 'number'. +!!! related TS2793 arrayBestCommonTypes.ts:12:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. + (this.voidIfAny([undefined, '', null][0])); + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'string | null | undefined' is not assignable to parameter of type 'boolean'. +!!! error TS2769: Type 'undefined' is not assignable to type 'boolean'. +!!! error TS2769: Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'string | null | undefined' is not assignable to parameter of type 'string'. +!!! error TS2769: Type 'undefined' is not assignable to type 'string'. +!!! error TS2769: Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'string | null | undefined' is not assignable to parameter of type 'number'. +!!! error TS2769: Type 'undefined' is not assignable to type 'number'. +!!! related TS2793 arrayBestCommonTypes.ts:12:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. + + (this.voidIfAny([[3, 4], [null]][0][0])); + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | null' is not assignable to parameter of type 'boolean'. +!!! error TS2769: Type 'null' is not assignable to type 'boolean'. +!!! error TS2769: Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | null' is not assignable to parameter of type 'string'. +!!! error TS2769: Type 'null' is not assignable to type 'string'. +!!! error TS2769: Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | null' is not assignable to parameter of type 'number'. +!!! error TS2769: Type 'null' is not assignable to type 'number'. +!!! related TS2793 arrayBestCommonTypes.ts:12:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. + + + var t1: { x: number; y: base; }[] = [{ x: 7, y: new derived() }, { x: 5, y: new base() }]; + var t2: { x: boolean; y: base; }[] = [{ x: true, y: new derived() }, { x: false, y: new base() }]; + var t3: { x: string; y: base; }[] = [{ x: undefined, y: new base() }, { x: '', y: new derived() }]; + ~ +!!! error TS2322: Type 'undefined' is not assignable to type 'string'. +!!! related TS6500 arrayBestCommonTypes.ts:34:23: The expected type comes from property 'x' which is declared here on type '{ x: string; y: base; }' + + var anyObj: any = null; + // Order matters here so test all the variants + var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }]; + var a2 = [{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }]; + var a3 = [{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }]; + + var ifaceObj: iface = null; + ~~~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'iface'. + var baseObj = new base(); + var base2Obj = new base2(); + + var b1 = [baseObj, base2Obj, ifaceObj]; + var b2 = [base2Obj, baseObj, ifaceObj]; + var b3 = [baseObj, ifaceObj, base2Obj]; + var b4 = [ifaceObj, baseObj, base2Obj]; + } + } + } + + namespace NonEmptyTypes { + interface iface { x: string; } + class base implements iface { x: string; y: string; } + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. + ~ +!!! error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. + class base2 implements iface { x: string; z: string; } + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. + ~ +!!! error TS2564: Property 'z' has no initializer and is not definitely assigned in the constructor. + class derived extends base { a: string; } + ~ +!!! error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. + + + class f { + public voidIfAny(x: boolean, y?: boolean): number; + public voidIfAny(x: string, y?: boolean): number; + public voidIfAny(x: number, y?: boolean): number; + public voidIfAny(x: any, y = false): any { return null; } + + public x() { + (this.voidIfAny([4, 2][0])); + (this.voidIfAny([4, 2, undefined][0])); + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | undefined' is not assignable to parameter of type 'boolean'. +!!! error TS2769: Type 'undefined' is not assignable to type 'boolean'. +!!! error TS2769: Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | undefined' is not assignable to parameter of type 'string'. +!!! error TS2769: Type 'undefined' is not assignable to type 'string'. +!!! error TS2769: Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | undefined' is not assignable to parameter of type 'number'. +!!! error TS2769: Type 'undefined' is not assignable to type 'number'. +!!! related TS2793 arrayBestCommonTypes.ts:65:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. + (this.voidIfAny([undefined, 2, 4][0])); + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | undefined' is not assignable to parameter of type 'boolean'. +!!! error TS2769: Type 'undefined' is not assignable to type 'boolean'. +!!! error TS2769: Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | undefined' is not assignable to parameter of type 'string'. +!!! error TS2769: Type 'undefined' is not assignable to type 'string'. +!!! error TS2769: Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | undefined' is not assignable to parameter of type 'number'. +!!! error TS2769: Type 'undefined' is not assignable to type 'number'. +!!! related TS2793 arrayBestCommonTypes.ts:65:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. + (this.voidIfAny([null, 2, 4][0])); + ~~~~~~~~~~~~~~~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | null' is not assignable to parameter of type 'boolean'. +!!! error TS2769: Type 'null' is not assignable to type 'boolean'. +!!! error TS2769: Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | null' is not assignable to parameter of type 'string'. +!!! error TS2769: Type 'null' is not assignable to type 'string'. +!!! error TS2769: Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | null' is not assignable to parameter of type 'number'. +!!! error TS2769: Type 'null' is not assignable to type 'number'. +!!! related TS2793 arrayBestCommonTypes.ts:65:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. + (this.voidIfAny([2, 4, null][0])); + ~~~~~~~~~~~~~~~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | null' is not assignable to parameter of type 'boolean'. +!!! error TS2769: Type 'null' is not assignable to type 'boolean'. +!!! error TS2769: Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | null' is not assignable to parameter of type 'string'. +!!! error TS2769: Type 'null' is not assignable to type 'string'. +!!! error TS2769: Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | null' is not assignable to parameter of type 'number'. +!!! error TS2769: Type 'null' is not assignable to type 'number'. +!!! related TS2793 arrayBestCommonTypes.ts:65:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. + (this.voidIfAny([undefined, 4, null][0])); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | null | undefined' is not assignable to parameter of type 'boolean'. +!!! error TS2769: Type 'undefined' is not assignable to type 'boolean'. +!!! error TS2769: Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | null | undefined' is not assignable to parameter of type 'string'. +!!! error TS2769: Type 'undefined' is not assignable to type 'string'. +!!! error TS2769: Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | null | undefined' is not assignable to parameter of type 'number'. +!!! error TS2769: Type 'undefined' is not assignable to type 'number'. +!!! related TS2793 arrayBestCommonTypes.ts:65:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. + + (this.voidIfAny(['', "q"][0])); + (this.voidIfAny(['', "q", undefined][0])); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'string | undefined' is not assignable to parameter of type 'boolean'. +!!! error TS2769: Type 'undefined' is not assignable to type 'boolean'. +!!! error TS2769: Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'string | undefined' is not assignable to parameter of type 'string'. +!!! error TS2769: Type 'undefined' is not assignable to type 'string'. +!!! error TS2769: Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'string | undefined' is not assignable to parameter of type 'number'. +!!! error TS2769: Type 'undefined' is not assignable to type 'number'. +!!! related TS2793 arrayBestCommonTypes.ts:65:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. + (this.voidIfAny([undefined, "q", ''][0])); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'string | undefined' is not assignable to parameter of type 'boolean'. +!!! error TS2769: Type 'undefined' is not assignable to type 'boolean'. +!!! error TS2769: Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'string | undefined' is not assignable to parameter of type 'string'. +!!! error TS2769: Type 'undefined' is not assignable to type 'string'. +!!! error TS2769: Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'string | undefined' is not assignable to parameter of type 'number'. +!!! error TS2769: Type 'undefined' is not assignable to type 'number'. +!!! related TS2793 arrayBestCommonTypes.ts:65:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. + (this.voidIfAny([null, "q", ''][0])); + ~~~~~~~~~~~~~~~~~~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'string | null' is not assignable to parameter of type 'boolean'. +!!! error TS2769: Type 'null' is not assignable to type 'boolean'. +!!! error TS2769: Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'string | null' is not assignable to parameter of type 'string'. +!!! error TS2769: Type 'null' is not assignable to type 'string'. +!!! error TS2769: Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'string | null' is not assignable to parameter of type 'number'. +!!! error TS2769: Type 'null' is not assignable to type 'number'. +!!! related TS2793 arrayBestCommonTypes.ts:65:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. + (this.voidIfAny(["q", '', null][0])); + ~~~~~~~~~~~~~~~~~~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'string | null' is not assignable to parameter of type 'boolean'. +!!! error TS2769: Type 'null' is not assignable to type 'boolean'. +!!! error TS2769: Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'string | null' is not assignable to parameter of type 'string'. +!!! error TS2769: Type 'null' is not assignable to type 'string'. +!!! error TS2769: Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'string | null' is not assignable to parameter of type 'number'. +!!! error TS2769: Type 'null' is not assignable to type 'number'. +!!! related TS2793 arrayBestCommonTypes.ts:65:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. + (this.voidIfAny([undefined, '', null][0])); + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'string | null | undefined' is not assignable to parameter of type 'boolean'. +!!! error TS2769: Type 'undefined' is not assignable to type 'boolean'. +!!! error TS2769: Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'string | null | undefined' is not assignable to parameter of type 'string'. +!!! error TS2769: Type 'undefined' is not assignable to type 'string'. +!!! error TS2769: Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'string | null | undefined' is not assignable to parameter of type 'number'. +!!! error TS2769: Type 'undefined' is not assignable to type 'number'. +!!! related TS2793 arrayBestCommonTypes.ts:65:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. + + (this.voidIfAny([[3, 4], [null]][0][0])); + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | null' is not assignable to parameter of type 'boolean'. +!!! error TS2769: Type 'null' is not assignable to type 'boolean'. +!!! error TS2769: Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | null' is not assignable to parameter of type 'string'. +!!! error TS2769: Type 'null' is not assignable to type 'string'. +!!! error TS2769: Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error. +!!! error TS2769: Argument of type 'number | null' is not assignable to parameter of type 'number'. +!!! error TS2769: Type 'null' is not assignable to type 'number'. +!!! related TS2793 arrayBestCommonTypes.ts:65:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. + + + var t1: { x: number; y: base; }[] = [{ x: 7, y: new derived() }, { x: 5, y: new base() }]; + var t2: { x: boolean; y: base; }[] = [{ x: true, y: new derived() }, { x: false, y: new base() }]; + var t3: { x: string; y: base; }[] = [{ x: undefined, y: new base() }, { x: '', y: new derived() }]; + ~ +!!! error TS2322: Type 'undefined' is not assignable to type 'string'. +!!! related TS6500 arrayBestCommonTypes.ts:87:23: The expected type comes from property 'x' which is declared here on type '{ x: string; y: base; }' + + var anyObj: any = null; + // Order matters here so test all the variants + var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }]; + var a2 = [{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }]; + var a3 = [{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }]; + + var ifaceObj: iface = null; + ~~~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'iface'. + var baseObj = new base(); + var base2Obj = new base2(); + + var b1 = [baseObj, base2Obj, ifaceObj]; + var b2 = [base2Obj, baseObj, ifaceObj]; + var b3 = [baseObj, ifaceObj, base2Obj]; + var b4 = [ifaceObj, baseObj, base2Obj]; + } + } + } + + \ No newline at end of file diff --git a/tests/baselines/reference/arrayBestCommonTypes.js b/tests/baselines/reference/arrayBestCommonTypes.js index 4bba7b000efc6..51c0267becd05 100644 --- a/tests/baselines/reference/arrayBestCommonTypes.js +++ b/tests/baselines/reference/arrayBestCommonTypes.js @@ -110,6 +110,7 @@ namespace NonEmptyTypes { //// [arrayBestCommonTypes.js] +"use strict"; var EmptyTypes; (function (EmptyTypes) { class base { diff --git a/tests/baselines/reference/arrayBestCommonTypes.types b/tests/baselines/reference/arrayBestCommonTypes.types index 510e6e7ddd913..ca2f665b378cb 100644 --- a/tests/baselines/reference/arrayBestCommonTypes.types +++ b/tests/baselines/reference/arrayBestCommonTypes.types @@ -30,29 +30,30 @@ namespace EmptyTypes { > : ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ >x : boolean > : ^^^^^^^ ->y : boolean -> : ^^^^^^^ +>y : boolean | undefined +> : ^^^^^^^^^^^^^^^^^^^ public voidIfAny(x: string, y?: boolean): number; >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } > : ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ >x : string > : ^^^^^^ ->y : boolean -> : ^^^^^^^ +>y : boolean | undefined +> : ^^^^^^^^^^^^^^^^^^^ public voidIfAny(x: number, y?: boolean): number; >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } > : ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ >x : number > : ^^^^^^ ->y : boolean -> : ^^^^^^^ +>y : boolean | undefined +> : ^^^^^^^^^^^^^^^^^^^ public voidIfAny(x: any, y = false): any { return null; } >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } > : ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ >x : any +> : ^^^ >y : boolean > : ^^^^^^^ >false : false @@ -99,10 +100,10 @@ namespace 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, 2, undefined][0] : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>[4, 2, undefined] : (number | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^^^ >4 : 4 > : ^ >2 : 2 @@ -125,10 +126,10 @@ namespace EmptyTypes { > : ^^^^ >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } > : ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ->[undefined, 2, 4][0] : number -> : ^^^^^^ ->[undefined, 2, 4] : number[] -> : ^^^^^^^^ +>[undefined, 2, 4][0] : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>[undefined, 2, 4] : (number | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^^^ >undefined : undefined > : ^^^^^^^^^ >2 : 2 @@ -151,10 +152,10 @@ namespace 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, 2, 4][0] : number | null +> : ^^^^^^^^^^^^^ +>[null, 2, 4] : (number | null)[] +> : ^^^^^^^^^^^^^^^^^ >2 : 2 > : ^ >4 : 4 @@ -175,10 +176,10 @@ namespace 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, 4, null][0] : number | null +> : ^^^^^^^^^^^^^ +>[2, 4, null] : (number | null)[] +> : ^^^^^^^^^^^^^^^^^ >2 : 2 > : ^ >4 : 4 @@ -199,10 +200,10 @@ namespace EmptyTypes { > : ^^^^ >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } > : ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ->[undefined, 4, null][0] : number -> : ^^^^^^ ->[undefined, 4, null] : number[] -> : ^^^^^^^^ +>[undefined, 4, null][0] : number | null | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ +>[undefined, 4, null] : (number | null | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >undefined : undefined > : ^^^^^^^^^ >4 : 4 @@ -247,10 +248,10 @@ namespace EmptyTypes { > : ^^^^ >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } > : ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ->['', "q", undefined][0] : string -> : ^^^^^^ ->['', "q", undefined] : string[] -> : ^^^^^^^^ +>['', "q", undefined][0] : string | undefined +> : ^^^^^^^^^^^^^^^^^^ +>['', "q", undefined] : (string | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^^^ >'' : "" > : ^^ >"q" : "q" @@ -273,10 +274,10 @@ namespace EmptyTypes { > : ^^^^ >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } > : ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ->[undefined, "q", ''][0] : string -> : ^^^^^^ ->[undefined, "q", ''] : string[] -> : ^^^^^^^^ +>[undefined, "q", ''][0] : string | undefined +> : ^^^^^^^^^^^^^^^^^^ +>[undefined, "q", ''] : (string | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^^^ >undefined : undefined > : ^^^^^^^^^ >"q" : "q" @@ -299,10 +300,10 @@ namespace 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, "q", ''][0] : string | null +> : ^^^^^^^^^^^^^ +>[null, "q", ''] : (string | null)[] +> : ^^^^^^^^^^^^^^^^^ >"q" : "q" > : ^^^ >'' : "" @@ -323,10 +324,10 @@ namespace 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", '', null][0] : string | null +> : ^^^^^^^^^^^^^ +>["q", '', null] : (string | null)[] +> : ^^^^^^^^^^^^^^^^^ >"q" : "q" > : ^^^ >'' : "" @@ -347,10 +348,10 @@ namespace EmptyTypes { > : ^^^^ >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } > : ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ->[undefined, '', null][0] : string -> : ^^^^^^ ->[undefined, '', null] : string[] -> : ^^^^^^^^ +>[undefined, '', null][0] : string | null | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ +>[undefined, '', null] : (string | null | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >undefined : undefined > : ^^^^^^^^^ >'' : "" @@ -371,12 +372,12 @@ namespace EmptyTypes { > : ^^^^ >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } > : ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ->[[3, 4], [null]][0][0] : number -> : ^^^^^^ ->[[3, 4], [null]][0] : number[] -> : ^^^^^^^^ ->[[3, 4], [null]] : number[][] -> : ^^^^^^^^^^ +>[[3, 4], [null]][0][0] : number | null +> : ^^^^^^^^^^^^^ +>[[3, 4], [null]][0] : number[] | null[] +> : ^^^^^^^^^^^^^^^^^ +>[[3, 4], [null]] : (number[] | null[])[] +> : ^^^^^^^^^^^^^^^^^^^^^ >[3, 4] : number[] > : ^^^^^^^^ >3 : 3 @@ -466,8 +467,8 @@ namespace EmptyTypes { > : ^^^^^^ >y : base > : ^^^^ ->[{ x: undefined, y: new base() }, { x: '', y: new derived() }] : { x: string; y: derived; }[] -> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>[{ x: undefined, y: new base() }, { x: '', y: new derived() }] : ({ x: undefined; y: base; } | { x: string; y: derived; })[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ x: undefined, y: new base() } : { x: undefined; y: base; } > : ^^^^^^^^^^^^^^^^^^^^^^^^^^ >x : undefined @@ -495,6 +496,7 @@ namespace EmptyTypes { var anyObj: any = null; >anyObj : any +> : ^^^ // Order matters here so test all the variants var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }]; @@ -525,7 +527,9 @@ namespace EmptyTypes { >{ x: anyObj, y: 'a' } : { x: any; y: string; } > : ^^^^^^^^^^^^^^^^^^^^^^ >x : any +> : ^^^ >anyObj : any +> : ^^^ >y : string > : ^^^^^^ >'a' : "a" @@ -539,7 +543,9 @@ namespace EmptyTypes { >{ x: anyObj, y: 'a' } : { x: any; y: string; } > : ^^^^^^^^^^^^^^^^^^^^^^ >x : any +> : ^^^ >anyObj : any +> : ^^^ >y : string > : ^^^^^^ >'a' : "a" @@ -583,7 +589,9 @@ namespace EmptyTypes { >{ x: anyObj, y: 'a' } : { x: any; y: string; } > : ^^^^^^^^^^^^^^^^^^^^^^ >x : any +> : ^^^ >anyObj : any +> : ^^^ >y : string > : ^^^^^^ >'a' : "a" @@ -712,29 +720,30 @@ namespace NonEmptyTypes { > : ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ >x : boolean > : ^^^^^^^ ->y : boolean -> : ^^^^^^^ +>y : boolean | undefined +> : ^^^^^^^^^^^^^^^^^^^ public voidIfAny(x: string, y?: boolean): number; >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } > : ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ >x : string > : ^^^^^^ ->y : boolean -> : ^^^^^^^ +>y : boolean | undefined +> : ^^^^^^^^^^^^^^^^^^^ public voidIfAny(x: number, y?: boolean): number; >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } > : ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ >x : number > : ^^^^^^ ->y : boolean -> : ^^^^^^^ +>y : boolean | undefined +> : ^^^^^^^^^^^^^^^^^^^ public voidIfAny(x: any, y = false): any { return null; } >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } > : ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ >x : any +> : ^^^ >y : boolean > : ^^^^^^^ >false : false @@ -781,10 +790,10 @@ namespace 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, 2, undefined][0] : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>[4, 2, undefined] : (number | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^^^ >4 : 4 > : ^ >2 : 2 @@ -807,10 +816,10 @@ namespace NonEmptyTypes { > : ^^^^ >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } > : ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ->[undefined, 2, 4][0] : number -> : ^^^^^^ ->[undefined, 2, 4] : number[] -> : ^^^^^^^^ +>[undefined, 2, 4][0] : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>[undefined, 2, 4] : (number | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^^^ >undefined : undefined > : ^^^^^^^^^ >2 : 2 @@ -833,10 +842,10 @@ namespace 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, 2, 4][0] : number | null +> : ^^^^^^^^^^^^^ +>[null, 2, 4] : (number | null)[] +> : ^^^^^^^^^^^^^^^^^ >2 : 2 > : ^ >4 : 4 @@ -857,10 +866,10 @@ namespace 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, 4, null][0] : number | null +> : ^^^^^^^^^^^^^ +>[2, 4, null] : (number | null)[] +> : ^^^^^^^^^^^^^^^^^ >2 : 2 > : ^ >4 : 4 @@ -881,10 +890,10 @@ namespace NonEmptyTypes { > : ^^^^ >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } > : ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ->[undefined, 4, null][0] : number -> : ^^^^^^ ->[undefined, 4, null] : number[] -> : ^^^^^^^^ +>[undefined, 4, null][0] : number | null | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ +>[undefined, 4, null] : (number | null | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >undefined : undefined > : ^^^^^^^^^ >4 : 4 @@ -929,10 +938,10 @@ namespace NonEmptyTypes { > : ^^^^ >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } > : ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ->['', "q", undefined][0] : string -> : ^^^^^^ ->['', "q", undefined] : string[] -> : ^^^^^^^^ +>['', "q", undefined][0] : string | undefined +> : ^^^^^^^^^^^^^^^^^^ +>['', "q", undefined] : (string | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^^^ >'' : "" > : ^^ >"q" : "q" @@ -955,10 +964,10 @@ namespace NonEmptyTypes { > : ^^^^ >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } > : ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ->[undefined, "q", ''][0] : string -> : ^^^^^^ ->[undefined, "q", ''] : string[] -> : ^^^^^^^^ +>[undefined, "q", ''][0] : string | undefined +> : ^^^^^^^^^^^^^^^^^^ +>[undefined, "q", ''] : (string | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^^^ >undefined : undefined > : ^^^^^^^^^ >"q" : "q" @@ -981,10 +990,10 @@ namespace 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, "q", ''][0] : string | null +> : ^^^^^^^^^^^^^ +>[null, "q", ''] : (string | null)[] +> : ^^^^^^^^^^^^^^^^^ >"q" : "q" > : ^^^ >'' : "" @@ -1005,10 +1014,10 @@ namespace 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", '', null][0] : string | null +> : ^^^^^^^^^^^^^ +>["q", '', null] : (string | null)[] +> : ^^^^^^^^^^^^^^^^^ >"q" : "q" > : ^^^ >'' : "" @@ -1029,10 +1038,10 @@ namespace NonEmptyTypes { > : ^^^^ >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } > : ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ->[undefined, '', null][0] : string -> : ^^^^^^ ->[undefined, '', null] : string[] -> : ^^^^^^^^ +>[undefined, '', null][0] : string | null | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ +>[undefined, '', null] : (string | null | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >undefined : undefined > : ^^^^^^^^^ >'' : "" @@ -1053,12 +1062,12 @@ namespace NonEmptyTypes { > : ^^^^ >voidIfAny : { (x: boolean, y?: boolean): number; (x: string, y?: boolean): number; (x: number, y?: boolean): number; } > : ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ ->[[3, 4], [null]][0][0] : number -> : ^^^^^^ ->[[3, 4], [null]][0] : number[] -> : ^^^^^^^^ ->[[3, 4], [null]] : number[][] -> : ^^^^^^^^^^ +>[[3, 4], [null]][0][0] : number | null +> : ^^^^^^^^^^^^^ +>[[3, 4], [null]][0] : number[] | null[] +> : ^^^^^^^^^^^^^^^^^ +>[[3, 4], [null]] : (number[] | null[])[] +> : ^^^^^^^^^^^^^^^^^^^^^ >[3, 4] : number[] > : ^^^^^^^^ >3 : 3 @@ -1177,6 +1186,7 @@ namespace NonEmptyTypes { var anyObj: any = null; >anyObj : any +> : ^^^ // Order matters here so test all the variants var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }]; @@ -1207,7 +1217,9 @@ namespace NonEmptyTypes { >{ x: anyObj, y: 'a' } : { x: any; y: string; } > : ^^^^^^^^^^^^^^^^^^^^^^ >x : any +> : ^^^ >anyObj : any +> : ^^^ >y : string > : ^^^^^^ >'a' : "a" @@ -1221,7 +1233,9 @@ namespace NonEmptyTypes { >{ x: anyObj, y: 'a' } : { x: any; y: string; } > : ^^^^^^^^^^^^^^^^^^^^^^ >x : any +> : ^^^ >anyObj : any +> : ^^^ >y : string > : ^^^^^^ >'a' : "a" @@ -1265,7 +1279,9 @@ namespace NonEmptyTypes { >{ x: anyObj, y: 'a' } : { x: any; y: string; } > : ^^^^^^^^^^^^^^^^^^^^^^ >x : any +> : ^^^ >anyObj : any +> : ^^^ >y : string > : ^^^^^^ >'a' : "a" diff --git a/tests/baselines/reference/arrayBindingPatternOmittedExpressions.errors.txt b/tests/baselines/reference/arrayBindingPatternOmittedExpressions.errors.txt new file mode 100644 index 0000000000000..e2bc70e4b5674 --- /dev/null +++ b/tests/baselines/reference/arrayBindingPatternOmittedExpressions.errors.txt @@ -0,0 +1,21 @@ +arrayBindingPatternOmittedExpressions.ts(4,22): error TS2454: Variable 'results' is used before being assigned. + + +==== arrayBindingPatternOmittedExpressions.ts (1 errors) ==== + var results: string[]; + + { + let [, b, , a] = results; + ~~~~~~~ +!!! error TS2454: Variable 'results' is used before being assigned. + let x = { + a, + b + } + } + + + function f([, a, , b, , , , s, , , ] = results) { + a = s[1]; + b = s[2]; + } \ No newline at end of file diff --git a/tests/baselines/reference/arrayBindingPatternOmittedExpressions.js b/tests/baselines/reference/arrayBindingPatternOmittedExpressions.js index 4a6426b99ac29..238d450738f33 100644 --- a/tests/baselines/reference/arrayBindingPatternOmittedExpressions.js +++ b/tests/baselines/reference/arrayBindingPatternOmittedExpressions.js @@ -18,6 +18,7 @@ function f([, a, , b, , , , s, , , ] = results) { } //// [arrayBindingPatternOmittedExpressions.js] +"use strict"; var results; { let [, b, , a] = results; diff --git a/tests/baselines/reference/arrayBufferIsViewNarrowsType.errors.txt b/tests/baselines/reference/arrayBufferIsViewNarrowsType.errors.txt new file mode 100644 index 0000000000000..fff8474c3cc64 --- /dev/null +++ b/tests/baselines/reference/arrayBufferIsViewNarrowsType.errors.txt @@ -0,0 +1,11 @@ +arrayBufferIsViewNarrowsType.ts(2,24): error TS2454: Variable 'obj' is used before being assigned. + + +==== arrayBufferIsViewNarrowsType.ts (1 errors) ==== + var obj: Object; + if (ArrayBuffer.isView(obj)) { + ~~~ +!!! error TS2454: Variable 'obj' is used before being assigned. + // isView should be a guard that narrows type to ArrayBufferView. + var ab: ArrayBufferView = obj; + } \ No newline at end of file diff --git a/tests/baselines/reference/arrayBufferIsViewNarrowsType.js b/tests/baselines/reference/arrayBufferIsViewNarrowsType.js index eb162a6133ba0..b496ce6a8d1e9 100644 --- a/tests/baselines/reference/arrayBufferIsViewNarrowsType.js +++ b/tests/baselines/reference/arrayBufferIsViewNarrowsType.js @@ -8,6 +8,7 @@ if (ArrayBuffer.isView(obj)) { } //// [arrayBufferIsViewNarrowsType.js] +"use strict"; var obj; if (ArrayBuffer.isView(obj)) { // isView should be a guard that narrows type to ArrayBufferView. diff --git a/tests/baselines/reference/arrayCast.js b/tests/baselines/reference/arrayCast.js index 5454be517af0f..4fd00dbccd4d4 100644 --- a/tests/baselines/reference/arrayCast.js +++ b/tests/baselines/reference/arrayCast.js @@ -9,6 +9,7 @@ <{ id: number; }[]>[{ foo: "s" }, {}]; //// [arrayCast.js] +"use strict"; // Should fail. Even though the array is contextually typed with { id: number }[], it still // has type { foo: string }[], which is not assignable to { id: number }[]. [{ foo: "s" }]; diff --git a/tests/baselines/reference/arrayConcat2.js b/tests/baselines/reference/arrayConcat2.js index a684c2b5ebb7e..e1f3102620479 100644 --- a/tests/baselines/reference/arrayConcat2.js +++ b/tests/baselines/reference/arrayConcat2.js @@ -11,6 +11,7 @@ b.concat('hello'); //// [arrayConcat2.js] +"use strict"; var a = []; a.concat("hello", 'world'); a.concat('Hello'); diff --git a/tests/baselines/reference/arrayConcat2.types b/tests/baselines/reference/arrayConcat2.types index df756cdf2d284..e7bcec590abe6 100644 --- a/tests/baselines/reference/arrayConcat2.types +++ b/tests/baselines/reference/arrayConcat2.types @@ -4,8 +4,8 @@ var a: string[] = []; >a : string[] > : ^^^^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ a.concat("hello", 'world'); >a.concat("hello", 'world') : string[] diff --git a/tests/baselines/reference/arrayConcat3.js b/tests/baselines/reference/arrayConcat3.js index 1e6487ce7fe28..90d64c48e11ff 100644 --- a/tests/baselines/reference/arrayConcat3.js +++ b/tests/baselines/reference/arrayConcat3.js @@ -9,6 +9,7 @@ function doStuff(a: Array>, b: Array[]): never[]', gave the following error. + Type '{ a: number; }' is not assignable to type 'never'. + Overload 2 of 2, '(...items: ConcatArray[]): never[]', gave the following error. + Type '{ a: number; }' is not assignable to type 'never'. +arrayConcatMap.ts(2,23): error TS2339: Property 'a' does not exist on type 'never'. + + +==== arrayConcatMap.ts (2 errors) ==== + var x = [].concat([{ a: 1 }], [{ a: 2 }]) + ~~~~~~~~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 2, '(...items: ConcatArray[]): never[]', gave the following error. +!!! error TS2769: Type '{ a: number; }' is not assignable to type 'never'. +!!! error TS2769: Overload 2 of 2, '(...items: ConcatArray[]): never[]', gave the following error. +!!! error TS2769: Type '{ a: number; }' is not assignable to type 'never'. + .map(b => b.a); + ~ +!!! error TS2339: Property 'a' does not exist on type 'never'. \ No newline at end of file diff --git a/tests/baselines/reference/arrayConcatMap.js b/tests/baselines/reference/arrayConcatMap.js index fdd4f7eb618d4..35e1638a69233 100644 --- a/tests/baselines/reference/arrayConcatMap.js +++ b/tests/baselines/reference/arrayConcatMap.js @@ -5,5 +5,6 @@ var x = [].concat([{ a: 1 }], [{ a: 2 }]) .map(b => b.a); //// [arrayConcatMap.js] +"use strict"; var x = [].concat([{ a: 1 }], [{ a: 2 }]) .map(b => b.a); diff --git a/tests/baselines/reference/arrayConcatMap.types b/tests/baselines/reference/arrayConcatMap.types index c56f3d149c402..1b894b3a53c8a 100644 --- a/tests/baselines/reference/arrayConcatMap.types +++ b/tests/baselines/reference/arrayConcatMap.types @@ -6,16 +6,16 @@ var x = [].concat([{ a: 1 }], [{ a: 2 }]) > : ^^^^^ >[].concat([{ a: 1 }], [{ a: 2 }]) .map(b => b.a) : any[] > : ^^^^^ ->[].concat([{ a: 1 }], [{ a: 2 }]) .map : (callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[] -> : ^ ^^ ^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ ->[].concat([{ a: 1 }], [{ a: 2 }]) : any[] -> : ^^^^^ ->[].concat : { (...items: ConcatArray[]): any[]; (...items: any[]): any[]; } -> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ ->concat : { (...items: ConcatArray[]): any[]; (...items: any[]): any[]; } -> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^ +>[].concat([{ a: 1 }], [{ a: 2 }]) .map : (callbackfn: (value: never, index: number, array: never[]) => U, thisArg?: any) => U[] +> : ^ ^^ ^^^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ +>[].concat([{ a: 1 }], [{ a: 2 }]) : never[] +> : ^^^^^^^ +>[].concat : { (...items: ConcatArray[]): never[]; (...items: ConcatArray[]): never[]; } +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ +>concat : { (...items: ConcatArray[]): never[]; (...items: ConcatArray[]): never[]; } +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >[{ a: 1 }] : { a: number; }[] > : ^^^^^^^^^^^^^^^^ >{ a: 1 } : { a: number; } @@ -34,14 +34,16 @@ var x = [].concat([{ a: 1 }], [{ a: 2 }]) > : ^ .map(b => b.a); ->map : (callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[] -> : ^ ^^ ^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ ->b => b.a : (b: any) => any -> : ^ ^^^^^^^^^^^^^ ->b : any +>map : (callbackfn: (value: never, index: number, array: never[]) => U, thisArg?: any) => U[] +> : ^ ^^ ^^^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ +>b => b.a : (b: never) => any +> : ^ ^^^^^^^^^^^^^^^ +>b : never +> : ^^^^^ >b.a : any ->b : any -> : ^^^ +> : ^^^ +>b : never +> : ^^^^^ >a : any > : ^^^ diff --git a/tests/baselines/reference/arrayConstructors1.js b/tests/baselines/reference/arrayConstructors1.js index 792b0a23780aa..5b3caa365b99c 100644 --- a/tests/baselines/reference/arrayConstructors1.js +++ b/tests/baselines/reference/arrayConstructors1.js @@ -12,6 +12,7 @@ y = new Array(1,2); y = new Array(1, 2); //// [arrayConstructors1.js] +"use strict"; var x; x = new Array(1); x = new Array('hi', 'bye'); diff --git a/tests/baselines/reference/arrayDestructuringInSwitch2.js b/tests/baselines/reference/arrayDestructuringInSwitch2.js index b603aec10bff6..fd5dcee0c0fed 100644 --- a/tests/baselines/reference/arrayDestructuringInSwitch2.js +++ b/tests/baselines/reference/arrayDestructuringInSwitch2.js @@ -17,6 +17,7 @@ function foo(x: X): 1 { } //// [arrayDestructuringInSwitch2.js] +"use strict"; function foo(x) { const { kind, a } = x; switch (kind) { diff --git a/tests/baselines/reference/arrayEvery.js b/tests/baselines/reference/arrayEvery.js index f85e0e4291bd1..1614b319dbe6b 100644 --- a/tests/baselines/reference/arrayEvery.js +++ b/tests/baselines/reference/arrayEvery.js @@ -11,6 +11,7 @@ if (foo.every(isString)) { //// [arrayEvery.js] +"use strict"; const foo = ['aaa']; const isString = (x) => typeof x === 'string'; if (foo.every(isString)) { diff --git a/tests/baselines/reference/arrayFilter.js b/tests/baselines/reference/arrayFilter.js index b9aeed39312d2..186a07458dd39 100644 --- a/tests/baselines/reference/arrayFilter.js +++ b/tests/baselines/reference/arrayFilter.js @@ -10,6 +10,7 @@ var foo = [ foo.filter(x => x.name); //should accepted all possible types not only boolean! //// [arrayFilter.js] +"use strict"; var foo = [ { name: 'bar' }, { name: null }, diff --git a/tests/baselines/reference/arrayFilter.symbols b/tests/baselines/reference/arrayFilter.symbols index 448246fd2b8bf..b85d04aa0bcd4 100644 --- a/tests/baselines/reference/arrayFilter.symbols +++ b/tests/baselines/reference/arrayFilter.symbols @@ -20,7 +20,7 @@ foo.filter(x => x.name); //should accepted all possible types not only boolean! >foo : Symbol(foo, Decl(arrayFilter.ts, 0, 3)) >filter : Symbol(Array.filter, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >x : Symbol(x, Decl(arrayFilter.ts, 6, 11)) ->x.name : Symbol(name, Decl(arrayFilter.ts, 1, 5)) +>x.name : Symbol(name, Decl(arrayFilter.ts, 1, 5), Decl(arrayFilter.ts, 2, 5)) >x : Symbol(x, Decl(arrayFilter.ts, 6, 11)) ->name : Symbol(name, Decl(arrayFilter.ts, 1, 5)) +>name : Symbol(name, Decl(arrayFilter.ts, 1, 5), Decl(arrayFilter.ts, 2, 5)) diff --git a/tests/baselines/reference/arrayFilter.types b/tests/baselines/reference/arrayFilter.types index b6c6d05ee960f..ad34df8e48269 100644 --- a/tests/baselines/reference/arrayFilter.types +++ b/tests/baselines/reference/arrayFilter.types @@ -2,10 +2,10 @@ === arrayFilter.ts === var foo = [ ->foo : { name: string; }[] -> : ^^^^^^^^^^^^^^^^^^^ ->[ { name: 'bar' }, { name: null }, { name: 'baz' }] : { name: string; }[] -> : ^^^^^^^^^^^^^^^^^^^ +>foo : ({ name: string; } | { name: null; })[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>[ { name: 'bar' }, { name: null }, { name: 'baz' }] : ({ name: string; } | { name: null; })[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ { name: 'bar' }, >{ name: 'bar' } : { name: string; } @@ -32,22 +32,22 @@ var foo = [ ] foo.filter(x => x.name); //should accepted all possible types not only boolean! ->foo.filter(x => x.name) : { name: string; }[] -> : ^^^^^^^^^^^^^^^^^^^ ->foo.filter : { (predicate: (value: { name: string; }, index: number, array: { name: string; }[]) => value is S, thisArg?: any): S[]; (predicate: (value: { name: string; }, index: number, array: { name: string; }[]) => unknown, thisArg?: any): { name: string; }[]; } -> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ->foo : { name: string; }[] -> : ^^^^^^^^^^^^^^^^^^^ ->filter : { (predicate: (value: { name: string; }, index: number, array: { name: string; }[]) => value is S, thisArg?: any): S[]; (predicate: (value: { name: string; }, index: number, array: { name: string; }[]) => unknown, thisArg?: any): { name: string; }[]; } -> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ->x => x.name : (x: { name: string; }) => string -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->x : { name: string; } -> : ^^^^^^^^^^^^^^^^^ ->x.name : string -> : ^^^^^^ ->x : { name: string; } -> : ^^^^^^^^^^^^^^^^^ ->name : string -> : ^^^^^^ +>foo.filter(x => x.name) : ({ name: string; } | { name: null; })[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>foo.filter : { (predicate: (value: { name: string; } | { name: null; }, index: number, array: ({ name: string; } | { name: null; })[]) => value is S, thisArg?: any): S[]; (predicate: (value: { name: string; } | { name: null; }, index: number, array: ({ name: string; } | { name: null; })[]) => unknown, thisArg?: any): ({ name: string; } | { name: null; })[]; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>foo : ({ name: string; } | { name: null; })[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>filter : { (predicate: (value: { name: string; } | { name: null; }, index: number, array: ({ name: string; } | { name: null; })[]) => value is S, thisArg?: any): S[]; (predicate: (value: { name: string; } | { name: null; }, index: number, array: ({ name: string; } | { name: null; })[]) => unknown, thisArg?: any): ({ name: string; } | { name: null; })[]; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>x => x.name : (x: { name: string; } | { name: null; }) => string | null +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>x : { name: string; } | { name: null; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>x.name : string | null +> : ^^^^^^^^^^^^^ +>x : { name: string; } | { name: null; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>name : string | null +> : ^^^^^^^^^^^^^ diff --git a/tests/baselines/reference/arrayFind.js b/tests/baselines/reference/arrayFind.js index c5f4756e96f9b..89fd405580c13 100644 --- a/tests/baselines/reference/arrayFind.js +++ b/tests/baselines/reference/arrayFind.js @@ -14,6 +14,7 @@ const readonlyFoundNumber: number | undefined = readonlyArrayOfStringsNumbersAnd //// [arrayFind.js] +"use strict"; // test fix for #18112, type guard predicates should narrow returned element function isNumber(x) { return typeof x === "number"; diff --git a/tests/baselines/reference/arrayFind.types b/tests/baselines/reference/arrayFind.types index b1f9aff8e6429..c053675d85195 100644 --- a/tests/baselines/reference/arrayFind.types +++ b/tests/baselines/reference/arrayFind.types @@ -36,16 +36,16 @@ const arrayOfStringsNumbersAndBooleans = ["string", false, 0, "strung", 1, true] > : ^^^^ const foundNumber: number | undefined = arrayOfStringsNumbersAndBooleans.find(isNumber); ->foundNumber : number -> : ^^^^^^ ->arrayOfStringsNumbersAndBooleans.find(isNumber) : number -> : ^^^^^^ ->arrayOfStringsNumbersAndBooleans.find : { (predicate: (value: string | number | boolean, index: number, obj: (string | number | boolean)[]) => value is S, thisArg?: any): S; (predicate: (value: string | number | boolean, index: number, obj: (string | number | boolean)[]) => unknown, thisArg?: any): string | number | boolean; } -> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>foundNumber : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>arrayOfStringsNumbersAndBooleans.find(isNumber) : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>arrayOfStringsNumbersAndBooleans.find : { (predicate: (value: string | number | boolean, index: number, obj: (string | number | boolean)[]) => value is S, thisArg?: any): S | undefined; (predicate: (value: string | number | boolean, index: number, obj: (string | number | boolean)[]) => unknown, thisArg?: any): string | number | boolean | undefined; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >arrayOfStringsNumbersAndBooleans : (string | number | boolean)[] > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->find : { (predicate: (value: string | number | boolean, index: number, obj: (string | number | boolean)[]) => value is S, thisArg?: any): S; (predicate: (value: string | number | boolean, index: number, obj: (string | number | boolean)[]) => unknown, thisArg?: any): string | number | boolean; } -> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>find : { (predicate: (value: string | number | boolean, index: number, obj: (string | number | boolean)[]) => value is S, thisArg?: any): S | undefined; (predicate: (value: string | number | boolean, index: number, obj: (string | number | boolean)[]) => unknown, thisArg?: any): string | number | boolean | undefined; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >isNumber : (x: any) => x is number > : ^ ^^ ^^^^^ @@ -58,16 +58,16 @@ const readonlyArrayOfStringsNumbersAndBooleans = arrayOfStringsNumbersAndBoolean > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ const readonlyFoundNumber: number | undefined = readonlyArrayOfStringsNumbersAndBooleans.find(isNumber); ->readonlyFoundNumber : number -> : ^^^^^^ ->readonlyArrayOfStringsNumbersAndBooleans.find(isNumber) : number -> : ^^^^^^ ->readonlyArrayOfStringsNumbersAndBooleans.find : { (predicate: (value: string | number | boolean, index: number, obj: readonly (string | number | boolean)[]) => value is S, thisArg?: any): S; (predicate: (value: string | number | boolean, index: number, obj: readonly (string | number | boolean)[]) => unknown, thisArg?: any): string | number | boolean; } -> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>readonlyFoundNumber : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>readonlyArrayOfStringsNumbersAndBooleans.find(isNumber) : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>readonlyArrayOfStringsNumbersAndBooleans.find : { (predicate: (value: string | number | boolean, index: number, obj: readonly (string | number | boolean)[]) => value is S, thisArg?: any): S | undefined; (predicate: (value: string | number | boolean, index: number, obj: readonly (string | number | boolean)[]) => unknown, thisArg?: any): string | number | boolean | undefined; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >readonlyArrayOfStringsNumbersAndBooleans : readonly (string | number | boolean)[] > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->find : { (predicate: (value: string | number | boolean, index: number, obj: readonly (string | number | boolean)[]) => value is S, thisArg?: any): S; (predicate: (value: string | number | boolean, index: number, obj: readonly (string | number | boolean)[]) => unknown, thisArg?: any): string | number | boolean; } -> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>find : { (predicate: (value: string | number | boolean, index: number, obj: readonly (string | number | boolean)[]) => value is S, thisArg?: any): S | undefined; (predicate: (value: string | number | boolean, index: number, obj: readonly (string | number | boolean)[]) => unknown, thisArg?: any): string | number | boolean | undefined; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >isNumber : (x: any) => x is number > : ^ ^^ ^^^^^ diff --git a/tests/baselines/reference/arrayFlatMap.js b/tests/baselines/reference/arrayFlatMap.js index 1143092f9e3ae..f54f96cd4d503 100644 --- a/tests/baselines/reference/arrayFlatMap.js +++ b/tests/baselines/reference/arrayFlatMap.js @@ -8,6 +8,7 @@ readonlyArray.flatMap((): ReadonlyArray => []); // ok //// [arrayFlatMap.js] +"use strict"; const array = []; const readonlyArray = []; array.flatMap(() => []); // ok diff --git a/tests/baselines/reference/arrayFlatMap.types b/tests/baselines/reference/arrayFlatMap.types index 9e235a58c7a29..51f61a152e81a 100644 --- a/tests/baselines/reference/arrayFlatMap.types +++ b/tests/baselines/reference/arrayFlatMap.types @@ -4,40 +4,40 @@ const array: number[] = []; >array : number[] > : ^^^^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ const readonlyArray: ReadonlyArray = []; >readonlyArray : readonly number[] > : ^^^^^^^^^^^^^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ array.flatMap((): ReadonlyArray => []); // ok >array.flatMap((): ReadonlyArray => []) : number[] > : ^^^^^^^^ ->array.flatMap : (callback: (this: This, value: number, index: number, array: number[]) => U | readonly U[], thisArg?: This) => U[] -> : ^ ^^ ^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ ^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ +>array.flatMap : (callback: (this: This, value: number, index: number, array: number[]) => U | readonly U[], thisArg?: This | undefined) => U[] +> : ^ ^^ ^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ ^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ >array : number[] > : ^^^^^^^^ ->flatMap : (callback: (this: This, value: number, index: number, array: number[]) => U | readonly U[], thisArg?: This) => U[] -> : ^ ^^ ^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ ^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ +>flatMap : (callback: (this: This, value: number, index: number, array: number[]) => U | readonly U[], thisArg?: This | undefined) => U[] +> : ^ ^^ ^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ ^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ >(): ReadonlyArray => [] : () => ReadonlyArray > : ^^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ readonlyArray.flatMap((): ReadonlyArray => []); // ok >readonlyArray.flatMap((): ReadonlyArray => []) : number[] > : ^^^^^^^^ ->readonlyArray.flatMap : (callback: (this: This, value: number, index: number, array: number[]) => U | readonly U[], thisArg?: This) => U[] -> : ^ ^^ ^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ ^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ +>readonlyArray.flatMap : (callback: (this: This, value: number, index: number, array: number[]) => U | readonly U[], thisArg?: This | undefined) => U[] +> : ^ ^^ ^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ ^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ >readonlyArray : readonly number[] > : ^^^^^^^^^^^^^^^^^ ->flatMap : (callback: (this: This, value: number, index: number, array: number[]) => U | readonly U[], thisArg?: This) => U[] -> : ^ ^^ ^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ ^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ +>flatMap : (callback: (this: This, value: number, index: number, array: number[]) => U | readonly U[], thisArg?: This | undefined) => U[] +> : ^ ^^ ^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ ^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ >(): ReadonlyArray => [] : () => ReadonlyArray > : ^^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ diff --git a/tests/baselines/reference/arrayFrom.js b/tests/baselines/reference/arrayFrom.js index 477082fedc961..d4ecb1e982c90 100644 --- a/tests/baselines/reference/arrayFrom.js +++ b/tests/baselines/reference/arrayFrom.js @@ -39,6 +39,7 @@ function getEither (in1: Iterable, in2: ArrayLike) { //// [arrayFrom.js] +"use strict"; // Tests fix for #20432, ensures Array.from accepts all valid inputs // Also tests for #19682 const inputA = []; diff --git a/tests/baselines/reference/arrayFrom.types b/tests/baselines/reference/arrayFrom.types index 4350bcd3047e3..6a902f76e996d 100644 --- a/tests/baselines/reference/arrayFrom.types +++ b/tests/baselines/reference/arrayFrom.types @@ -19,14 +19,14 @@ interface B { const inputA: A[] = []; >inputA : A[] > : ^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ const inputB: B[] = []; >inputB : B[] > : ^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ const inputALike: ArrayLike = { length: 0 }; >inputALike : ArrayLike diff --git a/tests/baselines/reference/arrayIndexWithArrayFails.js b/tests/baselines/reference/arrayIndexWithArrayFails.js index 3a29bc51b5753..2676ef11db781 100644 --- a/tests/baselines/reference/arrayIndexWithArrayFails.js +++ b/tests/baselines/reference/arrayIndexWithArrayFails.js @@ -6,4 +6,5 @@ declare const arr2: number[]; const j = arr2[arr1[0]]; // should error //// [arrayIndexWithArrayFails.js] +"use strict"; const j = arr2[arr1[0]]; // should error diff --git a/tests/baselines/reference/arrayLiteral.js b/tests/baselines/reference/arrayLiteral.js index 08ec40049ea81..5ab2e9c56afc8 100644 --- a/tests/baselines/reference/arrayLiteral.js +++ b/tests/baselines/reference/arrayLiteral.js @@ -18,6 +18,7 @@ var y2: number[] = [1, 2]; var y2: number[] = new Array(); //// [arrayLiteral.js] +"use strict"; // valid uses of array literals var x = []; var x = new Array(1); diff --git a/tests/baselines/reference/arrayLiteral.types b/tests/baselines/reference/arrayLiteral.types index d1651fe6d2754..2809d2f9ba079 100644 --- a/tests/baselines/reference/arrayLiteral.types +++ b/tests/baselines/reference/arrayLiteral.types @@ -6,8 +6,8 @@ var x = []; >x : any[] > : ^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ var x = new Array(1); >x : any[] @@ -48,8 +48,8 @@ var y = new Array(); var x2: number[] = []; >x2 : number[] > : ^^^^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ var x2: number[] = new Array(1); >x2 : number[] diff --git a/tests/baselines/reference/arrayLiteral1.js b/tests/baselines/reference/arrayLiteral1.js index 1ba12d5456b40..0c9d6d5d99b26 100644 --- a/tests/baselines/reference/arrayLiteral1.js +++ b/tests/baselines/reference/arrayLiteral1.js @@ -4,4 +4,5 @@ var v30 = [1, 2]; //// [arrayLiteral1.js] +"use strict"; var v30 = [1, 2]; diff --git a/tests/baselines/reference/arrayLiteral2.js b/tests/baselines/reference/arrayLiteral2.js index f2362adb1439e..25addfb315eca 100644 --- a/tests/baselines/reference/arrayLiteral2.js +++ b/tests/baselines/reference/arrayLiteral2.js @@ -4,4 +4,5 @@ var v30 = [1, 2], v31; //// [arrayLiteral2.js] +"use strict"; var v30 = [1, 2], v31; diff --git a/tests/baselines/reference/arrayLiteralAndArrayConstructorEquivalence1.js b/tests/baselines/reference/arrayLiteralAndArrayConstructorEquivalence1.js index 555eddfeeed70..2f41596f553ad 100644 --- a/tests/baselines/reference/arrayLiteralAndArrayConstructorEquivalence1.js +++ b/tests/baselines/reference/arrayLiteralAndArrayConstructorEquivalence1.js @@ -16,6 +16,7 @@ myCars3 = myCars5; //// [arrayLiteralAndArrayConstructorEquivalence1.js] +"use strict"; var myCars = new Array(); var myCars3 = new Array({}); myCars = myCars3; diff --git a/tests/baselines/reference/arrayLiteralComments.js b/tests/baselines/reference/arrayLiteralComments.js index 53363bac2d251..23b8d48ef67aa 100644 --- a/tests/baselines/reference/arrayLiteralComments.js +++ b/tests/baselines/reference/arrayLiteralComments.js @@ -17,6 +17,7 @@ var testArrayWithFunc = [ ] //// [arrayLiteralComments.js] +"use strict"; var testArrayWithFunc = [ // Function comment function () { diff --git a/tests/baselines/reference/arrayLiteralContextualType.js b/tests/baselines/reference/arrayLiteralContextualType.js index ed1ffb8559192..68c1a13efbf38 100644 --- a/tests/baselines/reference/arrayLiteralContextualType.js +++ b/tests/baselines/reference/arrayLiteralContextualType.js @@ -32,6 +32,7 @@ foo(arr); // ok because arr is Array not {}[] bar(arr); // ok because arr is Array not {}[] //// [arrayLiteralContextualType.js] +"use strict"; class Giraffe { constructor() { this.name = "Giraffe"; diff --git a/tests/baselines/reference/arrayLiteralExpressionContextualTyping.js b/tests/baselines/reference/arrayLiteralExpressionContextualTyping.js index b88916841bd55..2ad36d0bd2772 100644 --- a/tests/baselines/reference/arrayLiteralExpressionContextualTyping.js +++ b/tests/baselines/reference/arrayLiteralExpressionContextualTyping.js @@ -18,6 +18,7 @@ var spr2:[number, number, number] = [1, 2, 3, ...tup]; // Error //// [arrayLiteralExpressionContextualTyping.js] +"use strict"; // In a contextually typed array literal expression containing no spread elements, an element expression at index N is contextually typed by // the type of the property with the numeric name N in the contextual type, if any, or otherwise // the numeric index type of the contextual type, if any. diff --git a/tests/baselines/reference/arrayLiteralInNonVarArgParameter.js b/tests/baselines/reference/arrayLiteralInNonVarArgParameter.js index aa2d281e03e72..3138190a21be8 100644 --- a/tests/baselines/reference/arrayLiteralInNonVarArgParameter.js +++ b/tests/baselines/reference/arrayLiteralInNonVarArgParameter.js @@ -7,5 +7,6 @@ panic([], 'one', 'two'); //// [arrayLiteralInNonVarArgParameter.js] +"use strict"; function panic(val, ...opt) { } panic([], 'one', 'two'); diff --git a/tests/baselines/reference/arrayLiteralInNonVarArgParameter.types b/tests/baselines/reference/arrayLiteralInNonVarArgParameter.types index f180e70252842..bf8fb040627e0 100644 --- a/tests/baselines/reference/arrayLiteralInNonVarArgParameter.types +++ b/tests/baselines/reference/arrayLiteralInNonVarArgParameter.types @@ -14,8 +14,8 @@ panic([], 'one', 'two'); > : ^^^^ >panic : (val: string[], ...opt: string[]) => void > : ^ ^^ ^^^^^ ^^ ^^^^^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ >'one' : "one" > : ^^^^^ >'two' : "two" diff --git a/tests/baselines/reference/arrayLiteralSpread.js b/tests/baselines/reference/arrayLiteralSpread.js index 5efdb6c45d19b..aa82fc75ca637 100644 --- a/tests/baselines/reference/arrayLiteralSpread.js +++ b/tests/baselines/reference/arrayLiteralSpread.js @@ -26,6 +26,7 @@ function f2() { //// [arrayLiteralSpread.js] +"use strict"; function f0() { var a = [1, 2, 3]; var a1 = [...a]; diff --git a/tests/baselines/reference/arrayLiteralSpreadES5iterable.js b/tests/baselines/reference/arrayLiteralSpreadES5iterable.js index bf3a64e62817b..22381a7440a4c 100644 --- a/tests/baselines/reference/arrayLiteralSpreadES5iterable.js +++ b/tests/baselines/reference/arrayLiteralSpreadES5iterable.js @@ -26,6 +26,7 @@ function f2() { //// [arrayLiteralSpreadES5iterable.js] +"use strict"; function f0() { var a = [1, 2, 3]; var a1 = [...a]; diff --git a/tests/baselines/reference/arrayLiteralTypeInference.errors.txt b/tests/baselines/reference/arrayLiteralTypeInference.errors.txt index c30590f70707a..e8e4459a26dfc 100644 --- a/tests/baselines/reference/arrayLiteralTypeInference.errors.txt +++ b/tests/baselines/reference/arrayLiteralTypeInference.errors.txt @@ -1,20 +1,29 @@ +arrayLiteralTypeInference.ts(2,5): error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. +arrayLiteralTypeInference.ts(6,5): error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor. +arrayLiteralTypeInference.ts(10,5): error TS2564: Property 'trueNess' has no initializer and is not definitely assigned in the constructor. arrayLiteralTypeInference.ts(14,14): error TS2353: Object literal may only specify known properties, and 'trueness' does not exist in type 'Action'. arrayLiteralTypeInference.ts(15,14): error TS2353: Object literal may only specify known properties, and 'name' does not exist in type 'Action'. arrayLiteralTypeInference.ts(31,18): error TS2353: Object literal may only specify known properties, and 'trueness' does not exist in type '{ id: number; }'. arrayLiteralTypeInference.ts(32,18): error TS2353: Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. -==== arrayLiteralTypeInference.ts (4 errors) ==== +==== arrayLiteralTypeInference.ts (7 errors) ==== class Action { id: number; + ~~ +!!! error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. } class ActionA extends Action { value: string; + ~~~~~ +!!! error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor. } class ActionB extends Action { trueNess: boolean; + ~~~~~~~~ +!!! error TS2564: Property 'trueNess' has no initializer and is not definitely assigned in the constructor. } var x1: Action[] = [ diff --git a/tests/baselines/reference/arrayLiteralTypeInference.js b/tests/baselines/reference/arrayLiteralTypeInference.js index 9e0bd09c70c32..8522adcc13dc4 100644 --- a/tests/baselines/reference/arrayLiteralTypeInference.js +++ b/tests/baselines/reference/arrayLiteralTypeInference.js @@ -54,6 +54,7 @@ var z3: { id: number }[] = //// [arrayLiteralTypeInference.js] +"use strict"; class Action { } class ActionA extends Action { diff --git a/tests/baselines/reference/arrayLiteralWidened.js b/tests/baselines/reference/arrayLiteralWidened.js index 39ee52e48df39..a8288e5e1a0f2 100644 --- a/tests/baselines/reference/arrayLiteralWidened.js +++ b/tests/baselines/reference/arrayLiteralWidened.js @@ -26,6 +26,7 @@ var d = [undefined, x]; //// [arrayLiteralWidened.js] +"use strict"; // array literals are widened upon assignment according to their element type var a = []; // any[] var a = [, ,]; diff --git a/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.errors.txt b/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.errors.txt new file mode 100644 index 0000000000000..23bd56f7af7a5 --- /dev/null +++ b/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.errors.txt @@ -0,0 +1,39 @@ +arrayLiteralWithMultipleBestCommonTypes.ts(7,11): error TS2454: Variable 'a' is used before being assigned. +arrayLiteralWithMultipleBestCommonTypes.ts(7,14): error TS2454: Variable 'b' is used before being assigned. +arrayLiteralWithMultipleBestCommonTypes.ts(8,11): error TS2454: Variable 'b' is used before being assigned. +arrayLiteralWithMultipleBestCommonTypes.ts(8,14): error TS2454: Variable 'a' is used before being assigned. +arrayLiteralWithMultipleBestCommonTypes.ts(9,11): error TS2454: Variable 'a' is used before being assigned. +arrayLiteralWithMultipleBestCommonTypes.ts(9,14): error TS2454: Variable 'b' is used before being assigned. +arrayLiteralWithMultipleBestCommonTypes.ts(9,17): error TS2454: Variable 'c' is used before being assigned. + + +==== arrayLiteralWithMultipleBestCommonTypes.ts (7 errors) ==== + // when multiple best common types exist we will choose the first candidate + + var a: { x: number; y?: number }; + var b: { x: number; z?: number }; + var c: { x: number; a?: number }; + + var as = [a, b]; // { x: number; y?: number };[] + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var bs = [b, a]; // { x: number; z?: number };[] + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var cs = [a, b, c]; // { x: number; y?: number };[] + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + + var ds = [(x: Object) => 1, (x: string) => 2]; // { (x:Object) => number }[] + var es = [(x: string) => 2, (x: Object) => 1]; // { (x:string) => number }[] + var fs = [(a: { x: number; y?: number }) => 1, (b: { x: number; z?: number }) => 2]; // (a: { x: number; y?: number }) => number[] + var gs = [(b: { x: number; z?: number }) => 2, (a: { x: number; y?: number }) => 1]; // (b: { x: number; z?: number }) => number[] + \ No newline at end of file diff --git a/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.js b/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.js index 9790866ccf0f9..f1efd7a1bcec4 100644 --- a/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.js +++ b/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.js @@ -18,6 +18,7 @@ var gs = [(b: { x: number; z?: number }) => 2, (a: { x: number; y?: number }) => //// [arrayLiteralWithMultipleBestCommonTypes.js] +"use strict"; // when multiple best common types exist we will choose the first candidate var a; var b; diff --git a/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.types b/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.types index 1030c5783fd7a..f54c7aaa90d51 100644 --- a/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.types +++ b/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.types @@ -8,24 +8,24 @@ var a: { x: number; y?: number }; > : ^^^^^ ^^^^^^ ^^^ >x : number > : ^^^^^^ ->y : number -> : ^^^^^^ +>y : number | undefined +> : ^^^^^^^^^^^^^^^^^^ var b: { x: number; z?: number }; >b : { x: number; z?: number; } > : ^^^^^ ^^^^^^ ^^^ >x : number > : ^^^^^^ ->z : number -> : ^^^^^^ +>z : number | undefined +> : ^^^^^^^^^^^^^^^^^^ var c: { x: number; a?: number }; >c : { x: number; a?: number; } > : ^^^^^ ^^^^^^ ^^^ >x : number > : ^^^^^^ ->a : number -> : ^^^^^^ +>a : number | undefined +> : ^^^^^^^^^^^^^^^^^^ var as = [a, b]; // { x: number; y?: number };[] >as : ({ x: number; y?: number; } | { x: number; z?: number; })[] @@ -60,9 +60,9 @@ var cs = [a, b, c]; // { x: number; y?: number };[] > : ^^^^^ ^^^^^^ ^^^ var ds = [(x: Object) => 1, (x: string) => 2]; // { (x:Object) => number }[] ->ds : ((x: Object) => number)[] +>ds : ((x: string) => number)[] > : ^^ ^^ ^^^^^^^^^^^^^^ ->[(x: Object) => 1, (x: string) => 2] : ((x: Object) => number)[] +>[(x: Object) => 1, (x: string) => 2] : ((x: string) => number)[] > : ^^ ^^ ^^^^^^^^^^^^^^ >(x: Object) => 1 : (x: Object) => number > : ^ ^^ ^^^^^^^^^^^ @@ -106,8 +106,8 @@ var fs = [(a: { x: number; y?: number }) => 1, (b: { x: number; z?: number }) => > : ^^^^^ ^^^^^^ ^^^ >x : number > : ^^^^^^ ->y : number -> : ^^^^^^ +>y : number | undefined +> : ^^^^^^^^^^^^^^^^^^ >1 : 1 > : ^ >(b: { x: number; z?: number }) => 2 : (b: { x: number; z?: number; }) => number @@ -116,8 +116,8 @@ var fs = [(a: { x: number; y?: number }) => 1, (b: { x: number; z?: number }) => > : ^^^^^ ^^^^^^ ^^^ >x : number > : ^^^^^^ ->z : number -> : ^^^^^^ +>z : number | undefined +> : ^^^^^^^^^^^^^^^^^^ >2 : 2 > : ^ @@ -132,8 +132,8 @@ var gs = [(b: { x: number; z?: number }) => 2, (a: { x: number; y?: number }) => > : ^^^^^ ^^^^^^ ^^^ >x : number > : ^^^^^^ ->z : number -> : ^^^^^^ +>z : number | undefined +> : ^^^^^^^^^^^^^^^^^^ >2 : 2 > : ^ >(a: { x: number; y?: number }) => 1 : (a: { x: number; y?: number; }) => number @@ -142,8 +142,8 @@ var gs = [(b: { x: number; z?: number }) => 2, (a: { x: number; y?: number }) => > : ^^^^^ ^^^^^^ ^^^ >x : number > : ^^^^^^ ->y : number -> : ^^^^^^ +>y : number | undefined +> : ^^^^^^^^^^^^^^^^^^ >1 : 1 > : ^ diff --git a/tests/baselines/reference/arrayLiterals.js b/tests/baselines/reference/arrayLiterals.js index b7f57d1aa4e72..2e200a40fde72 100644 --- a/tests/baselines/reference/arrayLiterals.js +++ b/tests/baselines/reference/arrayLiterals.js @@ -39,6 +39,7 @@ var context4: Base[] = [new Derived1(), new Derived1()]; //// [arrayLiterals.js] +"use strict"; // Empty array literal with no contextual type has type Undefined[] var arr1 = [[], [1], ['']]; var arr2 = [[null], [1], ['']]; diff --git a/tests/baselines/reference/arrayLiterals2ES5.js b/tests/baselines/reference/arrayLiterals2ES5.js index ecd528dfd1a1f..1e5935dc91204 100644 --- a/tests/baselines/reference/arrayLiterals2ES5.js +++ b/tests/baselines/reference/arrayLiterals2ES5.js @@ -59,6 +59,7 @@ var d8: number[][] = [[...temp1]] var d9 = [[...temp1], ...["hello"]]; //// [arrayLiterals2ES5.js] +"use strict"; // ElementList: ( Modified ) // Elisionopt AssignmentExpression // Elisionopt SpreadElement diff --git a/tests/baselines/reference/arrayLiterals2ES6.js b/tests/baselines/reference/arrayLiterals2ES6.js index 1a80dcbec0e98..c82e95ff7afb5 100644 --- a/tests/baselines/reference/arrayLiterals2ES6.js +++ b/tests/baselines/reference/arrayLiterals2ES6.js @@ -57,6 +57,7 @@ var d8: number[][] = [[...temp1]] var d9 = [[...temp1], ...["hello"]]; //// [arrayLiterals2ES6.js] +"use strict"; // ElementList: ( Modified ) // Elisionopt AssignmentExpression // Elisionopt SpreadElement diff --git a/tests/baselines/reference/arrayLiterals2ES6.types b/tests/baselines/reference/arrayLiterals2ES6.types index 354821b54ba90..1e51faa18f078 100644 --- a/tests/baselines/reference/arrayLiterals2ES6.types +++ b/tests/baselines/reference/arrayLiterals2ES6.types @@ -11,10 +11,10 @@ // ... AssignmentExpression var a0 = [, , 2, 3, 4] ->a0 : number[] -> : ^^^^^^^^ ->[, , 2, 3, 4] : number[] -> : ^^^^^^^^ +>a0 : (number | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^^^ +>[, , 2, 3, 4] : (number | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^^^ >2 : 2 > : ^ >3 : 3 @@ -33,26 +33,26 @@ var a1 = ["hello", "world"] > : ^^^^^^^ var a2 = [, , , ...a0, "hello"]; ->a2 : (string | number)[] -> : ^^^^^^^^^^^^^^^^^^^ ->[, , , ...a0, "hello"] : (string | number)[] -> : ^^^^^^^^^^^^^^^^^^^ ->...a0 : number -> : ^^^^^^ ->a0 : number[] -> : ^^^^^^^^ +>a2 : (string | number | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>[, , , ...a0, "hello"] : (string | number | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>...a0 : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>a0 : (number | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^^^ >"hello" : "hello" > : ^^^^^^^ var a3 = [, , ...a0] ->a3 : number[] -> : ^^^^^^^^ ->[, , ...a0] : number[] -> : ^^^^^^^^ ->...a0 : number -> : ^^^^^^ ->a0 : number[] -> : ^^^^^^^^ +>a3 : (number | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^^^ +>[, , ...a0] : (number | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^^^ +>...a0 : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>a0 : (number | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^^^ var a4 = [() => 1, ]; >a4 : (() => number)[] @@ -65,14 +65,14 @@ var a4 = [() => 1, ]; > : ^ var a5 = [...a0, , ] ->a5 : number[] -> : ^^^^^^^^ ->[...a0, , ] : number[] -> : ^^^^^^^^ ->...a0 : number -> : ^^^^^^ ->a0 : number[] -> : ^^^^^^^^ +>a5 : (number | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^^^ +>[...a0, , ] : (number | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^^^ +>...a0 : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>a0 : (number | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^^^ // Each element expression in a non-empty array literal is processed as follows: // - If the array literal contains no spread elements, and if the array literal is contextually typed (section 4.19) @@ -251,24 +251,24 @@ var d4: myArray2 = [...temp, ...temp1]; > : ^^^^^^^^ var d5 = [...a2]; ->d5 : (string | number)[] -> : ^^^^^^^^^^^^^^^^^^^ ->[...a2] : (string | number)[] -> : ^^^^^^^^^^^^^^^^^^^ ->...a2 : string | number -> : ^^^^^^^^^^^^^^^ ->a2 : (string | number)[] -> : ^^^^^^^^^^^^^^^^^^^ +>d5 : (string | number | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>[...a2] : (string | number | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>...a2 : string | number | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>a2 : (string | number | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ var d6 = [...a3]; ->d6 : number[] -> : ^^^^^^^^ ->[...a3] : number[] -> : ^^^^^^^^ ->...a3 : number -> : ^^^^^^ ->a3 : number[] -> : ^^^^^^^^ +>d6 : (number | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^^^ +>[...a3] : (number | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^^^ +>...a3 : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>a3 : (number | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^^^ var d7 = [...a4]; >d7 : (() => number)[] diff --git a/tests/baselines/reference/arrayLiterals3.js b/tests/baselines/reference/arrayLiterals3.js index 333172ea450bd..3165e41f9d4b2 100644 --- a/tests/baselines/reference/arrayLiterals3.js +++ b/tests/baselines/reference/arrayLiterals3.js @@ -38,6 +38,7 @@ var c2: myArray = [...temp1, ...temp]; // Error cannot assign (number //// [arrayLiterals3.js] +"use strict"; // Each element expression in a non-empty array literal is processed as follows: // - If the array literal contains no spread elements, and if the array literal is contextually typed (section 4.19) // by a type T and T has a property with the numeric name N, where N is the index of the element expression in the array literal, diff --git a/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js b/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js index 094bc0ffbd767..1573776687837 100644 --- a/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js +++ b/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js @@ -28,6 +28,7 @@ var myDerivedList: DerivedList; var as = [list, myDerivedList]; // List[] //// [arrayLiteralsWithRecursiveGenerics.js] +"use strict"; class List { } class DerivedList extends List { diff --git a/tests/baselines/reference/arrayOfExportedClass.errors.txt b/tests/baselines/reference/arrayOfExportedClass.errors.txt new file mode 100644 index 0000000000000..e1624a948e1e5 --- /dev/null +++ b/tests/baselines/reference/arrayOfExportedClass.errors.txt @@ -0,0 +1,31 @@ +arrayOfExportedClass_0.ts(2,5): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. +arrayOfExportedClass_1.ts(6,12): error TS2564: Property 'cars' has no initializer and is not definitely assigned in the constructor. + + +==== arrayOfExportedClass_1.ts (1 errors) ==== + /// + import Car = require('./arrayOfExportedClass_0'); + + class Road { + + public cars: Car[]; + ~~~~ +!!! error TS2564: Property 'cars' has no initializer and is not definitely assigned in the constructor. + + public AddCars(cars: Car[]) { + + this.cars = cars; + } + } + + export = Road; + +==== arrayOfExportedClass_0.ts (1 errors) ==== + class Car { + foo: string; + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. + } + + export = Car; + \ No newline at end of file diff --git a/tests/baselines/reference/arrayOfFunctionTypes3.errors.txt b/tests/baselines/reference/arrayOfFunctionTypes3.errors.txt new file mode 100644 index 0000000000000..c8adc00bf9709 --- /dev/null +++ b/tests/baselines/reference/arrayOfFunctionTypes3.errors.txt @@ -0,0 +1,50 @@ +arrayOfFunctionTypes3.ts(7,5): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. +arrayOfFunctionTypes3.ts(15,10): error TS2454: Variable 'a' is used before being assigned. +arrayOfFunctionTypes3.ts(15,13): error TS2454: Variable 'b' is used before being assigned. +arrayOfFunctionTypes3.ts(15,16): error TS2454: Variable 'c' is used before being assigned. +arrayOfFunctionTypes3.ts(24,11): error TS2454: Variable 'a2' is used before being assigned. +arrayOfFunctionTypes3.ts(24,15): error TS2454: Variable 'b2' is used before being assigned. +arrayOfFunctionTypes3.ts(24,19): error TS2454: Variable 'c2' is used before being assigned. + + +==== arrayOfFunctionTypes3.ts (7 errors) ==== + // valid uses of arrays of function types + + var x = [() => 1, () => { }]; + var r2 = x[0](); + + class C { + foo: string; + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. + } + var y = [C, C]; + var r3 = new y[0](); + + var a: { (x: number): number; (x: string): string; }; + var b: { (x: number): number; (x: string): string; }; + var c: { (x: number): number; (x: any): any; }; + var z = [a, b, c]; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var r4 = z[0]; + var r5 = r4(''); // any not string + var r5b = r4(1); + + var a2: { (x: T): number; (x: string): string;}; + var b2: { (x: T): number; (x: string): string; }; + var c2: { (x: number): number; (x: T): any; }; + + var z2 = [a2, b2, c2]; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'c2' is used before being assigned. + var r6 = z2[0]; + var r7 = r6(''); // any not string \ No newline at end of file diff --git a/tests/baselines/reference/arrayOfFunctionTypes3.js b/tests/baselines/reference/arrayOfFunctionTypes3.js index 0c28523c9b73a..c63caa8ea0b1f 100644 --- a/tests/baselines/reference/arrayOfFunctionTypes3.js +++ b/tests/baselines/reference/arrayOfFunctionTypes3.js @@ -29,6 +29,7 @@ var r6 = z2[0]; var r7 = r6(''); // any not string //// [arrayOfFunctionTypes3.js] +"use strict"; // valid uses of arrays of function types var x = [() => 1, () => { }]; var r2 = x[0](); diff --git a/tests/baselines/reference/arrayOfFunctionTypes3.types b/tests/baselines/reference/arrayOfFunctionTypes3.types index fc811643c30ce..ace0680bdfeb1 100644 --- a/tests/baselines/reference/arrayOfFunctionTypes3.types +++ b/tests/baselines/reference/arrayOfFunctionTypes3.types @@ -79,12 +79,13 @@ var c: { (x: number): number; (x: any): any; }; >x : number > : ^^^^^^ >x : any +> : ^^^ var z = [a, b, c]; ->z : { (x: number): number; (x: any): any; }[] -> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^^^ ->[a, b, c] : { (x: number): number; (x: any): any; }[] -> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^^^ +>z : ({ (x: number): number; (x: string): string; } | { (x: number): number; (x: any): any; })[] +> : ^^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^^^^^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^^^^ +>[a, b, c] : ({ (x: number): number; (x: string): string; } | { (x: number): number; (x: any): any; })[] +> : ^^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^^^^^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^^^^ >a : { (x: number): number; (x: string): string; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >b : { (x: number): number; (x: string): string; } @@ -93,20 +94,22 @@ var z = [a, b, c]; > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ 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; }[] -> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^^^ +>r4 : { (x: number): number; (x: string): string; } | { (x: number): number; (x: any): any; } +> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^^^^^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ +>z[0] : { (x: number): number; (x: string): string; } | { (x: number): number; (x: any): any; } +> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^^^^^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ +>z : ({ (x: number): number; (x: string): string; } | { (x: number): number; (x: any): any; })[] +> : ^^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^^^^^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^^^^ >0 : 0 > : ^ var r5 = r4(''); // any not string >r5 : any +> : ^^^ >r4('') : any ->r4 : { (x: number): number; (x: any): any; } -> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ +> : ^^^ +>r4 : { (x: number): number; (x: string): string; } | { (x: number): number; (x: any): any; } +> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^^^^^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >'' : "" > : ^^ @@ -115,8 +118,8 @@ var r5b = r4(1); > : ^^^^^^ >r4(1) : number > : ^^^^^^ ->r4 : { (x: number): number; (x: any): any; } -> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ +>r4 : { (x: number): number; (x: string): string; } | { (x: number): number; (x: any): any; } +> : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^^^^^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >1 : 1 > : ^ @@ -168,7 +171,9 @@ var r6 = z2[0]; var r7 = r6(''); // any not string >r7 : any +> : ^^^ >r6('') : any +> : ^^^ >r6 : { (x: number): number; (x: T): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ >'' : "" diff --git a/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.js b/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.js index 0408bc57205c8..1a4150fbb2f09 100644 --- a/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.js +++ b/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.js @@ -22,6 +22,7 @@ rrb = cra; // error: 'A' is not assignable to 'B' //// [arrayOfSubtypeIsAssignableToReadonlyArray.js] +"use strict"; class A { } class B extends A { diff --git a/tests/baselines/reference/arrayReferenceWithoutTypeArgs.js b/tests/baselines/reference/arrayReferenceWithoutTypeArgs.js index 838f89a424139..d74a95eb0177f 100644 --- a/tests/baselines/reference/arrayReferenceWithoutTypeArgs.js +++ b/tests/baselines/reference/arrayReferenceWithoutTypeArgs.js @@ -6,6 +6,7 @@ class X { } //// [arrayReferenceWithoutTypeArgs.js] +"use strict"; class X { f(a) { } } diff --git a/tests/baselines/reference/arraySigChecking.js b/tests/baselines/reference/arraySigChecking.js index b114161260bad..73e6dadfe41fe 100644 --- a/tests/baselines/reference/arraySigChecking.js +++ b/tests/baselines/reference/arraySigChecking.js @@ -35,6 +35,7 @@ isEmpty(['a']); //// [arraySigChecking.js] +"use strict"; var strArray = [myVar.voidFn()]; var myArray; myArray = [[1, 2]]; diff --git a/tests/baselines/reference/arraySigChecking.types b/tests/baselines/reference/arraySigChecking.types index 81f479fe85ec1..924ea3386654e 100644 --- a/tests/baselines/reference/arraySigChecking.types +++ b/tests/baselines/reference/arraySigChecking.types @@ -99,8 +99,8 @@ isEmpty([]); > : ^^^^^^^ >isEmpty : (l: { length: number; }) => boolean > : ^ ^^ ^^^^^^^^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ isEmpty(new Array(3)); >isEmpty(new Array(3)) : boolean diff --git a/tests/baselines/reference/arraySlice.errors.txt b/tests/baselines/reference/arraySlice.errors.txt new file mode 100644 index 0000000000000..b0aa5a471b6aa --- /dev/null +++ b/tests/baselines/reference/arraySlice.errors.txt @@ -0,0 +1,9 @@ +arraySlice.ts(2,1): error TS2454: Variable 'arr' is used before being assigned. + + +==== arraySlice.ts (1 errors) ==== + var arr: string[] | number[]; + arr.splice(1, 1); + ~~~ +!!! error TS2454: Variable 'arr' is used before being assigned. + \ No newline at end of file diff --git a/tests/baselines/reference/arraySlice.js b/tests/baselines/reference/arraySlice.js index c496aa4ed2dd9..1b055db163d09 100644 --- a/tests/baselines/reference/arraySlice.js +++ b/tests/baselines/reference/arraySlice.js @@ -6,5 +6,6 @@ arr.splice(1, 1); //// [arraySlice.js] +"use strict"; var arr; arr.splice(1, 1); diff --git a/tests/baselines/reference/arrayToLocaleStringES2015.js b/tests/baselines/reference/arrayToLocaleStringES2015.js index 06a3af447db2e..92904e3e50406 100644 --- a/tests/baselines/reference/arrayToLocaleStringES2015.js +++ b/tests/baselines/reference/arrayToLocaleStringES2015.js @@ -65,6 +65,7 @@ str = float64Array.toLocaleString('en-US', { style: 'currency', currency: 'EUR' //// [arrayToLocaleStringES2015.js] +"use strict"; let str; const arr = [1, 2, 3]; str = arr.toLocaleString(); // OK diff --git a/tests/baselines/reference/arrayToLocaleStringES2020.js b/tests/baselines/reference/arrayToLocaleStringES2020.js index 7273c07e77367..26d55ab3c05bc 100644 --- a/tests/baselines/reference/arrayToLocaleStringES2020.js +++ b/tests/baselines/reference/arrayToLocaleStringES2020.js @@ -79,6 +79,7 @@ str = bigIntUint64Array.toLocaleString('en-US', { style: 'currency', currency: ' //// [arrayToLocaleStringES2020.js] +"use strict"; let str; const arr = [1, 2, 3]; str = arr.toLocaleString(); // OK diff --git a/tests/baselines/reference/arrayToLocaleStringES5(target=es2015).js b/tests/baselines/reference/arrayToLocaleStringES5(target=es2015).js index f2c438cb390c5..3cb69494ae223 100644 --- a/tests/baselines/reference/arrayToLocaleStringES5(target=es2015).js +++ b/tests/baselines/reference/arrayToLocaleStringES5(target=es2015).js @@ -59,6 +59,7 @@ str = float64Array.toLocaleString('en-US', { style: 'currency', currency: 'EUR' //// [arrayToLocaleStringES5.js] +"use strict"; let str; const arr = [1, 2, 3]; str = arr.toLocaleString(); // OK diff --git a/tests/baselines/reference/arrayToLocaleStringES5(target=es5).js b/tests/baselines/reference/arrayToLocaleStringES5(target=es5).js index 0cc38b6750c4e..8fc1a7c00efdf 100644 --- a/tests/baselines/reference/arrayToLocaleStringES5(target=es5).js +++ b/tests/baselines/reference/arrayToLocaleStringES5(target=es5).js @@ -59,6 +59,7 @@ str = float64Array.toLocaleString('en-US', { style: 'currency', currency: 'EUR' //// [arrayToLocaleStringES5.js] +"use strict"; var str; var arr = [1, 2, 3]; str = arr.toLocaleString(); // OK diff --git a/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.js b/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.js index b99e5e949b615..50dc5f3a940c4 100644 --- a/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.js +++ b/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.js @@ -28,3 +28,4 @@ declare namespace Data { } //// [arrayTypeInSignatureOfInterfaceAndClass.js] +"use strict"; diff --git a/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.types b/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.types index 86739b383a68f..847e9de400a9d 100644 --- a/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.types +++ b/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.types @@ -12,15 +12,15 @@ declare namespace WinJS { then(success?: (value: T) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; >then : (success?: (value: T) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void) => Promise > : ^ ^^ ^^^ ^^ ^^^ ^^ ^^^ ^^^^^ ->success : (value: T) => Promise -> : ^ ^^ ^^^^^ +>success : ((value: T) => Promise) | undefined +> : ^^ ^^ ^^^^^ ^^^^^^^^^^^^^ >value : T > : ^ ->error : (error: any) => Promise -> : ^ ^^ ^^^^^ +>error : ((error: any) => Promise) | undefined +> : ^^ ^^ ^^^^^ ^^^^^^^^^^^^^ >error : any ->progress : (progress: any) => void -> : ^ ^^ ^^^^^ +>progress : ((progress: any) => void) | undefined +> : ^^ ^^ ^^^^^ ^^^^^^^^^^^^^ >progress : any } } diff --git a/tests/baselines/reference/arrayTypeOfFunctionTypes.js b/tests/baselines/reference/arrayTypeOfFunctionTypes.js index 840ea1ad405dc..e2a66c37659cc 100644 --- a/tests/baselines/reference/arrayTypeOfFunctionTypes.js +++ b/tests/baselines/reference/arrayTypeOfFunctionTypes.js @@ -19,6 +19,7 @@ var r6 = r5(); var r6b = new r5(); // error //// [arrayTypeOfFunctionTypes.js] +"use strict"; // valid uses of arrays of function types var x; var r = x[1]; diff --git a/tests/baselines/reference/arrayTypeOfFunctionTypes2.js b/tests/baselines/reference/arrayTypeOfFunctionTypes2.js index 77e60bb8c08cf..ba706cb44e5b4 100644 --- a/tests/baselines/reference/arrayTypeOfFunctionTypes2.js +++ b/tests/baselines/reference/arrayTypeOfFunctionTypes2.js @@ -19,6 +19,7 @@ var r6 = new r5(); var r6b = r5(); //// [arrayTypeOfFunctionTypes2.js] +"use strict"; // valid uses of arrays of function types var x; var r = x[1]; diff --git a/tests/baselines/reference/arrayTypeOfTypeOf.js b/tests/baselines/reference/arrayTypeOfTypeOf.js index b6827bd2a9999..992aa55843d38 100644 --- a/tests/baselines/reference/arrayTypeOfTypeOf.js +++ b/tests/baselines/reference/arrayTypeOfTypeOf.js @@ -10,6 +10,7 @@ var xs3: typeof Array; var xs4: typeof Array; //// [arrayTypeOfTypeOf.js] +"use strict"; // array type cannot use typeof. var x = 1; var xs; // Not an error. This is equivalent to Array diff --git a/tests/baselines/reference/arrayconcat.errors.txt b/tests/baselines/reference/arrayconcat.errors.txt new file mode 100644 index 0000000000000..589ac8b033819 --- /dev/null +++ b/tests/baselines/reference/arrayconcat.errors.txt @@ -0,0 +1,40 @@ +arrayconcat.ts(12,9): error TS2564: Property 'options' has no initializer and is not definitely assigned in the constructor. +arrayconcat.ts(16,25): error TS18048: 'a.name' is possibly 'undefined'. +arrayconcat.ts(17,25): error TS18048: 'b.name' is possibly 'undefined'. + + +==== arrayconcat.ts (3 errors) ==== + interface IOptions { + name?: string; + flag?: boolean; + short?: string; + usage?: string; + set?: (s: string) => void; + type?: string; + experimental?: boolean; + } + + class parser { + public options: IOptions[]; + ~~~~~~~ +!!! error TS2564: Property 'options' has no initializer and is not definitely assigned in the constructor. + + public m() { + this.options = this.options.sort(function(a, b) { + var aName = a.name.toLowerCase(); + ~~~~~~ +!!! error TS18048: 'a.name' is possibly 'undefined'. + var bName = b.name.toLowerCase(); + ~~~~~~ +!!! error TS18048: 'b.name' is possibly 'undefined'. + + if (aName > bName) { + return 1; + } else if (aName < bName) { + return -1; + } else { + return 0; + } + }); + } + } \ No newline at end of file diff --git a/tests/baselines/reference/arrayconcat.js b/tests/baselines/reference/arrayconcat.js index a9bdddc8daab3..7d408f8bd7b1e 100644 --- a/tests/baselines/reference/arrayconcat.js +++ b/tests/baselines/reference/arrayconcat.js @@ -31,6 +31,7 @@ class parser { } //// [arrayconcat.js] +"use strict"; class parser { m() { this.options = this.options.sort(function (a, b) { diff --git a/tests/baselines/reference/arrayconcat.types b/tests/baselines/reference/arrayconcat.types index 6cdcb06d06a7f..a80cc88ca636c 100644 --- a/tests/baselines/reference/arrayconcat.types +++ b/tests/baselines/reference/arrayconcat.types @@ -3,34 +3,34 @@ === arrayconcat.ts === interface IOptions { name?: string; ->name : string -> : ^^^^^^ +>name : string | undefined +> : ^^^^^^^^^^^^^^^^^^ flag?: boolean; ->flag : boolean -> : ^^^^^^^ +>flag : boolean | undefined +> : ^^^^^^^^^^^^^^^^^^^ short?: string; ->short : string -> : ^^^^^^ +>short : string | undefined +> : ^^^^^^^^^^^^^^^^^^ usage?: string; ->usage : string -> : ^^^^^^ +>usage : string | undefined +> : ^^^^^^^^^^^^^^^^^^ set?: (s: string) => void; ->set : (s: string) => void -> : ^ ^^ ^^^^^ +>set : ((s: string) => void) | undefined +> : ^^ ^^ ^^^^^ ^^^^^^^^^^^^^ >s : string > : ^^^^^^ type?: string; ->type : string -> : ^^^^^^ +>type : string | undefined +> : ^^^^^^^^^^^^^^^^^^ experimental?: boolean; ->experimental : boolean -> : ^^^^^^^ +>experimental : boolean | undefined +> : ^^^^^^^^^^^^^^^^^^^ } class parser { @@ -56,16 +56,16 @@ class parser { > : ^^^^^^^^^^ >this.options.sort(function(a, b) { var aName = a.name.toLowerCase(); var bName = b.name.toLowerCase(); if (aName > bName) { return 1; } else if (aName < bName) { return -1; } else { return 0; } }) : IOptions[] > : ^^^^^^^^^^ ->this.options.sort : (compareFn?: (a: IOptions, b: IOptions) => number) => IOptions[] -> : ^ ^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ +>this.options.sort : (compareFn?: ((a: IOptions, b: IOptions) => number) | undefined) => IOptions[] +> : ^ ^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >this.options : IOptions[] > : ^^^^^^^^^^ >this : this > : ^^^^ >options : IOptions[] > : ^^^^^^^^^^ ->sort : (compareFn?: (a: IOptions, b: IOptions) => number) => IOptions[] -> : ^ ^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ +>sort : (compareFn?: ((a: IOptions, b: IOptions) => number) | undefined) => IOptions[] +> : ^ ^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >function(a, b) { var aName = a.name.toLowerCase(); var bName = b.name.toLowerCase(); if (aName > bName) { return 1; } else if (aName < bName) { return -1; } else { return 0; } } : (a: IOptions, b: IOptions) => 1 | -1 | 0 > : ^ ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ >a : IOptions @@ -80,12 +80,12 @@ class parser { > : ^^^^^^ >a.name.toLowerCase : () => string > : ^^^^^^ ->a.name : string -> : ^^^^^^ +>a.name : string | undefined +> : ^^^^^^^^^^^^^^^^^^ >a : IOptions > : ^^^^^^^^ ->name : string -> : ^^^^^^ +>name : string | undefined +> : ^^^^^^^^^^^^^^^^^^ >toLowerCase : () => string > : ^^^^^^ @@ -96,12 +96,12 @@ class parser { > : ^^^^^^ >b.name.toLowerCase : () => string > : ^^^^^^ ->b.name : string -> : ^^^^^^ +>b.name : string | undefined +> : ^^^^^^^^^^^^^^^^^^ >b : IOptions > : ^^^^^^^^ ->name : string -> : ^^^^^^ +>name : string | undefined +> : ^^^^^^^^^^^^^^^^^^ >toLowerCase : () => string > : ^^^^^^ diff --git a/tests/baselines/reference/arrowFunctionContexts.errors.txt b/tests/baselines/reference/arrowFunctionContexts.errors.txt index 5d9a5ef323759..bc9bbac6219bf 100644 --- a/tests/baselines/reference/arrowFunctionContexts.errors.txt +++ b/tests/baselines/reference/arrowFunctionContexts.errors.txt @@ -1,14 +1,18 @@ +arrowFunctionContexts.ts(2,1): error TS1101: 'with' statements are not allowed in strict mode. arrowFunctionContexts.ts(2,1): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. arrowFunctionContexts.ts(30,9): error TS18033: Type '() => number' is not assignable to type 'number' as required for computed enum member values. arrowFunctionContexts.ts(31,16): error TS2332: 'this' cannot be referenced in current location. +arrowFunctionContexts.ts(43,5): error TS1101: 'with' statements are not allowed in strict mode. arrowFunctionContexts.ts(43,5): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. arrowFunctionContexts.ts(71,13): error TS18033: Type '() => number' is not assignable to type 'number' as required for computed enum member values. arrowFunctionContexts.ts(72,20): error TS2332: 'this' cannot be referenced in current location. -==== arrowFunctionContexts.ts (6 errors) ==== +==== arrowFunctionContexts.ts (8 errors) ==== // Arrow function used in with statement with (window) { + ~~~~ +!!! error TS1101: 'with' statements are not allowed in strict mode. ~~~~~~~~~~~~~ !!! error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. var p = () => this; @@ -56,6 +60,8 @@ arrowFunctionContexts.ts(72,20): error TS2332: 'this' cannot be referenced in cu namespace M2 { // Arrow function used in with statement with (window) { + ~~~~ +!!! error TS1101: 'with' statements are not allowed in strict mode. ~~~~~~~~~~~~~ !!! error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. var p = () => this; diff --git a/tests/baselines/reference/arrowFunctionContexts.js b/tests/baselines/reference/arrowFunctionContexts.js index a8114b4ebcfbd..83996fd337a5e 100644 --- a/tests/baselines/reference/arrowFunctionContexts.js +++ b/tests/baselines/reference/arrowFunctionContexts.js @@ -98,6 +98,7 @@ var asserted2: any; //// [arrowFunctionContexts.js] +"use strict"; // Arrow function used in with statement with (window) { var p = () => this; diff --git a/tests/baselines/reference/arrowFunctionErrorSpan.js b/tests/baselines/reference/arrowFunctionErrorSpan.js index 9f7967b6acccf..64d05d1827b3f 100644 --- a/tests/baselines/reference/arrowFunctionErrorSpan.js +++ b/tests/baselines/reference/arrowFunctionErrorSpan.js @@ -57,6 +57,7 @@ f(_ => 1 + //// [arrowFunctionErrorSpan.js] +"use strict"; function f(a) { } // oneliner f(() => { }); diff --git a/tests/baselines/reference/arrowFunctionExpressions.js b/tests/baselines/reference/arrowFunctionExpressions.js index d7b5511f2746d..524fabc4b491d 100644 --- a/tests/baselines/reference/arrowFunctionExpressions.js +++ b/tests/baselines/reference/arrowFunctionExpressions.js @@ -102,6 +102,7 @@ function tryCatchFn() { //// [arrowFunctionExpressions.js] +"use strict"; // ArrowFormalParameters => AssignmentExpression is equivalent to ArrowFormalParameters => { return AssignmentExpression; } var a = (p) => p.length; var a = (p) => { return p.length; }; diff --git a/tests/baselines/reference/arrowFunctionInConstructorArgument1.js b/tests/baselines/reference/arrowFunctionInConstructorArgument1.js index a8b634872976b..692c26674356d 100644 --- a/tests/baselines/reference/arrowFunctionInConstructorArgument1.js +++ b/tests/baselines/reference/arrowFunctionInConstructorArgument1.js @@ -8,6 +8,7 @@ var c = new C(() => { return asdf; } ) // should error //// [arrowFunctionInConstructorArgument1.js] +"use strict"; class C { constructor(x) { } } diff --git a/tests/baselines/reference/arrowFunctionInExpressionStatement1.js b/tests/baselines/reference/arrowFunctionInExpressionStatement1.js index 99750843cb59c..c3b510aa55dbb 100644 --- a/tests/baselines/reference/arrowFunctionInExpressionStatement1.js +++ b/tests/baselines/reference/arrowFunctionInExpressionStatement1.js @@ -4,4 +4,5 @@ () => 0; //// [arrowFunctionInExpressionStatement1.js] +"use strict"; () => 0; diff --git a/tests/baselines/reference/arrowFunctionInExpressionStatement2.js b/tests/baselines/reference/arrowFunctionInExpressionStatement2.js index ae6bc2fb642aa..2821233ffb4c0 100644 --- a/tests/baselines/reference/arrowFunctionInExpressionStatement2.js +++ b/tests/baselines/reference/arrowFunctionInExpressionStatement2.js @@ -6,6 +6,7 @@ namespace M { } //// [arrowFunctionInExpressionStatement2.js] +"use strict"; var M; (function (M) { () => 0; diff --git a/tests/baselines/reference/arrowFunctionMissingCurlyWithSemicolon.js b/tests/baselines/reference/arrowFunctionMissingCurlyWithSemicolon.js index 02e5e1fcd80fa..4a39a9e218fd6 100644 --- a/tests/baselines/reference/arrowFunctionMissingCurlyWithSemicolon.js +++ b/tests/baselines/reference/arrowFunctionMissingCurlyWithSemicolon.js @@ -7,6 +7,7 @@ var b = 1 * 2 * 3 * 4; var square = (x: number) => x * x; //// [arrowFunctionMissingCurlyWithSemicolon.js] +"use strict"; // Should error at semicolon. var f = () => ; var b = 1 * 2 * 3 * 4; diff --git a/tests/baselines/reference/arrowFunctionParsingDoesNotConfuseParenthesizedObjectForArrowHead.js b/tests/baselines/reference/arrowFunctionParsingDoesNotConfuseParenthesizedObjectForArrowHead.js index 0356b15dda05a..bbc38abc45e4c 100644 --- a/tests/baselines/reference/arrowFunctionParsingDoesNotConfuseParenthesizedObjectForArrowHead.js +++ b/tests/baselines/reference/arrowFunctionParsingDoesNotConfuseParenthesizedObjectForArrowHead.js @@ -18,6 +18,7 @@ const test = () => ({ //// [arrowFunctionParsingDoesNotConfuseParenthesizedObjectForArrowHead.js] +"use strict"; const test = () => ({ // "Identifier expected." error on "!" and two "Duplicate identifier '(Missing)'." errors on space. prop: !value, // remove ! to see that errors will be gone diff --git a/tests/baselines/reference/arrowFunctionParsingGenericInObject.js b/tests/baselines/reference/arrowFunctionParsingGenericInObject.js index eb8a95546feec..c6bbd2aa754cb 100644 --- a/tests/baselines/reference/arrowFunctionParsingGenericInObject.js +++ b/tests/baselines/reference/arrowFunctionParsingGenericInObject.js @@ -43,6 +43,7 @@ const fn4async = () => ({ //// [arrowFunctionParsingGenericInObject.js] +"use strict"; const fn1 = () => ({ test: (value) => value, extraValue: () => { }, diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody1.errors.txt b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody1.errors.txt new file mode 100644 index 0000000000000..dc2064067d3c1 --- /dev/null +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody1.errors.txt @@ -0,0 +1,7 @@ +arrowFunctionWithObjectLiteralBody1.ts(1,9): error TS7006: Parameter 'a' implicitly has an 'any' type. + + +==== arrowFunctionWithObjectLiteralBody1.ts (1 errors) ==== + var v = a => {} + ~ +!!! error TS7006: Parameter 'a' implicitly has an 'any' type. \ No newline at end of file diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody1.js b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody1.js index 3e769e193b641..d15bbf0de6c71 100644 --- a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody1.js +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody1.js @@ -4,4 +4,5 @@ var v = a => {} //// [arrowFunctionWithObjectLiteralBody1.js] +"use strict"; var v = a => ({}); diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody1.types b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody1.types index d3c88ce66a398..d545916cfe618 100644 --- a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody1.types +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody1.types @@ -7,7 +7,9 @@ var v = a => {} >a => {} : (a: any) => any > : ^ ^^^^^^^^^^ >a : any +> : ^^^ >{} : any +> : ^^^ >{} : {} > : ^^ diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody2.errors.txt b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody2.errors.txt new file mode 100644 index 0000000000000..5a8a5ee9d5cc4 --- /dev/null +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody2.errors.txt @@ -0,0 +1,7 @@ +arrowFunctionWithObjectLiteralBody2.ts(1,9): error TS7006: Parameter 'a' implicitly has an 'any' type. + + +==== arrowFunctionWithObjectLiteralBody2.ts (1 errors) ==== + var v = a => {} + ~ +!!! error TS7006: Parameter 'a' implicitly has an 'any' type. \ No newline at end of file diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody2.js b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody2.js index b56295a674aa6..715d4d0e16d56 100644 --- a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody2.js +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody2.js @@ -4,4 +4,5 @@ var v = a => {} //// [arrowFunctionWithObjectLiteralBody2.js] +"use strict"; var v = a => ({}); diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody2.types b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody2.types index 453519d864703..9c7241b3157c1 100644 --- a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody2.types +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody2.types @@ -7,8 +7,11 @@ var v = a => {} >a => {} : (a: any) => any > : ^ ^^^^^^^^^^ >a : any +> : ^^^ >{} : any +> : ^^^ >{} : any +> : ^^^ >{} : {} > : ^^ diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody3.js b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody3.js index 77cbeeb1584bc..57254917b61cb 100644 --- a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody3.js +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody3.js @@ -4,4 +4,5 @@ var v = a => {} //// [arrowFunctionWithObjectLiteralBody3.js] +"use strict"; var v = a => ({}); diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody4.js b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody4.js index 40b2842f3c438..8ef0003322644 100644 --- a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody4.js +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody4.js @@ -4,4 +4,5 @@ var v = a => {} //// [arrowFunctionWithObjectLiteralBody4.js] +"use strict"; var v = a => ({}); diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.js b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.js index f42a8a3de8c45..37dc7397e78c5 100644 --- a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.js +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.js @@ -10,6 +10,7 @@ var c = () => ({ name: "foo", message: "bar" }); var d = () => ((({ name: "foo", message: "bar" }))); //// [arrowFunctionWithObjectLiteralBody5.js] +"use strict"; var a = () => ({ name: "foo", message: "bar" }); var b = () => ({ name: "foo", message: "bar" }); var c = () => ({ name: "foo", message: "bar" }); diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.js b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.js index 8602d38b4645a..c6dad3530c5b0 100644 --- a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.js +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.js @@ -10,6 +10,7 @@ var c = () => ({ name: "foo", message: "bar" }); var d = () => ((({ name: "foo", message: "bar" }))); //// [arrowFunctionWithObjectLiteralBody6.js] +"use strict"; var a = () => ({ name: "foo", message: "bar" }); var b = () => ({ name: "foo", message: "bar" }); var c = () => ({ name: "foo", message: "bar" }); diff --git a/tests/baselines/reference/arrowFunctionWithParameterNameAsync_es2017(target=es2015).js b/tests/baselines/reference/arrowFunctionWithParameterNameAsync_es2017(target=es2015).js index a53f208b4f58d..27d5fc44d5123 100644 --- a/tests/baselines/reference/arrowFunctionWithParameterNameAsync_es2017(target=es2015).js +++ b/tests/baselines/reference/arrowFunctionWithParameterNameAsync_es2017(target=es2015).js @@ -4,4 +4,5 @@ const x = async => async; //// [arrowFunctionWithParameterNameAsync_es2017.js] +"use strict"; const x = async => async; diff --git a/tests/baselines/reference/arrowFunctionWithParameterNameAsync_es2017(target=es5).js b/tests/baselines/reference/arrowFunctionWithParameterNameAsync_es2017(target=es5).js index e767e6f6f169d..ec8759807f03b 100644 --- a/tests/baselines/reference/arrowFunctionWithParameterNameAsync_es2017(target=es5).js +++ b/tests/baselines/reference/arrowFunctionWithParameterNameAsync_es2017(target=es5).js @@ -4,4 +4,5 @@ const x = async => async; //// [arrowFunctionWithParameterNameAsync_es2017.js] +"use strict"; var x = function (async) { return async; }; diff --git a/tests/baselines/reference/arrowFunctionWithParameterNameAsync_es5(target=es2015).js b/tests/baselines/reference/arrowFunctionWithParameterNameAsync_es5(target=es2015).js index facea9ac74ca7..d93a5310cf47c 100644 --- a/tests/baselines/reference/arrowFunctionWithParameterNameAsync_es5(target=es2015).js +++ b/tests/baselines/reference/arrowFunctionWithParameterNameAsync_es5(target=es2015).js @@ -4,4 +4,5 @@ const x = async => async; //// [arrowFunctionWithParameterNameAsync_es5.js] +"use strict"; const x = async => async; diff --git a/tests/baselines/reference/arrowFunctionWithParameterNameAsync_es5(target=es5).js b/tests/baselines/reference/arrowFunctionWithParameterNameAsync_es5(target=es5).js index ceccea14ba50a..222c4b4d0be3c 100644 --- a/tests/baselines/reference/arrowFunctionWithParameterNameAsync_es5(target=es5).js +++ b/tests/baselines/reference/arrowFunctionWithParameterNameAsync_es5(target=es5).js @@ -4,4 +4,5 @@ const x = async => async; //// [arrowFunctionWithParameterNameAsync_es5.js] +"use strict"; var x = function (async) { return async; }; diff --git a/tests/baselines/reference/arrowFunctionWithParameterNameAsync_es6(target=es2015).js b/tests/baselines/reference/arrowFunctionWithParameterNameAsync_es6(target=es2015).js index 32a1f739fbb6b..b867d2f261cb8 100644 --- a/tests/baselines/reference/arrowFunctionWithParameterNameAsync_es6(target=es2015).js +++ b/tests/baselines/reference/arrowFunctionWithParameterNameAsync_es6(target=es2015).js @@ -4,4 +4,5 @@ const x = async => async; //// [arrowFunctionWithParameterNameAsync_es6.js] +"use strict"; const x = async => async; diff --git a/tests/baselines/reference/arrowFunctionWithParameterNameAsync_es6(target=es5).js b/tests/baselines/reference/arrowFunctionWithParameterNameAsync_es6(target=es5).js index 8a19c99f8be03..e14cba5f4d752 100644 --- a/tests/baselines/reference/arrowFunctionWithParameterNameAsync_es6(target=es5).js +++ b/tests/baselines/reference/arrowFunctionWithParameterNameAsync_es6(target=es5).js @@ -4,4 +4,5 @@ const x = async => async; //// [arrowFunctionWithParameterNameAsync_es6.js] +"use strict"; var x = function (async) { return async; }; diff --git a/tests/baselines/reference/arrowFunctionsMissingTokens.js b/tests/baselines/reference/arrowFunctionsMissingTokens.js index a7534a4bb721f..740bec08bc635 100644 --- a/tests/baselines/reference/arrowFunctionsMissingTokens.js +++ b/tests/baselines/reference/arrowFunctionsMissingTokens.js @@ -68,6 +68,7 @@ namespace okay { } //// [arrowFunctionsMissingTokens.js] +"use strict"; var missingArrowsWithCurly; (function (missingArrowsWithCurly) { var a = () => { }; diff --git a/tests/baselines/reference/asOpEmitParens.js b/tests/baselines/reference/asOpEmitParens.js index 1096a2a24762d..cd91f56547fdc 100644 --- a/tests/baselines/reference/asOpEmitParens.js +++ b/tests/baselines/reference/asOpEmitParens.js @@ -13,6 +13,7 @@ new (x() as any); //// [asOpEmitParens.js] +"use strict"; // Must emit as (x + 1) * 3 (x + 1) * 3; // Should still emit as x.y diff --git a/tests/baselines/reference/asOperator1.errors.txt b/tests/baselines/reference/asOperator1.errors.txt new file mode 100644 index 0000000000000..8656c30dde222 --- /dev/null +++ b/tests/baselines/reference/asOperator1.errors.txt @@ -0,0 +1,18 @@ +asOperator1.ts(2,9): error TS2352: Conversion of type 'undefined' to type 'number' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. +asOperator1.ts(3,10): error TS2352: Conversion of type 'null' to type 'string' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. + + +==== asOperator1.ts (2 errors) ==== + var as = 43; + var x = undefined as number; + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2352: Conversion of type 'undefined' to type 'number' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. + var y = (null as string).length; + ~~~~~~~~~~~~~~ +!!! error TS2352: Conversion of type 'null' to type 'string' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. + var z = Date as any as string; + + // Should parse as a union type, not a bitwise 'or' of (32 as number) and 'string' + var j = 32 as number|string; + j = ''; + \ No newline at end of file diff --git a/tests/baselines/reference/asOperator1.js b/tests/baselines/reference/asOperator1.js index a90f36fcd9fd9..6d59556bb9dd6 100644 --- a/tests/baselines/reference/asOperator1.js +++ b/tests/baselines/reference/asOperator1.js @@ -12,6 +12,7 @@ j = ''; //// [asOperator1.js] +"use strict"; var as = 43; var x = undefined; var y = null.length; diff --git a/tests/baselines/reference/asOperator1.types b/tests/baselines/reference/asOperator1.types index 5d21f6b53851a..ea7244d62e7ac 100644 --- a/tests/baselines/reference/asOperator1.types +++ b/tests/baselines/reference/asOperator1.types @@ -33,6 +33,7 @@ var z = Date as any as string; >Date as any as string : string > : ^^^^^^ >Date as any : any +> : ^^^ >Date : DateConstructor > : ^^^^^^^^^^^^^^^ diff --git a/tests/baselines/reference/asOperator2.js b/tests/baselines/reference/asOperator2.js index cbb984e148613..b886dfb587bb2 100644 --- a/tests/baselines/reference/asOperator2.js +++ b/tests/baselines/reference/asOperator2.js @@ -5,4 +5,5 @@ var x = 23 as string; //// [asOperator2.js] +"use strict"; var x = 23; diff --git a/tests/baselines/reference/asOperator3.js b/tests/baselines/reference/asOperator3.js index bc1fed43548b9..238a466f05dff 100644 --- a/tests/baselines/reference/asOperator3.js +++ b/tests/baselines/reference/asOperator3.js @@ -13,6 +13,7 @@ var g = tag `Hello ${123} World` as string; var h = tag `Hello` as string; //// [asOperator3.js] +"use strict"; var a = `${123 + 456}`; var b = `leading ${123 + 456}`; var c = `${123 + 456} trailing`; diff --git a/tests/baselines/reference/asOperatorASI.js b/tests/baselines/reference/asOperatorASI.js index 0ef77ba3cf5ce..fc78ab26aa249 100644 --- a/tests/baselines/reference/asOperatorASI.js +++ b/tests/baselines/reference/asOperatorASI.js @@ -14,6 +14,7 @@ as(Foo); // should emit //// [asOperatorASI.js] +"use strict"; class Foo { } // Example 1 diff --git a/tests/baselines/reference/asOperatorAmbiguity.js b/tests/baselines/reference/asOperatorAmbiguity.js index e10fb695a5b9e..b4f5fe4031a9e 100644 --- a/tests/baselines/reference/asOperatorAmbiguity.js +++ b/tests/baselines/reference/asOperatorAmbiguity.js @@ -12,6 +12,7 @@ var z = y[0].m; // z should be string //// [asOperatorAmbiguity.js] +"use strict"; // Make sure this is a type assertion to an array type, and not nested comparison operators. var x; var y = x; diff --git a/tests/baselines/reference/asOperatorContextualType.js b/tests/baselines/reference/asOperatorContextualType.js index e4198d64229b6..b044a1f154aeb 100644 --- a/tests/baselines/reference/asOperatorContextualType.js +++ b/tests/baselines/reference/asOperatorContextualType.js @@ -5,5 +5,6 @@ var x = (v => v) as (x: number) => string; //// [asOperatorContextualType.js] +"use strict"; // should error var x = (v => v); diff --git a/tests/baselines/reference/asOperatorNames.js b/tests/baselines/reference/asOperatorNames.js index bf1d0f3c72653..6951723d582a9 100644 --- a/tests/baselines/reference/asOperatorNames.js +++ b/tests/baselines/reference/asOperatorNames.js @@ -8,6 +8,7 @@ var as1 = as as string; //// [asOperatorNames.js] +"use strict"; var a = 20; var b = a; var as = "hello"; diff --git a/tests/baselines/reference/asiAbstract.js b/tests/baselines/reference/asiAbstract.js index 0182fa37a9fc7..573e53628923d 100644 --- a/tests/baselines/reference/asiAbstract.js +++ b/tests/baselines/reference/asiAbstract.js @@ -18,6 +18,7 @@ class C3 { //// [asiAbstract.js] +"use strict"; abstract; class NonAbstractClass { } diff --git a/tests/baselines/reference/asiAmbientFunctionDeclaration.errors.txt b/tests/baselines/reference/asiAmbientFunctionDeclaration.errors.txt new file mode 100644 index 0000000000000..4799a8d4d65c4 --- /dev/null +++ b/tests/baselines/reference/asiAmbientFunctionDeclaration.errors.txt @@ -0,0 +1,7 @@ +asiAmbientFunctionDeclaration.ts(1,18): error TS7010: 'foo', which lacks return-type annotation, implicitly has an 'any' return type. + + +==== asiAmbientFunctionDeclaration.ts (1 errors) ==== + declare function foo() + ~~~ +!!! error TS7010: 'foo', which lacks return-type annotation, implicitly has an 'any' return type. \ No newline at end of file diff --git a/tests/baselines/reference/asiAmbientFunctionDeclaration.js b/tests/baselines/reference/asiAmbientFunctionDeclaration.js index fd36df59caa97..3f66751fab70e 100644 --- a/tests/baselines/reference/asiAmbientFunctionDeclaration.js +++ b/tests/baselines/reference/asiAmbientFunctionDeclaration.js @@ -4,3 +4,4 @@ declare function foo() //// [asiAmbientFunctionDeclaration.js] +"use strict"; diff --git a/tests/baselines/reference/asiArith.js b/tests/baselines/reference/asiArith.js index 441f09c9f62b7..f96b769c0ba40 100644 --- a/tests/baselines/reference/asiArith.js +++ b/tests/baselines/reference/asiArith.js @@ -37,6 +37,7 @@ y //// [asiArith.js] +"use strict"; var x = 1; var y = 1; var z = x diff --git a/tests/baselines/reference/asiBreak.js b/tests/baselines/reference/asiBreak.js index ff6296f0b78c9..a29b27567f803 100644 --- a/tests/baselines/reference/asiBreak.js +++ b/tests/baselines/reference/asiBreak.js @@ -4,5 +4,6 @@ while (true) break //// [asiBreak.js] +"use strict"; while (true) break; diff --git a/tests/baselines/reference/asiContinue.js b/tests/baselines/reference/asiContinue.js index 2937e6819b29b..6750ab641bc96 100644 --- a/tests/baselines/reference/asiContinue.js +++ b/tests/baselines/reference/asiContinue.js @@ -4,5 +4,6 @@ while (true) continue //// [asiContinue.js] +"use strict"; while (true) continue; diff --git a/tests/baselines/reference/asiInES6Classes.js b/tests/baselines/reference/asiInES6Classes.js index 9bfbc5ef80c05..cce61936f22ea 100644 --- a/tests/baselines/reference/asiInES6Classes.js +++ b/tests/baselines/reference/asiInES6Classes.js @@ -25,6 +25,7 @@ class Foo { //// [asiInES6Classes.js] +"use strict"; class Foo { constructor() { this.defaults = { diff --git a/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule01.errors.txt b/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule01.errors.txt new file mode 100644 index 0000000000000..227428148cc9b --- /dev/null +++ b/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule01.errors.txt @@ -0,0 +1,16 @@ +asiPreventsParsingAsAmbientExternalModule01.ts(4,1): error TS2454: Variable 'declare' is used before being assigned. +asiPreventsParsingAsAmbientExternalModule01.ts(5,1): error TS2454: Variable 'module' is used before being assigned. + + +==== asiPreventsParsingAsAmbientExternalModule01.ts (2 errors) ==== + var declare: number; + var module: string; + + declare // this is the identifier 'declare' + ~~~~~~~ +!!! error TS2454: Variable 'declare' is used before being assigned. + module // this is the identifier 'module' + ~~~~~~ +!!! error TS2454: Variable 'module' is used before being assigned. + "my external module" // this is just a string + { } // this is a block body \ No newline at end of file diff --git a/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule01.js b/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule01.js index b78dfc31eebc5..f64157251115f 100644 --- a/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule01.js +++ b/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule01.js @@ -10,6 +10,7 @@ module // this is the identifier 'module' { } // this is a block body //// [asiPreventsParsingAsAmbientExternalModule01.js] +"use strict"; var declare; var module; declare; // this is the identifier 'declare' diff --git a/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule02.js b/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule02.js index be867624cc3b5..243d0a03104fe 100644 --- a/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule02.js +++ b/tests/baselines/reference/asiPreventsParsingAsAmbientExternalModule02.js @@ -12,6 +12,7 @@ namespace container { } //// [asiPreventsParsingAsAmbientExternalModule02.js] +"use strict"; var declare; var module; var container; diff --git a/tests/baselines/reference/asiPreventsParsingAsInterface01.errors.txt b/tests/baselines/reference/asiPreventsParsingAsInterface01.errors.txt new file mode 100644 index 0000000000000..adc5f9e4c3949 --- /dev/null +++ b/tests/baselines/reference/asiPreventsParsingAsInterface01.errors.txt @@ -0,0 +1,20 @@ +asiPreventsParsingAsInterface01.ts(1,5): error TS1212: Identifier expected. 'interface' is a reserved word in strict mode. +asiPreventsParsingAsInterface01.ts(3,1): error TS1212: Identifier expected. 'interface' is a reserved word in strict mode. +asiPreventsParsingAsInterface01.ts(3,1): error TS2454: Variable 'interface' is used before being assigned. +asiPreventsParsingAsInterface01.ts(4,1): error TS2454: Variable 'I' is used before being assigned. + + +==== asiPreventsParsingAsInterface01.ts (4 errors) ==== + var interface: number, I: string; + ~~~~~~~~~ +!!! error TS1212: Identifier expected. 'interface' is a reserved word in strict mode. + + interface // This should be the identifier 'interface' + ~~~~~~~~~ +!!! error TS1212: Identifier expected. 'interface' is a reserved word in strict mode. + ~~~~~~~~~ +!!! error TS2454: Variable 'interface' is used before being assigned. + I // This should be the identifier 'I' + ~ +!!! error TS2454: Variable 'I' is used before being assigned. + {} // This should be a block body \ No newline at end of file diff --git a/tests/baselines/reference/asiPreventsParsingAsInterface01.js b/tests/baselines/reference/asiPreventsParsingAsInterface01.js index 49e75fd95b106..1c82878b91fb4 100644 --- a/tests/baselines/reference/asiPreventsParsingAsInterface01.js +++ b/tests/baselines/reference/asiPreventsParsingAsInterface01.js @@ -8,6 +8,7 @@ I // This should be the identifier 'I' {} // This should be a block body //// [asiPreventsParsingAsInterface01.js] +"use strict"; var interface, I; interface; // This should be the identifier 'interface' I; // This should be the identifier 'I' diff --git a/tests/baselines/reference/asiPreventsParsingAsInterface02.errors.txt b/tests/baselines/reference/asiPreventsParsingAsInterface02.errors.txt new file mode 100644 index 0000000000000..7668be900dff4 --- /dev/null +++ b/tests/baselines/reference/asiPreventsParsingAsInterface02.errors.txt @@ -0,0 +1,14 @@ +asiPreventsParsingAsInterface02.ts(1,12): error TS1212: Identifier expected. 'interface' is a reserved word in strict mode. +asiPreventsParsingAsInterface02.ts(2,5): error TS1212: Identifier expected. 'interface' is a reserved word in strict mode. + + +==== asiPreventsParsingAsInterface02.ts (2 errors) ==== + function f(interface: number, I: string) { + ~~~~~~~~~ +!!! error TS1212: Identifier expected. 'interface' is a reserved word in strict mode. + interface // This should be the identifier 'interface' + ~~~~~~~~~ +!!! error TS1212: Identifier expected. 'interface' is a reserved word in strict mode. + I // This should be the identifier 'I' + {} // This should be a block body + } \ No newline at end of file diff --git a/tests/baselines/reference/asiPreventsParsingAsInterface02.js b/tests/baselines/reference/asiPreventsParsingAsInterface02.js index f2e14e01c0f7d..991c22b3cd983 100644 --- a/tests/baselines/reference/asiPreventsParsingAsInterface02.js +++ b/tests/baselines/reference/asiPreventsParsingAsInterface02.js @@ -8,6 +8,7 @@ function f(interface: number, I: string) { } //// [asiPreventsParsingAsInterface02.js] +"use strict"; function f(interface, I) { interface; // This should be the identifier 'interface' I; // This should be the identifier 'I' diff --git a/tests/baselines/reference/asiPreventsParsingAsInterface03.errors.txt b/tests/baselines/reference/asiPreventsParsingAsInterface03.errors.txt new file mode 100644 index 0000000000000..827183b498f30 --- /dev/null +++ b/tests/baselines/reference/asiPreventsParsingAsInterface03.errors.txt @@ -0,0 +1,16 @@ +asiPreventsParsingAsInterface03.ts(1,5): error TS1212: Identifier expected. 'interface' is a reserved word in strict mode. +asiPreventsParsingAsInterface03.ts(4,5): error TS1212: Identifier expected. 'interface' is a reserved word in strict mode. + + +==== asiPreventsParsingAsInterface03.ts (2 errors) ==== + var interface: number, I: string; + ~~~~~~~~~ +!!! error TS1212: Identifier expected. 'interface' is a reserved word in strict mode. + + namespace n { + interface // This should be the identifier 'interface' + ~~~~~~~~~ +!!! error TS1212: Identifier expected. 'interface' is a reserved word in strict mode. + I // This should be the identifier 'I' + {} // This should be a block body + } \ No newline at end of file diff --git a/tests/baselines/reference/asiPreventsParsingAsInterface03.js b/tests/baselines/reference/asiPreventsParsingAsInterface03.js index 62650298ac91d..376c1fb487008 100644 --- a/tests/baselines/reference/asiPreventsParsingAsInterface03.js +++ b/tests/baselines/reference/asiPreventsParsingAsInterface03.js @@ -10,6 +10,7 @@ namespace n { } //// [asiPreventsParsingAsInterface03.js] +"use strict"; var interface, I; var n; (function (n) { diff --git a/tests/baselines/reference/asiPreventsParsingAsInterface04.errors.txt b/tests/baselines/reference/asiPreventsParsingAsInterface04.errors.txt new file mode 100644 index 0000000000000..b60bb5e8a31b3 --- /dev/null +++ b/tests/baselines/reference/asiPreventsParsingAsInterface04.errors.txt @@ -0,0 +1,24 @@ +asiPreventsParsingAsInterface04.ts(1,23): error TS1212: Identifier expected. 'interface' is a reserved word in strict mode. +asiPreventsParsingAsInterface04.ts(3,1): error TS2454: Variable 'declare' is used before being assigned. +asiPreventsParsingAsInterface04.ts(4,1): error TS1212: Identifier expected. 'interface' is a reserved word in strict mode. +asiPreventsParsingAsInterface04.ts(4,1): error TS2454: Variable 'interface' is used before being assigned. +asiPreventsParsingAsInterface04.ts(5,1): error TS2454: Variable 'I' is used before being assigned. + + +==== asiPreventsParsingAsInterface04.ts (5 errors) ==== + var declare: boolean, interface: number, I: string; + ~~~~~~~~~ +!!! error TS1212: Identifier expected. 'interface' is a reserved word in strict mode. + + declare // This should be the identifier 'declare' + ~~~~~~~ +!!! error TS2454: Variable 'declare' is used before being assigned. + interface // This should be the identifier 'interface' + ~~~~~~~~~ +!!! error TS1212: Identifier expected. 'interface' is a reserved word in strict mode. + ~~~~~~~~~ +!!! error TS2454: Variable 'interface' is used before being assigned. + I // This should be the identifier 'I' + ~ +!!! error TS2454: Variable 'I' is used before being assigned. + {} // This should be a block body \ No newline at end of file diff --git a/tests/baselines/reference/asiPreventsParsingAsInterface04.js b/tests/baselines/reference/asiPreventsParsingAsInterface04.js index 248e9f0196769..18e8b3503ed79 100644 --- a/tests/baselines/reference/asiPreventsParsingAsInterface04.js +++ b/tests/baselines/reference/asiPreventsParsingAsInterface04.js @@ -9,6 +9,7 @@ I // This should be the identifier 'I' {} // This should be a block body //// [asiPreventsParsingAsInterface04.js] +"use strict"; var declare, interface, I; declare; // This should be the identifier 'declare' interface; // This should be the identifier 'interface' diff --git a/tests/baselines/reference/asiPreventsParsingAsNamespace01.errors.txt b/tests/baselines/reference/asiPreventsParsingAsNamespace01.errors.txt new file mode 100644 index 0000000000000..f3c79e9d20487 --- /dev/null +++ b/tests/baselines/reference/asiPreventsParsingAsNamespace01.errors.txt @@ -0,0 +1,15 @@ +asiPreventsParsingAsNamespace01.ts(4,1): error TS2454: Variable 'namespace' is used before being assigned. +asiPreventsParsingAsNamespace01.ts(5,1): error TS2454: Variable 'n' is used before being assigned. + + +==== asiPreventsParsingAsNamespace01.ts (2 errors) ==== + var namespace: number; + var n: string; + + namespace // this is the identifier 'namespace' + ~~~~~~~~~ +!!! error TS2454: Variable 'namespace' is used before being assigned. + n // this is the identifier 'n' + ~ +!!! error TS2454: Variable 'n' is used before being assigned. + { } // this is a block body \ No newline at end of file diff --git a/tests/baselines/reference/asiPreventsParsingAsNamespace01.js b/tests/baselines/reference/asiPreventsParsingAsNamespace01.js index d2a31b6db7357..948ec2daf1afe 100644 --- a/tests/baselines/reference/asiPreventsParsingAsNamespace01.js +++ b/tests/baselines/reference/asiPreventsParsingAsNamespace01.js @@ -9,6 +9,7 @@ n // this is the identifier 'n' { } // this is a block body //// [asiPreventsParsingAsNamespace01.js] +"use strict"; var namespace; var n; namespace; // this is the identifier 'namespace' diff --git a/tests/baselines/reference/asiPreventsParsingAsNamespace02.errors.txt b/tests/baselines/reference/asiPreventsParsingAsNamespace02.errors.txt new file mode 100644 index 0000000000000..f41426b61edc7 --- /dev/null +++ b/tests/baselines/reference/asiPreventsParsingAsNamespace02.errors.txt @@ -0,0 +1,15 @@ +asiPreventsParsingAsNamespace02.ts(4,1): error TS2454: Variable 'module' is used before being assigned. +asiPreventsParsingAsNamespace02.ts(5,1): error TS2454: Variable 'm' is used before being assigned. + + +==== asiPreventsParsingAsNamespace02.ts (2 errors) ==== + var module: number; + var m: string; + + module // this is the identifier 'namespace' + ~~~~~~ +!!! error TS2454: Variable 'module' is used before being assigned. + m // this is the identifier 'm' + ~ +!!! error TS2454: Variable 'm' is used before being assigned. + { } // this is a block body \ No newline at end of file diff --git a/tests/baselines/reference/asiPreventsParsingAsNamespace02.js b/tests/baselines/reference/asiPreventsParsingAsNamespace02.js index 968b0c1834857..7d9929a5a057f 100644 --- a/tests/baselines/reference/asiPreventsParsingAsNamespace02.js +++ b/tests/baselines/reference/asiPreventsParsingAsNamespace02.js @@ -9,6 +9,7 @@ m // this is the identifier 'm' { } // this is a block body //// [asiPreventsParsingAsNamespace02.js] +"use strict"; var module; var m; module; // this is the identifier 'namespace' diff --git a/tests/baselines/reference/asiPreventsParsingAsNamespace03.js b/tests/baselines/reference/asiPreventsParsingAsNamespace03.js index 3c4ad1422266a..46773838a6700 100644 --- a/tests/baselines/reference/asiPreventsParsingAsNamespace03.js +++ b/tests/baselines/reference/asiPreventsParsingAsNamespace03.js @@ -11,6 +11,7 @@ namespace container { } //// [asiPreventsParsingAsNamespace03.js] +"use strict"; var namespace; var n; var container; diff --git a/tests/baselines/reference/asiPreventsParsingAsNamespace04.js b/tests/baselines/reference/asiPreventsParsingAsNamespace04.js index 588b439e536a4..b8f105a87b539 100644 --- a/tests/baselines/reference/asiPreventsParsingAsNamespace04.js +++ b/tests/baselines/reference/asiPreventsParsingAsNamespace04.js @@ -5,5 +5,6 @@ let module = 10; module in {} //// [asiPreventsParsingAsNamespace04.js] +"use strict"; let module = 10; module in {}; diff --git a/tests/baselines/reference/asiPreventsParsingAsNamespace05.js b/tests/baselines/reference/asiPreventsParsingAsNamespace05.js index a8901cdac3199..3a9d03080b704 100644 --- a/tests/baselines/reference/asiPreventsParsingAsNamespace05.js +++ b/tests/baselines/reference/asiPreventsParsingAsNamespace05.js @@ -12,6 +12,7 @@ a.b.c } //// [asiPreventsParsingAsNamespace05.js] +"use strict"; let namespace = 10; var a; (function (a) { diff --git a/tests/baselines/reference/asiPreventsParsingAsTypeAlias01.js b/tests/baselines/reference/asiPreventsParsingAsTypeAlias01.js index 555ee106f7093..5c5112b523ac1 100644 --- a/tests/baselines/reference/asiPreventsParsingAsTypeAlias01.js +++ b/tests/baselines/reference/asiPreventsParsingAsTypeAlias01.js @@ -9,6 +9,7 @@ type Foo = string; //// [asiPreventsParsingAsTypeAlias01.js] +"use strict"; var type; var string; var Foo; diff --git a/tests/baselines/reference/asiPreventsParsingAsTypeAlias01.types b/tests/baselines/reference/asiPreventsParsingAsTypeAlias01.types index c3a2bb6839c87..260d083512136 100644 --- a/tests/baselines/reference/asiPreventsParsingAsTypeAlias01.types +++ b/tests/baselines/reference/asiPreventsParsingAsTypeAlias01.types @@ -11,10 +11,13 @@ var Foo; >Foo : any type ->type : any +>type : undefined +> : ^^^^^^^^^ Foo = string; ->Foo = string : any +>Foo = string : undefined +> : ^^^^^^^^^ >Foo : any ->string : any +>string : undefined +> : ^^^^^^^^^ diff --git a/tests/baselines/reference/asiPreventsParsingAsTypeAlias02.js b/tests/baselines/reference/asiPreventsParsingAsTypeAlias02.js index 6b86e53716a5d..975b5372cdd58 100644 --- a/tests/baselines/reference/asiPreventsParsingAsTypeAlias02.js +++ b/tests/baselines/reference/asiPreventsParsingAsTypeAlias02.js @@ -11,6 +11,7 @@ namespace container { } //// [asiPreventsParsingAsTypeAlias02.js] +"use strict"; var type; var string; var Foo; diff --git a/tests/baselines/reference/asiPublicPrivateProtected.errors.txt b/tests/baselines/reference/asiPublicPrivateProtected.errors.txt index c3653603ddc74..73bb539683e31 100644 --- a/tests/baselines/reference/asiPublicPrivateProtected.errors.txt +++ b/tests/baselines/reference/asiPublicPrivateProtected.errors.txt @@ -1,11 +1,16 @@ +asiPublicPrivateProtected.ts(1,1): error TS1212: Identifier expected. 'public' is a reserved word in strict mode. asiPublicPrivateProtected.ts(1,1): error TS2304: Cannot find name 'public'. +asiPublicPrivateProtected.ts(12,1): error TS1212: Identifier expected. 'private' is a reserved word in strict mode. asiPublicPrivateProtected.ts(12,1): error TS2304: Cannot find name 'private'. +asiPublicPrivateProtected.ts(23,1): error TS1212: Identifier expected. 'protected' is a reserved word in strict mode. asiPublicPrivateProtected.ts(23,1): error TS2304: Cannot find name 'protected'. -==== asiPublicPrivateProtected.ts (3 errors) ==== +==== asiPublicPrivateProtected.ts (6 errors) ==== public ~~~~~~ +!!! error TS1212: Identifier expected. 'public' is a reserved word in strict mode. + ~~~~~~ !!! error TS2304: Cannot find name 'public'. class NonPublicClass { public s() { @@ -19,6 +24,8 @@ asiPublicPrivateProtected.ts(23,1): error TS2304: Cannot find name 'protected'. } private ~~~~~~~ +!!! error TS1212: Identifier expected. 'private' is a reserved word in strict mode. + ~~~~~~~ !!! error TS2304: Cannot find name 'private'. class NonPrivateClass { private s() { @@ -32,6 +39,8 @@ asiPublicPrivateProtected.ts(23,1): error TS2304: Cannot find name 'protected'. } protected ~~~~~~~~~ +!!! error TS1212: Identifier expected. 'protected' is a reserved word in strict mode. + ~~~~~~~~~ !!! error TS2304: Cannot find name 'protected'. class NonProtectedClass { protected s() { diff --git a/tests/baselines/reference/asiPublicPrivateProtected.js b/tests/baselines/reference/asiPublicPrivateProtected.js index 17806e03bd62b..4fc5504c40bcd 100644 --- a/tests/baselines/reference/asiPublicPrivateProtected.js +++ b/tests/baselines/reference/asiPublicPrivateProtected.js @@ -43,6 +43,7 @@ class ClassWithThreeMembers { //// [asiPublicPrivateProtected.js] +"use strict"; public; class NonPublicClass { s() { diff --git a/tests/baselines/reference/asiReturn.js b/tests/baselines/reference/asiReturn.js index 0e416cf5544c2..0926e1ac51b7a 100644 --- a/tests/baselines/reference/asiReturn.js +++ b/tests/baselines/reference/asiReturn.js @@ -5,5 +5,6 @@ return //// [asiReturn.js] +"use strict"; // This should be an error for using a return outside a function, but ASI should work properly return; diff --git a/tests/baselines/reference/assertInWrapSomeTypeParameter.js b/tests/baselines/reference/assertInWrapSomeTypeParameter.js index 81bd47164b0bc..51c552ab7b53d 100644 --- a/tests/baselines/reference/assertInWrapSomeTypeParameter.js +++ b/tests/baselines/reference/assertInWrapSomeTypeParameter.js @@ -8,6 +8,7 @@ class C> { } //// [assertInWrapSomeTypeParameter.js] +"use strict"; class C { foo(x) { return null; diff --git a/tests/baselines/reference/assertionsAndNonReturningFunctions.types b/tests/baselines/reference/assertionsAndNonReturningFunctions.types index f93528300f054..afa1559fa2193 100644 --- a/tests/baselines/reference/assertionsAndNonReturningFunctions.types +++ b/tests/baselines/reference/assertionsAndNonReturningFunctions.types @@ -94,10 +94,10 @@ function f1(x) { > : ^^^ if (!!true) { ->!!true : boolean -> : ^^^^^^^ ->!true : boolean -> : ^^^^^^^ +>!!true : true +> : ^^^^ +>!true : false +> : ^^^^^ >true : true > : ^^^^ @@ -124,10 +124,10 @@ function f1(x) { > : ^^^^^^ } if (!!true) { ->!!true : boolean -> : ^^^^^^^ ->!true : boolean -> : ^^^^^^^ +>!!true : true +> : ^^^^ +>!true : false +> : ^^^^^ >true : true > : ^^^^ @@ -154,10 +154,10 @@ function f1(x) { > : ^^^^^^ } if (!!true) { ->!!true : boolean -> : ^^^^^^^ ->!true : boolean -> : ^^^^^^^ +>!!true : true +> : ^^^^ +>!true : false +> : ^^^^^ >true : true > : ^^^^ @@ -178,10 +178,10 @@ function f1(x) { > : ^^^^^^ } if (!!true) { ->!!true : boolean -> : ^^^^^^^ ->!true : boolean -> : ^^^^^^^ +>!!true : true +> : ^^^^ +>!true : false +> : ^^^^^ >true : true > : ^^^^ diff --git a/tests/baselines/reference/assign1.js b/tests/baselines/reference/assign1.js index c39e15498381b..223ae5b5b32b2 100644 --- a/tests/baselines/reference/assign1.js +++ b/tests/baselines/reference/assign1.js @@ -12,6 +12,7 @@ namespace M { //// [assign1.js] +"use strict"; var M; (function (M) { var x = { salt: 2, pepper: 0 }; diff --git a/tests/baselines/reference/assignAnyToEveryType.errors.txt b/tests/baselines/reference/assignAnyToEveryType.errors.txt index 989704f233cfa..ab232765800cf 100644 --- a/tests/baselines/reference/assignAnyToEveryType.errors.txt +++ b/tests/baselines/reference/assignAnyToEveryType.errors.txt @@ -1,7 +1,8 @@ +assignAnyToEveryType.ts(23,5): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. assignAnyToEveryType.ts(41,1): error TS2631: Cannot assign to 'M' because it is a namespace. -==== assignAnyToEveryType.ts (1 errors) ==== +==== assignAnyToEveryType.ts (2 errors) ==== // all of these are valid var x: any; @@ -25,6 +26,8 @@ assignAnyToEveryType.ts(41,1): error TS2631: Cannot assign to 'M' because it is class C { foo: string; + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. } var h: C = x; diff --git a/tests/baselines/reference/assignAnyToEveryType.js b/tests/baselines/reference/assignAnyToEveryType.js index d40d7f369a430..3025ad0563305 100644 --- a/tests/baselines/reference/assignAnyToEveryType.js +++ b/tests/baselines/reference/assignAnyToEveryType.js @@ -48,6 +48,7 @@ function k(a: T) { } //// [assignAnyToEveryType.js] +"use strict"; // all of these are valid var x; var a = x; diff --git a/tests/baselines/reference/assignEveryTypeToAny.errors.txt b/tests/baselines/reference/assignEveryTypeToAny.errors.txt new file mode 100644 index 0000000000000..480d4c4aae549 --- /dev/null +++ b/tests/baselines/reference/assignEveryTypeToAny.errors.txt @@ -0,0 +1,70 @@ +assignEveryTypeToAny.ts(39,5): error TS2454: Variable 'g' is used before being assigned. +assignEveryTypeToAny.ts(42,5): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. +assignEveryTypeToAny.ts(46,5): error TS2454: Variable 'h' is used before being assigned. +assignEveryTypeToAny.ts(49,5): error TS2454: Variable 'i' is used before being assigned. + + +==== assignEveryTypeToAny.ts (4 errors) ==== + // all of these are valid + + var x: any; + + x = 1; + var a = 2; + x = a; + + x = true; + var b = true; + x = b; + + x = ""; + var c = ""; + x = c; + + var d: void; + x = d; + + var e = undefined; + x = e; + + var e2: typeof undefined; + x = e2; + + enum E { + A + } + + x = E.A; + var f = E.A; + x = f; + + interface I { + foo: string; + } + + var g: I; + x = g; + ~ +!!! error TS2454: Variable 'g' is used before being assigned. + + class C { + bar: string; + ~~~ +!!! error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. + } + + var h: C; + x = h; + ~ +!!! error TS2454: Variable 'h' is used before being assigned. + + var i: { (): string }; + x = i; + ~ +!!! error TS2454: Variable 'i' is used before being assigned. + x = { f() { return 1; } } + x = { f(x: T) { return x; } } + + function j(a: T) { + x = a; + } \ No newline at end of file diff --git a/tests/baselines/reference/assignEveryTypeToAny.js b/tests/baselines/reference/assignEveryTypeToAny.js index 70ee1192da101..908a104003340 100644 --- a/tests/baselines/reference/assignEveryTypeToAny.js +++ b/tests/baselines/reference/assignEveryTypeToAny.js @@ -58,6 +58,7 @@ function j(a: T) { } //// [assignEveryTypeToAny.js] +"use strict"; // all of these are valid var x; x = 1; diff --git a/tests/baselines/reference/assignEveryTypeToAny.types b/tests/baselines/reference/assignEveryTypeToAny.types index 42e00f5bc6df7..687ea7e767ab8 100644 --- a/tests/baselines/reference/assignEveryTypeToAny.types +++ b/tests/baselines/reference/assignEveryTypeToAny.types @@ -5,11 +5,13 @@ var x: any; >x : any +> : ^^^ x = 1; >x = 1 : 1 > : ^ >x : any +> : ^^^ >1 : 1 > : ^ @@ -23,6 +25,7 @@ x = a; >x = a : number > : ^^^^^^ >x : any +> : ^^^ >a : number > : ^^^^^^ @@ -30,6 +33,7 @@ x = true; >x = true : true > : ^^^^ >x : any +> : ^^^ >true : true > : ^^^^ @@ -43,6 +47,7 @@ x = b; >x = b : true > : ^^^^ >x : any +> : ^^^ >b : true > : ^^^^ @@ -50,6 +55,7 @@ x = ""; >x = "" : "" > : ^^ >x : any +> : ^^^ >"" : "" > : ^^ @@ -63,6 +69,7 @@ x = c; >x = c : string > : ^^^^^^ >x : any +> : ^^^ >c : string > : ^^^^^^ @@ -74,28 +81,37 @@ x = d; >x = d : void > : ^^^^ >x : any +> : ^^^ >d : void > : ^^^^ var e = undefined; >e : any +> : ^^^ >undefined : undefined > : ^^^^^^^^^ x = e; ->x = e : any +>x = e : undefined +> : ^^^^^^^^^ >x : any ->e : any +> : ^^^ +>e : undefined +> : ^^^^^^^^^ var e2: typeof undefined; ->e2 : any +>e2 : undefined +> : ^^^^^^^^^ >undefined : undefined > : ^^^^^^^^^ x = e2; ->x = e2 : any +>x = e2 : undefined +> : ^^^^^^^^^ >x : any ->e2 : any +> : ^^^ +>e2 : undefined +> : ^^^^^^^^^ enum E { >E : E @@ -110,6 +126,7 @@ x = E.A; >x = E.A : E > : ^ >x : any +> : ^^^ >E.A : E > : ^ >E : typeof E @@ -131,6 +148,7 @@ x = f; >x = f : E > : ^ >x : any +> : ^^^ >f : E > : ^ @@ -148,6 +166,7 @@ x = g; >x = g : I > : ^ >x : any +> : ^^^ >g : I > : ^ @@ -168,6 +187,7 @@ x = h; >x = h : C > : ^ >x : any +> : ^^^ >h : C > : ^ @@ -179,6 +199,7 @@ x = i; >x = i : () => string > : ^^^^^^ >x : any +> : ^^^ >i : () => string > : ^^^^^^ @@ -186,6 +207,7 @@ x = { f() { return 1; } } >x = { f() { return 1; } } : { f(): number; } > : ^^^^^^^^^^^^^^^^ >x : any +> : ^^^ >{ f() { return 1; } } : { f(): number; } > : ^^^^^^^^^^^^^^^^ >f : () => number @@ -197,6 +219,7 @@ x = { f(x: T) { return x; } } >x = { f(x: T) { return x; } } : { f(x: T): T; } > : ^^^^ ^^ ^^ ^^^^^^^ >x : any +> : ^^^ >{ f(x: T) { return x; } } : { f(x: T): T; } > : ^^^^ ^^ ^^ ^^^^^^^ >f : (x: T) => T @@ -216,6 +239,7 @@ function j(a: T) { >x = a : T > : ^ >x : any +> : ^^^ >a : T > : ^ } diff --git a/tests/baselines/reference/assignFromBooleanInterface.js b/tests/baselines/reference/assignFromBooleanInterface.js index 21b05dedd0d14..9dcb3b6daa4f7 100644 --- a/tests/baselines/reference/assignFromBooleanInterface.js +++ b/tests/baselines/reference/assignFromBooleanInterface.js @@ -7,6 +7,7 @@ x = a; a = x; //// [assignFromBooleanInterface.js] +"use strict"; var x = true; x = a; a = x; diff --git a/tests/baselines/reference/assignFromBooleanInterface2.js b/tests/baselines/reference/assignFromBooleanInterface2.js index 0ac4657706ff4..04401fcdbd65f 100644 --- a/tests/baselines/reference/assignFromBooleanInterface2.js +++ b/tests/baselines/reference/assignFromBooleanInterface2.js @@ -25,6 +25,7 @@ x = b; // expected error //// [assignFromBooleanInterface2.js] +"use strict"; var x = true; a = x; a = b; diff --git a/tests/baselines/reference/assignFromNumberInterface.js b/tests/baselines/reference/assignFromNumberInterface.js index d4b57147fd22c..c9674da90496f 100644 --- a/tests/baselines/reference/assignFromNumberInterface.js +++ b/tests/baselines/reference/assignFromNumberInterface.js @@ -7,6 +7,7 @@ x = a; a = x; //// [assignFromNumberInterface.js] +"use strict"; var x = 1; x = a; a = x; diff --git a/tests/baselines/reference/assignFromNumberInterface2.js b/tests/baselines/reference/assignFromNumberInterface2.js index 7fd396aa7673d..a27450629a3e7 100644 --- a/tests/baselines/reference/assignFromNumberInterface2.js +++ b/tests/baselines/reference/assignFromNumberInterface2.js @@ -30,6 +30,7 @@ x = b; // expected error //// [assignFromNumberInterface2.js] +"use strict"; var x = 1; a = x; a = b; diff --git a/tests/baselines/reference/assignFromNumberInterface2.types b/tests/baselines/reference/assignFromNumberInterface2.types index c3cc6fb24a7db..a3f60686e8206 100644 --- a/tests/baselines/reference/assignFromNumberInterface2.types +++ b/tests/baselines/reference/assignFromNumberInterface2.types @@ -11,26 +11,26 @@ interface NotNumber { toString(radix?: number): string; >toString : (radix?: number) => string > : ^ ^^^ ^^^^^ ->radix : number -> : ^^^^^^ +>radix : number | undefined +> : ^^^^^^^^^^^^^^^^^^ toFixed(fractionDigits?: number): string; >toFixed : (fractionDigits?: number) => string > : ^ ^^^ ^^^^^ ->fractionDigits : number -> : ^^^^^^ +>fractionDigits : number | undefined +> : ^^^^^^^^^^^^^^^^^^ toExponential(fractionDigits?: number): string; >toExponential : (fractionDigits?: number) => string > : ^ ^^^ ^^^^^ ->fractionDigits : number -> : ^^^^^^ +>fractionDigits : number | undefined +> : ^^^^^^^^^^^^^^^^^^ toPrecision(precision?: number): string; >toPrecision : (precision?: number) => string > : ^ ^^^ ^^^^^ ->precision : number -> : ^^^^^^ +>precision : number | undefined +> : ^^^^^^^^^^^^^^^^^^ valueOf(): number; >valueOf : () => number diff --git a/tests/baselines/reference/assignFromStringInterface.js b/tests/baselines/reference/assignFromStringInterface.js index bb220c9ae28f8..68a34092fcf44 100644 --- a/tests/baselines/reference/assignFromStringInterface.js +++ b/tests/baselines/reference/assignFromStringInterface.js @@ -7,6 +7,7 @@ x = a; a = x; //// [assignFromStringInterface.js] +"use strict"; var x = ''; x = a; a = x; diff --git a/tests/baselines/reference/assignFromStringInterface2.errors.txt b/tests/baselines/reference/assignFromStringInterface2.errors.txt index 6aff3eb4bce0f..714c039fce925 100644 --- a/tests/baselines/reference/assignFromStringInterface2.errors.txt +++ b/tests/baselines/reference/assignFromStringInterface2.errors.txt @@ -1,10 +1,15 @@ assignFromStringInterface2.ts(42,1): error TS2740: Type 'NotString' is missing the following properties from type 'String': codePointAt, includes, endsWith, normalize, and 16 more. +assignFromStringInterface2.ts(44,1): error TS2322: Type 'String' is not assignable to type 'NotString'. + The types returned by 'match(...)' are incompatible between these types. + Type 'RegExpMatchArray | null' is not assignable to type 'RegExpMatchArray'. + Type 'null' is not assignable to type 'RegExpMatchArray'. +assignFromStringInterface2.ts(45,1): error TS2322: Type 'string' is not assignable to type 'NotString'. assignFromStringInterface2.ts(47,1): error TS2322: Type 'String' is not assignable to type 'string'. 'string' is a primitive, but 'String' is a wrapper object. Prefer using 'string' when possible. assignFromStringInterface2.ts(48,1): error TS2322: Type 'NotString' is not assignable to type 'string'. -==== assignFromStringInterface2.ts (3 errors) ==== +==== assignFromStringInterface2.ts (5 errors) ==== interface String { doStuff(): string; } @@ -51,7 +56,14 @@ assignFromStringInterface2.ts(48,1): error TS2322: Type 'NotString' is not assig !!! error TS2740: Type 'NotString' is missing the following properties from type 'String': codePointAt, includes, endsWith, normalize, and 16 more. b = a; + ~ +!!! error TS2322: Type 'String' is not assignable to type 'NotString'. +!!! error TS2322: The types returned by 'match(...)' are incompatible between these types. +!!! error TS2322: Type 'RegExpMatchArray | null' is not assignable to type 'RegExpMatchArray'. +!!! error TS2322: Type 'null' is not assignable to type 'RegExpMatchArray'. b = x; + ~ +!!! error TS2322: Type 'string' is not assignable to type 'NotString'. x = a; // expected error ~ diff --git a/tests/baselines/reference/assignFromStringInterface2.js b/tests/baselines/reference/assignFromStringInterface2.js index 653ba0bce6ef0..d46e451ff9d7f 100644 --- a/tests/baselines/reference/assignFromStringInterface2.js +++ b/tests/baselines/reference/assignFromStringInterface2.js @@ -53,6 +53,7 @@ x = b; // expected error //// [assignFromStringInterface2.js] +"use strict"; var x = ''; a = x; a = b; diff --git a/tests/baselines/reference/assignFromStringInterface2.types b/tests/baselines/reference/assignFromStringInterface2.types index 07abd49b32fc4..eeb791a154073 100644 --- a/tests/baselines/reference/assignFromStringInterface2.types +++ b/tests/baselines/reference/assignFromStringInterface2.types @@ -39,16 +39,16 @@ interface NotString { > : ^ ^^ ^^ ^^^ ^^^^^ >searchString : string > : ^^^^^^ ->position : number -> : ^^^^^^ +>position : number | undefined +> : ^^^^^^^^^^^^^^^^^^ lastIndexOf(searchString: string, position?: number): number; >lastIndexOf : (searchString: string, position?: number) => number > : ^ ^^ ^^ ^^^ ^^^^^ >searchString : string > : ^^^^^^ ->position : number -> : ^^^^^^ +>position : number | undefined +> : ^^^^^^^^^^^^^^^^^^ localeCompare(that: string): number; >localeCompare : (that: string) => number @@ -123,34 +123,34 @@ interface NotString { slice(start?: number, end?: number): string; >slice : (start?: number, end?: number) => string > : ^ ^^^ ^^ ^^^ ^^^^^ ->start : number -> : ^^^^^^ ->end : number -> : ^^^^^^ +>start : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>end : number | undefined +> : ^^^^^^^^^^^^^^^^^^ split(separator: string, limit?: number): string[]; >split : { (separator: string, limit?: number): string[]; (separator: RegExp, limit?: number): string[]; } > : ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ >separator : string > : ^^^^^^ ->limit : number -> : ^^^^^^ +>limit : number | undefined +> : ^^^^^^^^^^^^^^^^^^ split(separator: RegExp, limit?: number): string[]; >split : { (separator: string, limit?: number): string[]; (separator: RegExp, limit?: number): string[]; } > : ^^^ ^^ ^^ ^^^ ^^^ ^^^ ^^ ^^ ^^^ ^^^ ^^^ >separator : RegExp > : ^^^^^^ ->limit : number -> : ^^^^^^ +>limit : number | undefined +> : ^^^^^^^^^^^^^^^^^^ substring(start: number, end?: number): string; >substring : (start: number, end?: number) => string > : ^ ^^ ^^ ^^^ ^^^^^ >start : number > : ^^^^^^ ->end : number -> : ^^^^^^ +>end : number | undefined +> : ^^^^^^^^^^^^^^^^^^ toLowerCase(): string; >toLowerCase : () => string @@ -181,8 +181,8 @@ interface NotString { > : ^ ^^ ^^ ^^^ ^^^^^ >from : number > : ^^^^^^ ->length : number -> : ^^^^^^ +>length : number | undefined +> : ^^^^^^^^^^^^^^^^^^ valueOf(): string; >valueOf : () => string diff --git a/tests/baselines/reference/assignLambdaToNominalSubtypeOfFunction.js b/tests/baselines/reference/assignLambdaToNominalSubtypeOfFunction.js index 4f55a6f15e912..b7f1820f0fff6 100644 --- a/tests/baselines/reference/assignLambdaToNominalSubtypeOfFunction.js +++ b/tests/baselines/reference/assignLambdaToNominalSubtypeOfFunction.js @@ -12,6 +12,7 @@ fn(function (a, b) { return true; }) //// [assignLambdaToNominalSubtypeOfFunction.js] +"use strict"; function fn(cb) { } fn((a, b) => true); fn(function (a, b) { return true; }); diff --git a/tests/baselines/reference/assignObjectToNonPrimitive.js b/tests/baselines/reference/assignObjectToNonPrimitive.js index 40eb2db3e1fa8..4e317aa92e0a7 100644 --- a/tests/baselines/reference/assignObjectToNonPrimitive.js +++ b/tests/baselines/reference/assignObjectToNonPrimitive.js @@ -9,6 +9,7 @@ a = y; //// [assignObjectToNonPrimitive.js] +"use strict"; var x = {}; var y = { foo: "bar" }; var a; diff --git a/tests/baselines/reference/assignParameterPropertyToPropertyDeclarationES2022.js b/tests/baselines/reference/assignParameterPropertyToPropertyDeclarationES2022.js index ebff1d836dd23..547be50a28185 100644 --- a/tests/baselines/reference/assignParameterPropertyToPropertyDeclarationES2022.js +++ b/tests/baselines/reference/assignParameterPropertyToPropertyDeclarationES2022.js @@ -54,6 +54,7 @@ class H { //// [assignParameterPropertyToPropertyDeclarationES2022.js] +"use strict"; class C { foo; qux = this.bar; // should error diff --git a/tests/baselines/reference/assignParameterPropertyToPropertyDeclarationESNext.js b/tests/baselines/reference/assignParameterPropertyToPropertyDeclarationESNext.js index 834dd77490ebc..9e8c4e5583fa0 100644 --- a/tests/baselines/reference/assignParameterPropertyToPropertyDeclarationESNext.js +++ b/tests/baselines/reference/assignParameterPropertyToPropertyDeclarationESNext.js @@ -54,6 +54,7 @@ class H { //// [assignParameterPropertyToPropertyDeclarationESNext.js] +"use strict"; class C { foo; qux = this.bar; // should error diff --git a/tests/baselines/reference/assignSharedArrayBufferToArrayBuffer(target=es2015).js b/tests/baselines/reference/assignSharedArrayBufferToArrayBuffer(target=es2015).js index f7642aae6275d..4ca4b631e851e 100644 --- a/tests/baselines/reference/assignSharedArrayBufferToArrayBuffer(target=es2015).js +++ b/tests/baselines/reference/assignSharedArrayBufferToArrayBuffer(target=es2015).js @@ -4,4 +4,5 @@ var foo: ArrayBuffer = new SharedArrayBuffer(1024); // should error //// [assignSharedArrayBufferToArrayBuffer.js] +"use strict"; var foo = new SharedArrayBuffer(1024); // should error diff --git a/tests/baselines/reference/assignSharedArrayBufferToArrayBuffer(target=es5).js b/tests/baselines/reference/assignSharedArrayBufferToArrayBuffer(target=es5).js index f7642aae6275d..4ca4b631e851e 100644 --- a/tests/baselines/reference/assignSharedArrayBufferToArrayBuffer(target=es5).js +++ b/tests/baselines/reference/assignSharedArrayBufferToArrayBuffer(target=es5).js @@ -4,4 +4,5 @@ var foo: ArrayBuffer = new SharedArrayBuffer(1024); // should error //// [assignSharedArrayBufferToArrayBuffer.js] +"use strict"; var foo = new SharedArrayBuffer(1024); // should error diff --git a/tests/baselines/reference/assignToEnum.js b/tests/baselines/reference/assignToEnum.js index c0fee8f2fae3d..a83094c8a41b9 100644 --- a/tests/baselines/reference/assignToEnum.js +++ b/tests/baselines/reference/assignToEnum.js @@ -10,6 +10,7 @@ A.foo = A.bar; // invalid LHS //// [assignToEnum.js] +"use strict"; var A; (function (A) { A[A["foo"] = 0] = "foo"; diff --git a/tests/baselines/reference/assignToExistingClass.errors.txt b/tests/baselines/reference/assignToExistingClass.errors.txt index 0a8b913d0f439..fba70ab41c63d 100644 --- a/tests/baselines/reference/assignToExistingClass.errors.txt +++ b/tests/baselines/reference/assignToExistingClass.errors.txt @@ -1,10 +1,13 @@ +assignToExistingClass.ts(3,9): error TS2564: Property 'myProp' has no initializer and is not definitely assigned in the constructor. assignToExistingClass.ts(8,13): error TS2629: Cannot assign to 'Mocked' because it is a class. -==== assignToExistingClass.ts (1 errors) ==== +==== assignToExistingClass.ts (2 errors) ==== namespace Test { class Mocked { myProp: string; + ~~~~~~ +!!! error TS2564: Property 'myProp' has no initializer and is not definitely assigned in the constructor. } class Tester { diff --git a/tests/baselines/reference/assignToExistingClass.js b/tests/baselines/reference/assignToExistingClass.js index 47ae3419585de..ae6641817e638 100644 --- a/tests/baselines/reference/assignToExistingClass.js +++ b/tests/baselines/reference/assignToExistingClass.js @@ -18,6 +18,7 @@ namespace Test { //// [assignToExistingClass.js] +"use strict"; var Test; (function (Test) { class Mocked { diff --git a/tests/baselines/reference/assignToExistingClass.types b/tests/baselines/reference/assignToExistingClass.types index e14f164fea297..0a9c8ef373836 100644 --- a/tests/baselines/reference/assignToExistingClass.types +++ b/tests/baselines/reference/assignToExistingClass.types @@ -23,12 +23,12 @@ namespace Test { > : ^^^^^^^^^^ Mocked = Mocked || function () { // => Error: Invalid left-hand side of assignment expression. ->Mocked = Mocked || function () { // => Error: Invalid left-hand side of assignment expression. return { myProp: "test" }; } : typeof Mocked | (() => { myProp: string; }) -> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Mocked = Mocked || function () { // => Error: Invalid left-hand side of assignment expression. return { myProp: "test" }; } : typeof Mocked +> : ^^^^^^^^^^^^^ >Mocked : any > : ^^^ ->Mocked || function () { // => Error: Invalid left-hand side of assignment expression. return { myProp: "test" }; } : typeof Mocked | (() => { myProp: string; }) -> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Mocked || function () { // => Error: Invalid left-hand side of assignment expression. return { myProp: "test" }; } : typeof Mocked +> : ^^^^^^^^^^^^^ >Mocked : typeof Mocked > : ^^^^^^^^^^^^^ >function () { // => Error: Invalid left-hand side of assignment expression. return { myProp: "test" }; } : () => { myProp: string; } diff --git a/tests/baselines/reference/assignToFn.js b/tests/baselines/reference/assignToFn.js index 38f70b78b4ccb..c3af8ed373e24 100644 --- a/tests/baselines/reference/assignToFn.js +++ b/tests/baselines/reference/assignToFn.js @@ -13,6 +13,7 @@ namespace M { //// [assignToFn.js] +"use strict"; var M; (function (M) { var x = { f: function (n) { return true; } }; diff --git a/tests/baselines/reference/assignToInvalidLHS.js b/tests/baselines/reference/assignToInvalidLHS.js index e3a6f1ea11448..4c062ec00f479 100644 --- a/tests/baselines/reference/assignToInvalidLHS.js +++ b/tests/baselines/reference/assignToInvalidLHS.js @@ -7,5 +7,6 @@ declare var y:any; var x = new y = 5; //// [assignToInvalidLHS.js] +"use strict"; // Below is actually valid JavaScript (see http://es5.github.com/#x8.7 ), even though will always fail at runtime with 'invalid left-hand side' var x = new y = 5; diff --git a/tests/baselines/reference/assignToModule.js b/tests/baselines/reference/assignToModule.js index 16e68d534f4b9..8c1ea0a052d4a 100644 --- a/tests/baselines/reference/assignToModule.js +++ b/tests/baselines/reference/assignToModule.js @@ -5,4 +5,5 @@ namespace A {} A = undefined; // invalid LHS //// [assignToModule.js] +"use strict"; A = undefined; // invalid LHS diff --git a/tests/baselines/reference/assignToObjectTypeWithPrototypeProperty.js b/tests/baselines/reference/assignToObjectTypeWithPrototypeProperty.js index 227df70ceb84f..2d7a7699207c2 100644 --- a/tests/baselines/reference/assignToObjectTypeWithPrototypeProperty.js +++ b/tests/baselines/reference/assignToObjectTypeWithPrototypeProperty.js @@ -6,6 +6,7 @@ var p: XEvent = XEvent.prototype; var x: {prototype: XEvent} = XEvent; //// [assignToObjectTypeWithPrototypeProperty.js] +"use strict"; class XEvent { } var p = XEvent.prototype; diff --git a/tests/baselines/reference/assignToPrototype1.js b/tests/baselines/reference/assignToPrototype1.js index c3006b1d89d78..2ab06ffbbbaee 100644 --- a/tests/baselines/reference/assignToPrototype1.js +++ b/tests/baselines/reference/assignToPrototype1.js @@ -9,5 +9,6 @@ Point.prototype.add = function(dx, dy) { }; //// [assignToPrototype1.js] +"use strict"; Point.prototype.add = function (dx, dy) { }; diff --git a/tests/baselines/reference/assigningFromObjectToAnythingElse.js b/tests/baselines/reference/assigningFromObjectToAnythingElse.js index 393cda52bead6..72a95cb317411 100644 --- a/tests/baselines/reference/assigningFromObjectToAnythingElse.js +++ b/tests/baselines/reference/assigningFromObjectToAnythingElse.js @@ -12,6 +12,7 @@ var w: Error = new Object(); //// [assigningFromObjectToAnythingElse.js] +"use strict"; var y; y = x; var a = Object.create(""); diff --git a/tests/baselines/reference/assigningFunctionToTupleIssuesError.js b/tests/baselines/reference/assigningFunctionToTupleIssuesError.js index 6308be96efea6..f3f8e63e86e81 100644 --- a/tests/baselines/reference/assigningFunctionToTupleIssuesError.js +++ b/tests/baselines/reference/assigningFunctionToTupleIssuesError.js @@ -5,4 +5,5 @@ declare let a: () => void; let b: [string] = a; //// [assigningFunctionToTupleIssuesError.js] +"use strict"; let b = a; diff --git a/tests/baselines/reference/assignmentCompat1.js b/tests/baselines/reference/assignmentCompat1.js index 46129a3486827..c2344e9f339e2 100644 --- a/tests/baselines/reference/assignmentCompat1.js +++ b/tests/baselines/reference/assignmentCompat1.js @@ -15,6 +15,7 @@ z = false; // Error //// [assignmentCompat1.js] +"use strict"; var x = { one: 1 }; x = y; // Error y = x; // Ok because index signature type is any diff --git a/tests/baselines/reference/assignmentCompatBetweenTupleAndArray.js b/tests/baselines/reference/assignmentCompatBetweenTupleAndArray.js index 682af0db3825c..2ff490f04704f 100644 --- a/tests/baselines/reference/assignmentCompatBetweenTupleAndArray.js +++ b/tests/baselines/reference/assignmentCompatBetweenTupleAndArray.js @@ -22,6 +22,7 @@ emptyObjTuple = emptyObjArray; //// [assignmentCompatBetweenTupleAndArray.js] +"use strict"; // no error numArray = numNumTuple; emptyObjArray = emptyObjTuple; diff --git a/tests/baselines/reference/assignmentCompatBug2.errors.txt b/tests/baselines/reference/assignmentCompatBug2.errors.txt index fd93992e9c81a..90f4c8c2e2628 100644 --- a/tests/baselines/reference/assignmentCompatBug2.errors.txt +++ b/tests/baselines/reference/assignmentCompatBug2.errors.txt @@ -1,9 +1,9 @@ assignmentCompatBug2.ts(1,27): error TS2353: Object literal may only specify known properties, and 'a' does not exist in type '{ b: number; }'. assignmentCompatBug2.ts(3,8): error TS2353: Object literal may only specify known properties, and 'a' does not exist in type '{ b: number; }'. assignmentCompatBug2.ts(5,13): error TS2353: Object literal may only specify known properties, and 'a' does not exist in type '{ b: number; }'. -assignmentCompatBug2.ts(15,1): error TS2741: Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; }' but required in type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. -assignmentCompatBug2.ts(20,1): error TS2741: Property 'g' is missing in type '{ f: (n: number) => number; m: number; }' but required in type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. -assignmentCompatBug2.ts(33,1): error TS2741: Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }' but required in type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. +assignmentCompatBug2.ts(15,1): error TS2741: Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; }' but required in type '{ f(n: number): number; g(s: string): number; m: number; n?: number | undefined; k?(a: any): any; }'. +assignmentCompatBug2.ts(20,1): error TS2741: Property 'g' is missing in type '{ f: (n: number) => number; m: number; }' but required in type '{ f(n: number): number; g(s: string): number; m: number; n?: number | undefined; k?(a: any): any; }'. +assignmentCompatBug2.ts(33,1): error TS2741: Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => null; }' but required in type '{ f(n: number): number; g(s: string): number; m: number; n?: number | undefined; k?(a: any): any; }'. ==== assignmentCompatBug2.ts (6 errors) ==== @@ -29,7 +29,7 @@ assignmentCompatBug2.ts(33,1): error TS2741: Property 'm' is missing in type '{ b3 = { ~~ -!!! error TS2741: Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; }' but required in type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. +!!! error TS2741: Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; }' but required in type '{ f(n: number): number; g(s: string): number; m: number; n?: number | undefined; k?(a: any): any; }'. !!! related TS2728 assignmentCompatBug2.ts:7:55: 'm' is declared here. f: (n) => { return 0; }, g: (s) => { return 0; }, @@ -37,7 +37,7 @@ assignmentCompatBug2.ts(33,1): error TS2741: Property 'm' is missing in type '{ b3 = { ~~ -!!! error TS2741: Property 'g' is missing in type '{ f: (n: number) => number; m: number; }' but required in type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. +!!! error TS2741: Property 'g' is missing in type '{ f: (n: number) => number; m: number; }' but required in type '{ f(n: number): number; g(s: string): number; m: number; n?: number | undefined; k?(a: any): any; }'. !!! related TS2728 assignmentCompatBug2.ts:7:33: 'g' is declared here. f: (n) => { return 0; }, m: 0, @@ -53,7 +53,7 @@ assignmentCompatBug2.ts(33,1): error TS2741: Property 'm' is missing in type '{ b3 = { ~~ -!!! error TS2741: Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }' but required in type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. +!!! error TS2741: Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => null; }' but required in type '{ f(n: number): number; g(s: string): number; m: number; n?: number | undefined; k?(a: any): any; }'. !!! related TS2728 assignmentCompatBug2.ts:7:55: 'm' is declared here. f: (n) => { return 0; }, g: (s) => { return 0; }, diff --git a/tests/baselines/reference/assignmentCompatBug2.js b/tests/baselines/reference/assignmentCompatBug2.js index 456cf290f5256..28dfb694f2e6e 100644 --- a/tests/baselines/reference/assignmentCompatBug2.js +++ b/tests/baselines/reference/assignmentCompatBug2.js @@ -41,6 +41,7 @@ b3 = { }; // error //// [assignmentCompatBug2.js] +"use strict"; var b2 = { a: 0 }; // error b2 = { a: 0 }; // error b2 = { b: 0, a: 0 }; diff --git a/tests/baselines/reference/assignmentCompatBug2.types b/tests/baselines/reference/assignmentCompatBug2.types index acaf0e92847ce..42fe402deeead 100644 --- a/tests/baselines/reference/assignmentCompatBug2.types +++ b/tests/baselines/reference/assignmentCompatBug2.types @@ -54,10 +54,10 @@ var b3: { f(n: number): number; g(s: string): number; m: number; n?: number; k?( > : ^^^^^^ >m : number > : ^^^^^^ ->n : number -> : ^^^^^^ ->k : (a: any) => any -> : ^ ^^ ^^^^^ +>n : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>k : ((a: any) => any) | undefined +> : ^^ ^^ ^^^^^ ^^^^^^^^^^^^^ >a : any > : ^^^ @@ -154,12 +154,12 @@ b3 = { }; // error b3 = { ->b3 = { f: (n) => { return 0; }, g: (s) => { return 0; }, m: 0, n: 0, k: (a) =>{ return null; },} : { f: (n: number) => number; g: (s: string) => number; m: number; n: number; k: (a: any) => any; } -> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ +>b3 = { f: (n) => { return 0; }, g: (s) => { return 0; }, m: 0, n: 0, k: (a) =>{ return null; },} : { f: (n: number) => number; g: (s: string) => number; m: number; n: number; k: (a: any) => null; } +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ >b3 : { f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; } > : ^^^^ ^^ ^^^ ^^^^ ^^ ^^^ ^^^^^ ^^^^^^ ^^^^^ ^^ ^^^ ^^^ ->{ f: (n) => { return 0; }, g: (s) => { return 0; }, m: 0, n: 0, k: (a) =>{ return null; },} : { f: (n: number) => number; g: (s: string) => number; m: number; n: number; k: (a: any) => any; } -> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ +>{ f: (n) => { return 0; }, g: (s) => { return 0; }, m: 0, n: 0, k: (a) =>{ return null; },} : { f: (n: number) => number; g: (s: string) => number; m: number; n: number; k: (a: any) => null; } +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ f: (n) => { return 0; }, >f : (n: number) => number @@ -194,22 +194,22 @@ b3 = { > : ^ k: (a) =>{ return null; }, ->k : (a: any) => any -> : ^ ^^^^^^^^^^^^^ ->(a) =>{ return null; } : (a: any) => any -> : ^ ^^^^^^^^^^^^^ +>k : (a: any) => null +> : ^ ^^^^^^^^^^^^^^ +>(a) =>{ return null; } : (a: any) => null +> : ^ ^^^^^^^^^^^^^^ >a : any > : ^^^ }; // ok b3 = { ->b3 = { f: (n) => { return 0; }, g: (s) => { return 0; }, n: 0, k: (a) =>{ return null; },} : { f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; } -> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ +>b3 = { f: (n) => { return 0; }, g: (s) => { return 0; }, n: 0, k: (a) =>{ return null; },} : { f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => null; } +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ >b3 : { f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; } > : ^^^^ ^^ ^^^ ^^^^ ^^ ^^^ ^^^^^ ^^^^^^ ^^^^^ ^^ ^^^ ^^^ ->{ f: (n) => { return 0; }, g: (s) => { return 0; }, n: 0, k: (a) =>{ return null; },} : { f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; } -> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ +>{ f: (n) => { return 0; }, g: (s) => { return 0; }, n: 0, k: (a) =>{ return null; },} : { f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => null; } +> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ f: (n) => { return 0; }, >f : (n: number) => number @@ -238,10 +238,10 @@ b3 = { > : ^ k: (a) =>{ return null; }, ->k : (a: any) => any -> : ^ ^^^^^^^^^^^^^ ->(a) =>{ return null; } : (a: any) => any -> : ^ ^^^^^^^^^^^^^ +>k : (a: any) => null +> : ^ ^^^^^^^^^^^^^^ +>(a) =>{ return null; } : (a: any) => null +> : ^ ^^^^^^^^^^^^^^ >a : any > : ^^^ diff --git a/tests/baselines/reference/assignmentCompatBug3.js b/tests/baselines/reference/assignmentCompatBug3.js index a0564b026de76..07c9038146859 100644 --- a/tests/baselines/reference/assignmentCompatBug3.js +++ b/tests/baselines/reference/assignmentCompatBug3.js @@ -28,6 +28,7 @@ foo(x); foo(x + y); //// [assignmentCompatBug3.js] +"use strict"; function makePoint(x, y) { return { get x() { return x; }, // shouldn't be "void" diff --git a/tests/baselines/reference/assignmentCompatBug5.js b/tests/baselines/reference/assignmentCompatBug5.js index da21fd6b4cb50..ab1492e360358 100644 --- a/tests/baselines/reference/assignmentCompatBug5.js +++ b/tests/baselines/reference/assignmentCompatBug5.js @@ -14,6 +14,7 @@ foo3((n) => { return; }); //// [assignmentCompatBug5.js] +"use strict"; function foo1(x) { } foo1({ b: 5 }); function foo2(x) { } diff --git a/tests/baselines/reference/assignmentCompatForEnums.js b/tests/baselines/reference/assignmentCompatForEnums.js index 81fca0dde353a..a9e4473db4d93 100644 --- a/tests/baselines/reference/assignmentCompatForEnums.js +++ b/tests/baselines/reference/assignmentCompatForEnums.js @@ -17,6 +17,7 @@ function foo() { //// [assignmentCompatForEnums.js] +"use strict"; var TokenType; (function (TokenType) { TokenType[TokenType["One"] = 0] = "One"; diff --git a/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt b/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt index ed95de201c349..47fce93af6761 100644 --- a/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt +++ b/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt @@ -1,7 +1,7 @@ assignmentCompatFunctionsWithOptionalArgs.ts(1,10): error TS2391: Function implementation is missing or not immediately following the declaration. assignmentCompatFunctionsWithOptionalArgs.ts(4,17): error TS2322: Type 'boolean' is not assignable to type 'string'. -assignmentCompatFunctionsWithOptionalArgs.ts(5,5): error TS2345: Argument of type '{ name: string; }' is not assignable to parameter of type '{ id: number; name?: string; }'. - Property 'id' is missing in type '{ name: string; }' but required in type '{ id: number; name?: string; }'. +assignmentCompatFunctionsWithOptionalArgs.ts(5,5): error TS2345: Argument of type '{ name: string; }' is not assignable to parameter of type '{ id: number; name?: string | undefined; }'. + Property 'id' is missing in type '{ name: string; }' but required in type '{ id: number; name?: string | undefined; }'. ==== assignmentCompatFunctionsWithOptionalArgs.ts (3 errors) ==== @@ -13,9 +13,9 @@ assignmentCompatFunctionsWithOptionalArgs.ts(5,5): error TS2345: Argument of typ foo({ id: 1234, name: false }); // Error, name of wrong type ~~~~ !!! error TS2322: Type 'boolean' is not assignable to type 'string'. -!!! related TS6500 assignmentCompatFunctionsWithOptionalArgs.ts:1:31: The expected type comes from property 'name' which is declared here on type '{ id: number; name?: string; }' +!!! related TS6500 assignmentCompatFunctionsWithOptionalArgs.ts:1:31: The expected type comes from property 'name' which is declared here on type '{ id: number; name?: string | undefined; }' foo({ name: "hello" }); // Error, id required but missing ~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ name: string; }' is not assignable to parameter of type '{ id: number; name?: string; }'. -!!! error TS2345: Property 'id' is missing in type '{ name: string; }' but required in type '{ id: number; name?: string; }'. +!!! error TS2345: Argument of type '{ name: string; }' is not assignable to parameter of type '{ id: number; name?: string | undefined; }'. +!!! error TS2345: Property 'id' is missing in type '{ name: string; }' but required in type '{ id: number; name?: string | undefined; }'. !!! related TS2728 assignmentCompatFunctionsWithOptionalArgs.ts:1:19: 'id' is declared here. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.js b/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.js index 57acf2f70ace6..cc1b4ebe1d4f9 100644 --- a/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.js +++ b/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.js @@ -8,6 +8,7 @@ foo({ id: 1234, name: false }); // Error, name of wrong type foo({ name: "hello" }); // Error, id required but missing //// [assignmentCompatFunctionsWithOptionalArgs.js] +"use strict"; foo({ id: 1234 }); // Ok foo({ id: 1234, name: "hello" }); // Ok foo({ id: 1234, name: false }); // Error, name of wrong type diff --git a/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.types b/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.types index 10d8a830b9cb8..c4839551bd4a4 100644 --- a/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.types +++ b/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.types @@ -8,8 +8,8 @@ function foo(x: { id: number; name?: string; }): void; > : ^^^^^^ ^^^^^^^^^ ^^^ >id : number > : ^^^^^^ ->name : string -> : ^^^^^^ +>name : string | undefined +> : ^^^^^^^^^^^^^^^^^^ foo({ id: 1234 }); // Ok >foo({ id: 1234 }) : void diff --git a/tests/baselines/reference/assignmentCompatInterfaceWithStringIndexSignature.js b/tests/baselines/reference/assignmentCompatInterfaceWithStringIndexSignature.js index 1c9dde49802e8..7726ff7883d9e 100644 --- a/tests/baselines/reference/assignmentCompatInterfaceWithStringIndexSignature.js +++ b/tests/baselines/reference/assignmentCompatInterfaceWithStringIndexSignature.js @@ -19,6 +19,7 @@ Biz(new Foo()); //// [assignmentCompatInterfaceWithStringIndexSignature.js] +"use strict"; class Foo { Boz() { } } diff --git a/tests/baselines/reference/assignmentCompatOnNew.js b/tests/baselines/reference/assignmentCompatOnNew.js index 9d67c7f066007..97d3a247bfe97 100644 --- a/tests/baselines/reference/assignmentCompatOnNew.js +++ b/tests/baselines/reference/assignmentCompatOnNew.js @@ -9,6 +9,7 @@ bar(Foo); // Error, but should be allowed //// [assignmentCompatOnNew.js] +"use strict"; class Foo { } ; diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures.js b/tests/baselines/reference/assignmentCompatWithCallSignatures.js index 6a2112cb85e30..9790aff9c00cf 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures.js @@ -46,6 +46,7 @@ a = function (x: string) { return ''; } //// [assignmentCompatWithCallSignatures.js] +"use strict"; // void returning call signatures can be assigned a non-void returning call signature that otherwise matches t = a; a = t; diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures2.js b/tests/baselines/reference/assignmentCompatWithCallSignatures2.js index c739091496769..c1f1208cbbfa2 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures2.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures2.js @@ -53,6 +53,7 @@ a = function (x: string) { return ''; } //// [assignmentCompatWithCallSignatures2.js] +"use strict"; // void returning call signatures can be assigned a non-void returning call signature that otherwise matches t = a; a = t; diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures3.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignatures3.errors.txt index b72fa97762c6f..9e4bb2f782a4c 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures3.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures3.errors.txt @@ -1,3 +1,7 @@ +assignmentCompatWithCallSignatures3.ts(3,14): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. +assignmentCompatWithCallSignatures3.ts(4,30): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. +assignmentCompatWithCallSignatures3.ts(5,34): error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. +assignmentCompatWithCallSignatures3.ts(6,35): error TS2564: Property 'bing' has no initializer and is not definitely assigned in the constructor. assignmentCompatWithCallSignatures3.ts(47,1): error TS2322: Type '(x: number) => number[]' is not assignable to type '(x: T) => T[]'. Types of parameters 'x' and 'x' are incompatible. Type 'T' is not assignable to type 'number'. @@ -62,13 +66,21 @@ assignmentCompatWithCallSignatures3.ts(86,1): error TS2322: Type '(x: { a: strin Type 'T' is not assignable to type 'string'. -==== assignmentCompatWithCallSignatures3.ts (15 errors) ==== +==== assignmentCompatWithCallSignatures3.ts (19 errors) ==== // these are all permitted with the current rules, since we do not do contextual signature instantiation class Base { foo: string; } + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. class Derived extends Base { bar: string; } + ~~~ +!!! error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. class Derived2 extends Derived { baz: string; } + ~~~ +!!! error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. class OtherDerived extends Base { bing: string; } + ~~~~ +!!! error TS2564: Property 'bing' has no initializer and is not definitely assigned in the constructor. declare var a: (x: number) => number[]; declare var a2: (x: number) => string[]; diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures3.js b/tests/baselines/reference/assignmentCompatWithCallSignatures3.js index d01798e6bdfa1..cf70105cbd44a 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures3.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures3.js @@ -102,6 +102,7 @@ b18 = a18; // ok //// [assignmentCompatWithCallSignatures3.js] +"use strict"; // these are all permitted with the current rules, since we do not do contextual signature instantiation class Base { } diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt index 20203d4160ab4..0f3ecac69118d 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt @@ -1,3 +1,7 @@ +assignmentCompatWithCallSignatures4.ts(4,18): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. +assignmentCompatWithCallSignatures4.ts(5,34): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. +assignmentCompatWithCallSignatures4.ts(6,38): error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. +assignmentCompatWithCallSignatures4.ts(7,39): error TS2564: Property 'bing' has no initializer and is not definitely assigned in the constructor. assignmentCompatWithCallSignatures4.ts(45,9): error TS2322: Type '(x: number) => string[]' is not assignable to type '(x: T) => U[]'. Types of parameters 'x' and 'x' are incompatible. Type 'T' is not assignable to type 'number'. @@ -17,15 +21,22 @@ assignmentCompatWithCallSignatures4.ts(53,9): error TS2322: Type '(x: (arg: Base Types of parameters 'arg' and 'arg' are incompatible. Type 'Base' is not assignable to type 'T'. 'Base' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Base'. +assignmentCompatWithCallSignatures4.ts(57,9): error TS2322: Type '(...x: T[]) => T' is not assignable to type '(...x: Base[]) => Base'. + Types of parameters 'x' and 'x' are incompatible. + Property 'bar' is missing in type 'Base' but required in type 'Derived'. assignmentCompatWithCallSignatures4.ts(58,9): error TS2322: Type '(...x: Base[]) => Base' is not assignable to type '(...x: T[]) => T'. Type 'Base' is not assignable to type 'T'. 'T' could be instantiated with an arbitrary type which could be unrelated to 'Base'. +assignmentCompatWithCallSignatures4.ts(61,9): error TS2322: Type '(x: T, y: T) => T' is not assignable to type '(x: { foo: string; }, y: { foo: string; bar: string; }) => Base'. + Types of parameters 'x' and 'x' are incompatible. + Property 'bar' is missing in type '{ foo: string; }' but required in type 'Derived'. assignmentCompatWithCallSignatures4.ts(62,9): error TS2322: Type '(x: { foo: string; }, y: { foo: string; bar: string; }) => Base' is not assignable to type '(x: T, y: T) => T'. Type 'Base' is not assignable to type 'T'. 'T' could be instantiated with an arbitrary type which could be unrelated to 'Base'. assignmentCompatWithCallSignatures4.ts(66,9): error TS2322: Type '(x: Base[], y: Derived2[]) => Derived[]' is not assignable to type '>(x: Base[], y: Base[]) => T'. - Type 'Derived[]' is not assignable to type 'T'. - 'T' could be instantiated with an arbitrary type which could be unrelated to 'Derived[]'. + Types of parameters 'y' and 'y' are incompatible. + Type 'Base[]' is not assignable to type 'Derived2[]'. + Type 'Base' is missing the following properties from type 'Derived2': baz, bar assignmentCompatWithCallSignatures4.ts(69,9): error TS2322: Type '(x: { a: T; b: T; }) => T' is not assignable to type '(x: { a: string; b: number; }) => number'. Types of parameters 'x' and 'x' are incompatible. Type '{ a: string; b: number; }' is not assignable to type '{ a: string; b: string; }'. @@ -63,14 +74,22 @@ assignmentCompatWithCallSignatures4.ts(96,9): error TS2322: Type '(x: T) => s 'T' could be instantiated with an arbitrary type which could be unrelated to 'string'. -==== assignmentCompatWithCallSignatures4.ts (15 errors) ==== +==== assignmentCompatWithCallSignatures4.ts (21 errors) ==== // These are mostly permitted with the current loose rules. All ok unless otherwise noted. namespace Errors { class Base { foo: string; } + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. class Derived extends Base { bar: string; } + ~~~ +!!! error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. class Derived2 extends Derived { baz: string; } + ~~~ +!!! error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. class OtherDerived extends Base { bing: string; } + ~~~~ +!!! error TS2564: Property 'bing' has no initializer and is not definitely assigned in the constructor. namespace WithNonGenericSignaturesInBaseType { // target type with non-generic call signatures @@ -145,6 +164,11 @@ assignmentCompatWithCallSignatures4.ts(96,9): error TS2322: Type '(x: T) => s declare var b10: (...x: T[]) => T; a10 = b10; + ~~~ +!!! error TS2322: Type '(...x: T[]) => T' is not assignable to type '(...x: Base[]) => Base'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Property 'bar' is missing in type 'Base' but required in type 'Derived'. +!!! related TS2728 assignmentCompatWithCallSignatures4.ts:5:34: 'bar' is declared here. b10 = a10; ~~~ !!! error TS2322: Type '(...x: Base[]) => Base' is not assignable to type '(...x: T[]) => T'. @@ -153,6 +177,11 @@ assignmentCompatWithCallSignatures4.ts(96,9): error TS2322: Type '(x: T) => s declare var b11: (x: T, y: T) => T; a11 = b11; + ~~~ +!!! error TS2322: Type '(x: T, y: T) => T' is not assignable to type '(x: { foo: string; }, y: { foo: string; bar: string; }) => Base'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Property 'bar' is missing in type '{ foo: string; }' but required in type 'Derived'. +!!! related TS2728 assignmentCompatWithCallSignatures4.ts:5:34: 'bar' is declared here. b11 = a11; ~~~ !!! error TS2322: Type '(x: { foo: string; }, y: { foo: string; bar: string; }) => Base' is not assignable to type '(x: T, y: T) => T'. @@ -164,8 +193,9 @@ assignmentCompatWithCallSignatures4.ts(96,9): error TS2322: Type '(x: T) => s b12 = a12; ~~~ !!! error TS2322: Type '(x: Base[], y: Derived2[]) => Derived[]' is not assignable to type '>(x: Base[], y: Base[]) => T'. -!!! error TS2322: Type 'Derived[]' is not assignable to type 'T'. -!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Derived[]'. +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type 'Base[]' is not assignable to type 'Derived2[]'. +!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': baz, bar declare var b15: (x: { a: T; b: T }) => T; a15 = b15; diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures4.js b/tests/baselines/reference/assignmentCompatWithCallSignatures4.js index 6df08dde1ec83..d8126affc63a7 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures4.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures4.js @@ -101,6 +101,7 @@ namespace Errors { } //// [assignmentCompatWithCallSignatures4.js] +"use strict"; // These are mostly permitted with the current loose rules. All ok unless otherwise noted. var Errors; (function (Errors) { diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures4.types b/tests/baselines/reference/assignmentCompatWithCallSignatures4.types index 95ef2a827ac37..ecbfd18f1a30c 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures4.types +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures4.types @@ -136,8 +136,8 @@ namespace Errors { > : ^^^^^^ (a?: number): number; ->a : number -> : ^^^^^^ +>a : number | undefined +> : ^^^^^^^^^^^^^^^^^^ }): number[]; (x: { @@ -149,8 +149,8 @@ namespace Errors { > : ^^^^^^^ (a?: boolean): boolean; ->a : boolean -> : ^^^^^^^ +>a : boolean | undefined +> : ^^^^^^^^^^^^^^^^^^^ }): boolean[]; }; diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures5.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignatures5.errors.txt index 2d140be8e62f0..4dd2d2afb231e 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures5.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures5.errors.txt @@ -1,3 +1,7 @@ +assignmentCompatWithCallSignatures5.ts(3,14): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. +assignmentCompatWithCallSignatures5.ts(4,30): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. +assignmentCompatWithCallSignatures5.ts(5,34): error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. +assignmentCompatWithCallSignatures5.ts(6,35): error TS2564: Property 'bing' has no initializer and is not definitely assigned in the constructor. assignmentCompatWithCallSignatures5.ts(40,1): error TS2322: Type '(x: T) => void' is not assignable to type '(x: T) => T'. Type 'void' is not assignable to type 'T'. 'T' could be instantiated with an arbitrary type which could be unrelated to 'void'. @@ -20,13 +24,21 @@ assignmentCompatWithCallSignatures5.ts(58,1): error TS2322: Type '(x: T) => T[]; declare var a2: (x: T) => string[]; diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures5.js b/tests/baselines/reference/assignmentCompatWithCallSignatures5.js index dafc3a58b0f19..f8832632352c6 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures5.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures5.js @@ -68,6 +68,7 @@ b18 = a18; // ok //// [assignmentCompatWithCallSignatures5.js] +"use strict"; // checking assignment compat for function types. No errors in this file class Base { } diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures6.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignatures6.errors.txt index 8d25046286fd1..1f12e2c9b25d0 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures6.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures6.errors.txt @@ -1,3 +1,7 @@ +assignmentCompatWithCallSignatures6.ts(3,14): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. +assignmentCompatWithCallSignatures6.ts(4,30): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. +assignmentCompatWithCallSignatures6.ts(5,34): error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. +assignmentCompatWithCallSignatures6.ts(6,35): error TS2564: Property 'bing' has no initializer and is not definitely assigned in the constructor. assignmentCompatWithCallSignatures6.ts(30,1): error TS2322: Type '(x: T) => void' is not assignable to type '(x: T) => T'. Type 'void' is not assignable to type 'T'. 'T' could be instantiated with an arbitrary type which could be unrelated to 'void'. @@ -14,13 +18,21 @@ assignmentCompatWithCallSignatures6.ts(42,1): error TS2322: Type '(x: T) => T[]; diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures6.js b/tests/baselines/reference/assignmentCompatWithCallSignatures6.js index 24ccd2559f9c2..e587ec00dacb7 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures6.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures6.js @@ -45,6 +45,7 @@ x.a16 = b16; b16 = x.a16; //// [assignmentCompatWithCallSignatures6.js] +"use strict"; // checking assignment compatibility relations for function types. All valid class Base { } diff --git a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt index 60511bef2fe75..fe6b9a514c83a 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.errors.txt @@ -2,19 +2,59 @@ assignmentCompatWithCallSignaturesWithOptionalParameters.ts(16,5): error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0. assignmentCompatWithCallSignaturesWithOptionalParameters.ts(19,5): error TS2322: Type '(x: number) => number' is not assignable to type '() => number'. Target signature provides too few arguments. Expected 1 or more, but got 0. -assignmentCompatWithCallSignaturesWithOptionalParameters.ts(20,5): error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '() => number'. +assignmentCompatWithCallSignaturesWithOptionalParameters.ts(20,5): error TS2322: Type '(x: number, y?: number | undefined) => number' is not assignable to type '() => number'. Target signature provides too few arguments. Expected 1 or more, but got 0. assignmentCompatWithCallSignaturesWithOptionalParameters.ts(22,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '() => number'. Target signature provides too few arguments. Expected 2 or more, but got 0. -assignmentCompatWithCallSignaturesWithOptionalParameters.ts(33,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x?: number) => number'. +assignmentCompatWithCallSignaturesWithOptionalParameters.ts(27,5): error TS2322: Type '(x: number) => number' is not assignable to type '(x?: number | undefined) => number'. + Types of parameters 'x' and 'x' are incompatible. + Type 'number | undefined' is not assignable to type 'number'. + Type 'undefined' is not assignable to type 'number'. +assignmentCompatWithCallSignaturesWithOptionalParameters.ts(30,5): error TS2322: Type '(x: number) => number' is not assignable to type '(x?: number | undefined) => number'. + Types of parameters 'x' and 'x' are incompatible. + Type 'number | undefined' is not assignable to type 'number'. + Type 'undefined' is not assignable to type 'number'. +assignmentCompatWithCallSignaturesWithOptionalParameters.ts(31,5): error TS2322: Type '(x: number, y?: number | undefined) => number' is not assignable to type '(x?: number | undefined) => number'. + Types of parameters 'x' and 'x' are incompatible. + Type 'number | undefined' is not assignable to type 'number'. + Type 'undefined' is not assignable to type 'number'. +assignmentCompatWithCallSignaturesWithOptionalParameters.ts(33,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x?: number | undefined) => number'. Target signature provides too few arguments. Expected 2 or more, but got 1. assignmentCompatWithCallSignaturesWithOptionalParameters.ts(39,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. Target signature provides too few arguments. Expected 2 or more, but got 1. assignmentCompatWithCallSignaturesWithOptionalParameters.ts(45,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number) => number'. Target signature provides too few arguments. Expected 2 or more, but got 1. +assignmentCompatWithCallSignaturesWithOptionalParameters.ts(51,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number, y?: number | undefined) => number'. + Types of parameters 'y' and 'y' are incompatible. + Type 'number | undefined' is not assignable to type 'number'. + Type 'undefined' is not assignable to type 'number'. +assignmentCompatWithCallSignaturesWithOptionalParameters.ts(57,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number, y?: number | undefined) => number'. + Types of parameters 'y' and 'y' are incompatible. + Type 'number | undefined' is not assignable to type 'number'. + Type 'undefined' is not assignable to type 'number'. +assignmentCompatWithCallSignaturesWithOptionalParameters.ts(62,5): error TS2322: Type '(x: number) => number' is not assignable to type '(x?: number | undefined, y?: number | undefined) => number'. + Types of parameters 'x' and 'x' are incompatible. + Type 'number | undefined' is not assignable to type 'number'. + Type 'undefined' is not assignable to type 'number'. +assignmentCompatWithCallSignaturesWithOptionalParameters.ts(63,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x?: number | undefined, y?: number | undefined) => number'. + Types of parameters 'x' and 'x' are incompatible. + Type 'number | undefined' is not assignable to type 'number'. + Type 'undefined' is not assignable to type 'number'. +assignmentCompatWithCallSignaturesWithOptionalParameters.ts(66,5): error TS2322: Type '(x: number) => number' is not assignable to type '(x?: number | undefined, y?: number | undefined) => number'. + Types of parameters 'x' and 'x' are incompatible. + Type 'number | undefined' is not assignable to type 'number'. + Type 'undefined' is not assignable to type 'number'. +assignmentCompatWithCallSignaturesWithOptionalParameters.ts(67,5): error TS2322: Type '(x: number, y?: number | undefined) => number' is not assignable to type '(x?: number | undefined, y?: number | undefined) => number'. + Types of parameters 'x' and 'x' are incompatible. + Type 'number | undefined' is not assignable to type 'number'. + Type 'undefined' is not assignable to type 'number'. +assignmentCompatWithCallSignaturesWithOptionalParameters.ts(69,5): error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x?: number | undefined, y?: number | undefined) => number'. + Types of parameters 'x' and 'x' are incompatible. + Type 'number | undefined' is not assignable to type 'number'. + Type 'undefined' is not assignable to type 'number'. -==== assignmentCompatWithCallSignaturesWithOptionalParameters.ts (7 errors) ==== +==== assignmentCompatWithCallSignaturesWithOptionalParameters.ts (17 errors) ==== // call signatures in derived types must have the same or fewer optional parameters as the base type interface Base { @@ -42,7 +82,7 @@ assignmentCompatWithCallSignaturesWithOptionalParameters.ts(45,5): error TS2322: !!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0. a = b.a4; // error ~ -!!! error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '() => number'. +!!! error TS2322: Type '(x: number, y?: number | undefined) => number' is not assignable to type '() => number'. !!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0. a = b.a5; // ok a = b.a6; // error @@ -54,14 +94,29 @@ assignmentCompatWithCallSignaturesWithOptionalParameters.ts(45,5): error TS2322: a2 = () => 1; // ok, same number of required params a2 = (x?: number) => 1; // ok, same number of required params a2 = (x: number) => 1; // ok, same number of params + ~~ +!!! error TS2322: Type '(x: number) => number' is not assignable to type '(x?: number | undefined) => number'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'number | undefined' is not assignable to type 'number'. +!!! error TS2322: Type 'undefined' is not assignable to type 'number'. a2 = b.a; // ok a2 = b.a2; // ok a2 = b.a3; // ok, same number of params + ~~ +!!! error TS2322: Type '(x: number) => number' is not assignable to type '(x?: number | undefined) => number'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'number | undefined' is not assignable to type 'number'. +!!! error TS2322: Type 'undefined' is not assignable to type 'number'. a2 = b.a4; // ok, excess params are optional in b.a3 + ~~ +!!! error TS2322: Type '(x: number, y?: number | undefined) => number' is not assignable to type '(x?: number | undefined) => number'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'number | undefined' is not assignable to type 'number'. +!!! error TS2322: Type 'undefined' is not assignable to type 'number'. a2 = b.a5; // ok a2 = b.a6; // error ~~ -!!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x?: number) => number'. +!!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x?: number | undefined) => number'. !!! error TS2322: Target signature provides too few arguments. Expected 2 or more, but got 1. declare var a3: (x: number) => number; @@ -87,21 +142,56 @@ assignmentCompatWithCallSignaturesWithOptionalParameters.ts(45,5): error TS2322: a4 = (x?: number, y?: number) => 1; // ok, fewer required params a4 = (x: number) => 1; // ok, same number of required params a4 = (x: number, y: number) => 1; // ok, same number of params + ~~ +!!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number, y?: number | undefined) => number'. +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type 'number | undefined' is not assignable to type 'number'. +!!! error TS2322: Type 'undefined' is not assignable to type 'number'. a4 = b.a; // ok a4 = b.a2; // ok a4 = b.a3; // ok a4 = b.a4; // ok a4 = b.a5; // ok a4 = b.a6; // ok, same number of params + ~~ +!!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x: number, y?: number | undefined) => number'. +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type 'number | undefined' is not assignable to type 'number'. +!!! error TS2322: Type 'undefined' is not assignable to type 'number'. declare var a5: (x?: number, y?: number) => number; a5 = () => 1; // ok, fewer required params a5 = (x?: number, y?: number) => 1; // ok, fewer required params a5 = (x: number) => 1; // ok, fewer params in lambda + ~~ +!!! error TS2322: Type '(x: number) => number' is not assignable to type '(x?: number | undefined, y?: number | undefined) => number'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'number | undefined' is not assignable to type 'number'. +!!! error TS2322: Type 'undefined' is not assignable to type 'number'. a5 = (x: number, y: number) => 1; // ok, same number of params + ~~ +!!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x?: number | undefined, y?: number | undefined) => number'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'number | undefined' is not assignable to type 'number'. +!!! error TS2322: Type 'undefined' is not assignable to type 'number'. a5 = b.a; // ok a5 = b.a2; // ok a5 = b.a3; // ok, fewer params in b.a3 + ~~ +!!! error TS2322: Type '(x: number) => number' is not assignable to type '(x?: number | undefined, y?: number | undefined) => number'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'number | undefined' is not assignable to type 'number'. +!!! error TS2322: Type 'undefined' is not assignable to type 'number'. a5 = b.a4; // ok, same number of params + ~~ +!!! error TS2322: Type '(x: number, y?: number | undefined) => number' is not assignable to type '(x?: number | undefined, y?: number | undefined) => number'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'number | undefined' is not assignable to type 'number'. +!!! error TS2322: Type 'undefined' is not assignable to type 'number'. a5 = b.a5; // ok - a5 = b.a6; // ok, same number of params \ No newline at end of file + a5 = b.a6; // ok, same number of params + ~~ +!!! error TS2322: Type '(x: number, y: number) => number' is not assignable to type '(x?: number | undefined, y?: number | undefined) => number'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'number | undefined' is not assignable to type 'number'. +!!! error TS2322: Type 'undefined' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.js b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.js index c0170e2789f48..10a34808813e3 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.js @@ -72,6 +72,7 @@ declare var a5: (x?: number, y?: number) => number; a5 = b.a6; // ok, same number of params //// [assignmentCompatWithCallSignaturesWithOptionalParameters.js] +"use strict"; // call signatures in derived types must have the same or fewer optional parameters as the base type a = () => 1; // ok, same number of required params a = (x) => 1; // ok, same number of required params diff --git a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.types b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.types index fd29872450ef3..cac8f8521c920 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.types +++ b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.types @@ -11,8 +11,8 @@ interface Base { a2: (x?: number) => number; >a2 : (x?: number) => number > : ^ ^^^ ^^^^^ ->x : number -> : ^^^^^^ +>x : number | undefined +> : ^^^^^^^^^^^^^^^^^^ a3: (x: number) => number; >a3 : (x: number) => number @@ -25,16 +25,16 @@ interface Base { > : ^ ^^ ^^ ^^^ ^^^^^ >x : number > : ^^^^^^ ->y : number -> : ^^^^^^ +>y : number | undefined +> : ^^^^^^^^^^^^^^^^^^ a5: (x?: number, y?: number) => number; >a5 : (x?: number, y?: number) => number > : ^ ^^^ ^^ ^^^ ^^^^^ ->x : number -> : ^^^^^^ ->y : number -> : ^^^^^^ +>x : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>y : number | undefined +> : ^^^^^^^^^^^^^^^^^^ a6: (x: number, y: number) => number; >a6 : (x: number, y: number) => number @@ -69,8 +69,8 @@ declare var a: () => number; > : ^^^^^^ >(x?: number) => 1 : (x?: number) => number > : ^ ^^^ ^^^^^^^^^^^ ->x : number -> : ^^^^^^ +>x : number | undefined +> : ^^^^^^^^^^^^^^^^^^ >1 : 1 > : ^ @@ -161,8 +161,8 @@ declare var a: () => number; declare var a2: (x?: number) => number; >a2 : (x?: number) => number > : ^ ^^^ ^^^^^ ->x : number -> : ^^^^^^ +>x : number | undefined +> : ^^^^^^^^^^^^^^^^^^ a2 = () => 1; // ok, same number of required params >a2 = () => 1 : () => number @@ -181,8 +181,8 @@ declare var a2: (x?: number) => number; > : ^ ^^^ ^^^^^ >(x?: number) => 1 : (x?: number) => number > : ^ ^^^ ^^^^^^^^^^^ ->x : number -> : ^^^^^^ +>x : number | undefined +> : ^^^^^^^^^^^^^^^^^^ >1 : 1 > : ^ @@ -293,8 +293,8 @@ declare var a3: (x: number) => number; > : ^ ^^ ^^^^^ >(x?: number) => 1 : (x?: number) => number > : ^ ^^^ ^^^^^^^^^^^ ->x : number -> : ^^^^^^ +>x : number | undefined +> : ^^^^^^^^^^^^^^^^^^ >1 : 1 > : ^ @@ -401,8 +401,8 @@ declare var a4: (x: number, y?: number) => number; > : ^ ^^ ^^ ^^^ ^^^^^ >x : number > : ^^^^^^ ->y : number -> : ^^^^^^ +>y : number | undefined +> : ^^^^^^^^^^^^^^^^^^ a4 = () => 1; // ok, fewer required params >a4 = () => 1 : () => number @@ -421,10 +421,10 @@ declare var a4: (x: number, y?: number) => number; > : ^ ^^ ^^ ^^^ ^^^^^ >(x?: number, y?: number) => 1 : (x?: number, y?: number) => number > : ^ ^^^ ^^ ^^^ ^^^^^^^^^^^ ->x : number -> : ^^^^^^ ->y : number -> : ^^^^^^ +>x : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>y : number | undefined +> : ^^^^^^^^^^^^^^^^^^ >1 : 1 > : ^ @@ -529,10 +529,10 @@ declare var a4: (x: number, y?: number) => number; declare var a5: (x?: number, y?: number) => number; >a5 : (x?: number, y?: number) => number > : ^ ^^^ ^^ ^^^ ^^^^^ ->x : number -> : ^^^^^^ ->y : number -> : ^^^^^^ +>x : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>y : number | undefined +> : ^^^^^^^^^^^^^^^^^^ a5 = () => 1; // ok, fewer required params >a5 = () => 1 : () => number @@ -551,10 +551,10 @@ declare var a5: (x?: number, y?: number) => number; > : ^ ^^^ ^^ ^^^ ^^^^^ >(x?: number, y?: number) => 1 : (x?: number, y?: number) => number > : ^ ^^^ ^^ ^^^ ^^^^^^^^^^^ ->x : number -> : ^^^^^^ ->y : number -> : ^^^^^^ +>x : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>y : number | undefined +> : ^^^^^^^^^^^^^^^^^^ >1 : 1 > : ^ diff --git a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt index ea8eb09c6b2c8..457fae7966345 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt @@ -7,27 +7,40 @@ assignmentCompatWithCallSignaturesWithRestParameters.ts(17,5): error TS2322: Typ assignmentCompatWithCallSignaturesWithRestParameters.ts(26,5): error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number'. Types of parameters 'args' and 'z' are incompatible. Type 'number' is not assignable to type 'string'. -assignmentCompatWithCallSignaturesWithRestParameters.ts(35,5): error TS2322: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +assignmentCompatWithCallSignaturesWithRestParameters.ts(34,5): error TS2322: Type '(x: number, y: string) => number' is not assignable to type '(x: number, y?: string | undefined, ...z: number[]) => number'. Types of parameters 'y' and 'y' are incompatible. - Type 'string' is not assignable to type 'number'. -assignmentCompatWithCallSignaturesWithRestParameters.ts(36,5): error TS2322: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. + Type 'string | undefined' is not assignable to type 'string'. + Type 'undefined' is not assignable to type 'string'. +assignmentCompatWithCallSignaturesWithRestParameters.ts(35,5): error TS2322: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string | undefined, ...z: number[]) => number'. + Types of parameters 'y' and 'y' are incompatible. + Type 'string | undefined' is not assignable to type 'number | undefined'. + Type 'string' is not assignable to type 'number'. +assignmentCompatWithCallSignaturesWithRestParameters.ts(36,5): error TS2322: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string | undefined, ...z: number[]) => number'. Types of parameters 'z' and 'y' are incompatible. - Type 'string' is not assignable to type 'number'. -assignmentCompatWithCallSignaturesWithRestParameters.ts(37,5): error TS2322: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. + Type 'string | undefined' is not assignable to type 'number'. + Type 'undefined' is not assignable to type 'number'. +assignmentCompatWithCallSignaturesWithRestParameters.ts(37,5): error TS2322: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string | undefined, ...z: number[]) => number'. Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type 'string'. -assignmentCompatWithCallSignaturesWithRestParameters.ts(41,5): error TS2322: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. - Types of parameters 'y' and 'y' are incompatible. - Type 'string' is not assignable to type 'number'. -assignmentCompatWithCallSignaturesWithRestParameters.ts(43,5): error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +assignmentCompatWithCallSignaturesWithRestParameters.ts(41,5): error TS2322: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number | undefined, y?: string | undefined, ...z: number[]) => number'. Types of parameters 'y' and 'y' are incompatible. - Type 'string' is not assignable to type 'number'. -assignmentCompatWithCallSignaturesWithRestParameters.ts(45,5): error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. - Types of parameters 'args' and 'z' are incompatible. - Type 'number' is not assignable to type 'string'. + Type 'string | undefined' is not assignable to type 'number | undefined'. + Type 'string' is not assignable to type 'number'. +assignmentCompatWithCallSignaturesWithRestParameters.ts(42,5): error TS2322: Type '(x: number) => number' is not assignable to type '(x?: number | undefined, y?: string | undefined, ...z: number[]) => number'. + Types of parameters 'x' and 'x' are incompatible. + Type 'number | undefined' is not assignable to type 'number'. + Type 'undefined' is not assignable to type 'number'. +assignmentCompatWithCallSignaturesWithRestParameters.ts(43,5): error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number | undefined, y?: string | undefined, ...z: number[]) => number'. + Types of parameters 'x' and 'x' are incompatible. + Type 'number | undefined' is not assignable to type 'number'. + Type 'undefined' is not assignable to type 'number'. +assignmentCompatWithCallSignaturesWithRestParameters.ts(45,5): error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number | undefined, y?: string | undefined, ...z: number[]) => number'. + Types of parameters 'x' and 'x' are incompatible. + Type 'number | undefined' is not assignable to type 'number'. + Type 'undefined' is not assignable to type 'number'. -==== assignmentCompatWithCallSignaturesWithRestParameters.ts (9 errors) ==== +==== assignmentCompatWithCallSignaturesWithRestParameters.ts (11 errors) ==== // call signatures in derived types must have the same or fewer optional parameters as the target for assignment interface Base { @@ -74,19 +87,26 @@ assignmentCompatWithCallSignaturesWithRestParameters.ts(45,5): error TS2322: Typ a3 = (x?: number) => 1; // ok, fewer required params a3 = (x: number) => 1; // ok, same number of required params a3 = (x: number, y: string) => 1; // ok, all present params match + ~~ +!!! error TS2322: Type '(x: number, y: string) => number' is not assignable to type '(x: number, y?: string | undefined, ...z: number[]) => number'. +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type 'string | undefined' is not assignable to type 'string'. +!!! error TS2322: Type 'undefined' is not assignable to type 'string'. a3 = (x: number, y?: number, z?: number) => 1; // error ~~ -!!! error TS2322: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +!!! error TS2322: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string | undefined, ...z: number[]) => number'. !!! error TS2322: Types of parameters 'y' and 'y' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string | undefined' is not assignable to type 'number | undefined'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. a3 = (x: number, ...z: number[]) => 1; // error ~~ -!!! error TS2322: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +!!! error TS2322: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string | undefined, ...z: number[]) => number'. !!! error TS2322: Types of parameters 'z' and 'y' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string | undefined' is not assignable to type 'number'. +!!! error TS2322: Type 'undefined' is not assignable to type 'number'. a3 = (x: string, y?: string, z?: string) => 1; // error ~~ -!!! error TS2322: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +!!! error TS2322: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string | undefined, ...z: number[]) => number'. !!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. @@ -94,18 +114,26 @@ assignmentCompatWithCallSignaturesWithRestParameters.ts(45,5): error TS2322: Typ a4 = () => 1; // ok, fewer required params a4 = (x?: number, y?: number) => 1; // error, type mismatch ~~ -!!! error TS2322: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +!!! error TS2322: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number | undefined, y?: string | undefined, ...z: number[]) => number'. !!! error TS2322: Types of parameters 'y' and 'y' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type 'string | undefined' is not assignable to type 'number | undefined'. +!!! error TS2322: Type 'string' is not assignable to type 'number'. a4 = (x: number) => 1; // ok, all present params match + ~~ +!!! error TS2322: Type '(x: number) => number' is not assignable to type '(x?: number | undefined, y?: string | undefined, ...z: number[]) => number'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'number | undefined' is not assignable to type 'number'. +!!! error TS2322: Type 'undefined' is not assignable to type 'number'. a4 = (x: number, y?: number) => 1; // error, second param has type mismatch ~~ -!!! error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. -!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number | undefined, y?: string | undefined, ...z: number[]) => number'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'number | undefined' is not assignable to type 'number'. +!!! error TS2322: Type 'undefined' is not assignable to type 'number'. a4 = (x?: number, y?: string) => 1; // ok, same number of required params with matching types a4 = (x: number, ...args: string[]) => 1; // error, rest params have type mismatch ~~ -!!! error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. -!!! error TS2322: Types of parameters 'args' and 'z' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file +!!! error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number | undefined, y?: string | undefined, ...z: number[]) => number'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'number | undefined' is not assignable to type 'number'. +!!! error TS2322: Type 'undefined' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.js b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.js index cfd3135696c11..ce26d6f45e57a 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.js @@ -48,6 +48,7 @@ var a4: (x?: number, y?: string, ...z: number[]) => number; a4 = (x: number, ...args: string[]) => 1; // error, rest params have type mismatch //// [assignmentCompatWithCallSignaturesWithRestParameters.js] +"use strict"; // call signatures in derived types must have the same or fewer optional parameters as the target for assignment var a; // ok, same number of required params a = () => 1; // ok, same number of required params diff --git a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.types b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.types index 8dcf803b0f347..6d9572b970775 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.types +++ b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.types @@ -23,18 +23,18 @@ interface Base { > : ^ ^^ ^^ ^^^ ^^^^^ ^^ ^^^^^ >x : number > : ^^^^^^ ->y : string -> : ^^^^^^ +>y : string | undefined +> : ^^^^^^^^^^^^^^^^^^ >z : number[] > : ^^^^^^^^ a4: (x?: number, y?: string, ...z: number[]) => number; >a4 : (x?: number, y?: string, ...z: number[]) => number > : ^ ^^^ ^^ ^^^ ^^^^^ ^^ ^^^^^ ->x : number -> : ^^^^^^ ->y : string -> : ^^^^^^ +>x : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>y : string | undefined +> : ^^^^^^^^^^^^^^^^^^ >z : number[] > : ^^^^^^^^ } @@ -86,8 +86,8 @@ var a: (...args: number[]) => number; // ok, same number of required params > : ^^^^ ^^ ^^^^^ >(x?: number) => 1 : (x?: number) => number > : ^ ^^^ ^^^^^^^^^^^ ->x : number -> : ^^^^^^ +>x : number | undefined +> : ^^^^^^^^^^^^^^^^^^ >1 : 1 > : ^ @@ -98,12 +98,12 @@ var a: (...args: number[]) => number; // ok, same number of required params > : ^^^^ ^^ ^^^^^ >(x?: number, y?: number, z?: number) => 1 : (x?: number, y?: number, z?: number) => number > : ^ ^^^ ^^ ^^^ ^^ ^^^ ^^^^^^^^^^^ ->x : number -> : ^^^^^^ ->y : number -> : ^^^^^^ ->z : number -> : ^^^^^^ +>x : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>y : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>z : number | undefined +> : ^^^^^^^^^^^^^^^^^^ >1 : 1 > : ^ @@ -126,8 +126,8 @@ var a: (...args: number[]) => number; // ok, same number of required params > : ^^^^ ^^ ^^^^^ >(x?: string) => 1 : (x?: string) => number > : ^ ^^^ ^^^^^^^^^^^ ->x : string -> : ^^^^^^ +>x : string | undefined +> : ^^^^^^^^^^^^^^^^^^ >1 : 1 > : ^ @@ -169,8 +169,8 @@ var a2: (x: number, ...z: number[]) => number; > : ^ ^^ ^^^^^ ^^ ^^^^^ >(x?: number) => 1 : (x?: number) => number > : ^ ^^^ ^^^^^^^^^^^ ->x : number -> : ^^^^^^ +>x : number | undefined +> : ^^^^^^^^^^^^^^^^^^ >1 : 1 > : ^ @@ -237,8 +237,8 @@ var a2: (x: number, ...z: number[]) => number; > : ^ ^^ ^^ ^^^ ^^^^^^^^^^^ >x : number > : ^^^^^^ ->y : number -> : ^^^^^^ +>y : number | undefined +> : ^^^^^^^^^^^^^^^^^^ >1 : 1 > : ^ @@ -247,8 +247,8 @@ var a3: (x: number, y?: string, ...z: number[]) => number; > : ^ ^^ ^^ ^^^ ^^^^^ ^^ ^^^^^ >x : number > : ^^^^^^ ->y : string -> : ^^^^^^ +>y : string | undefined +> : ^^^^^^^^^^^^^^^^^^ >z : number[] > : ^^^^^^^^ @@ -269,8 +269,8 @@ var a3: (x: number, y?: string, ...z: number[]) => number; > : ^ ^^ ^^ ^^^ ^^^^^ ^^ ^^^^^ >(x?: number) => 1 : (x?: number) => number > : ^ ^^^ ^^^^^^^^^^^ ->x : number -> : ^^^^^^ +>x : number | undefined +> : ^^^^^^^^^^^^^^^^^^ >1 : 1 > : ^ @@ -309,10 +309,10 @@ var a3: (x: number, y?: string, ...z: number[]) => number; > : ^ ^^ ^^ ^^^ ^^ ^^^ ^^^^^^^^^^^ >x : number > : ^^^^^^ ->y : number -> : ^^^^^^ ->z : number -> : ^^^^^^ +>y : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>z : number | undefined +> : ^^^^^^^^^^^^^^^^^^ >1 : 1 > : ^ @@ -339,20 +339,20 @@ var a3: (x: number, y?: string, ...z: number[]) => number; > : ^ ^^ ^^ ^^^ ^^ ^^^ ^^^^^^^^^^^ >x : string > : ^^^^^^ ->y : string -> : ^^^^^^ ->z : string -> : ^^^^^^ +>y : string | undefined +> : ^^^^^^^^^^^^^^^^^^ +>z : string | undefined +> : ^^^^^^^^^^^^^^^^^^ >1 : 1 > : ^ var a4: (x?: number, y?: string, ...z: number[]) => number; >a4 : (x?: number, y?: string, ...z: number[]) => number > : ^ ^^^ ^^ ^^^ ^^^^^ ^^ ^^^^^ ->x : number -> : ^^^^^^ ->y : string -> : ^^^^^^ +>x : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>y : string | undefined +> : ^^^^^^^^^^^^^^^^^^ >z : number[] > : ^^^^^^^^ @@ -373,10 +373,10 @@ var a4: (x?: number, y?: string, ...z: number[]) => number; > : ^ ^^^ ^^ ^^^ ^^^^^ ^^ ^^^^^ >(x?: number, y?: number) => 1 : (x?: number, y?: number) => number > : ^ ^^^ ^^ ^^^ ^^^^^^^^^^^ ->x : number -> : ^^^^^^ ->y : number -> : ^^^^^^ +>x : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>y : number | undefined +> : ^^^^^^^^^^^^^^^^^^ >1 : 1 > : ^ @@ -401,8 +401,8 @@ var a4: (x?: number, y?: string, ...z: number[]) => number; > : ^ ^^ ^^ ^^^ ^^^^^^^^^^^ >x : number > : ^^^^^^ ->y : number -> : ^^^^^^ +>y : number | undefined +> : ^^^^^^^^^^^^^^^^^^ >1 : 1 > : ^ @@ -413,10 +413,10 @@ var a4: (x?: number, y?: string, ...z: number[]) => number; > : ^ ^^^ ^^ ^^^ ^^^^^ ^^ ^^^^^ >(x?: number, y?: string) => 1 : (x?: number, y?: string) => number > : ^ ^^^ ^^ ^^^ ^^^^^^^^^^^ ->x : number -> : ^^^^^^ ->y : string -> : ^^^^^^ +>x : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>y : string | undefined +> : ^^^^^^^^^^^^^^^^^^ >1 : 1 > : ^ diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures.js index 678f1ed9d1ca6..fbdfc617232c2 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures.js @@ -39,6 +39,7 @@ a = function (x: string) { return ''; } //// [assignmentCompatWithConstructSignatures.js] +"use strict"; // void returning call signatures can be assigned a non-void returning call signature that otherwise matches t = a; a = t; diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures2.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures2.js index dc3e4f903c766..d80bcd5d84a56 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures2.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures2.js @@ -45,6 +45,7 @@ a = function (x: string) { return ''; } //// [assignmentCompatWithConstructSignatures2.js] +"use strict"; // void returning call signatures can be assigned a non-void returning call signature that otherwise matches t = a; a = t; diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures3.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignatures3.errors.txt index 6155cd83cf730..46b8a06956c8e 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures3.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures3.errors.txt @@ -1,3 +1,7 @@ +assignmentCompatWithConstructSignatures3.ts(3,14): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. +assignmentCompatWithConstructSignatures3.ts(4,30): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. +assignmentCompatWithConstructSignatures3.ts(5,34): error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. +assignmentCompatWithConstructSignatures3.ts(6,35): error TS2564: Property 'bing' has no initializer and is not definitely assigned in the constructor. assignmentCompatWithConstructSignatures3.ts(47,1): error TS2322: Type 'new (x: number) => number[]' is not assignable to type 'new (x: T) => T[]'. Types of parameters 'x' and 'x' are incompatible. Type 'T' is not assignable to type 'number'. @@ -62,13 +66,21 @@ assignmentCompatWithConstructSignatures3.ts(86,1): error TS2322: Type 'new (x: { Type 'T' is not assignable to type 'string'. -==== assignmentCompatWithConstructSignatures3.ts (15 errors) ==== +==== assignmentCompatWithConstructSignatures3.ts (19 errors) ==== // checking assignment compatibility relations for function types. All of these are valid. class Base { foo: string; } + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. class Derived extends Base { bar: string; } + ~~~ +!!! error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. class Derived2 extends Derived { baz: string; } + ~~~ +!!! error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. class OtherDerived extends Base { bing: string; } + ~~~~ +!!! error TS2564: Property 'bing' has no initializer and is not definitely assigned in the constructor. declare var a: new (x: number) => number[]; declare var a2: new (x: number) => string[]; diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js index c9c3b4f0efaff..f4c6e67c792ae 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js @@ -102,6 +102,7 @@ b18 = a18; // ok //// [assignmentCompatWithConstructSignatures3.js] +"use strict"; // checking assignment compatibility relations for function types. All of these are valid. class Base { } diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt index ed38e53db46ea..e554f01bb3a7e 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt @@ -1,3 +1,7 @@ +assignmentCompatWithConstructSignatures4.ts(4,18): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. +assignmentCompatWithConstructSignatures4.ts(5,34): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. +assignmentCompatWithConstructSignatures4.ts(6,38): error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. +assignmentCompatWithConstructSignatures4.ts(7,39): error TS2564: Property 'bing' has no initializer and is not definitely assigned in the constructor. assignmentCompatWithConstructSignatures4.ts(45,9): error TS2322: Type 'new (x: number) => string[]' is not assignable to type 'new (x: T) => U[]'. Types of parameters 'x' and 'x' are incompatible. Type 'T' is not assignable to type 'number'. @@ -17,15 +21,22 @@ assignmentCompatWithConstructSignatures4.ts(53,9): error TS2322: Type 'new (x: ( Types of parameters 'arg' and 'arg' are incompatible. Type 'Base' is not assignable to type 'T'. 'Base' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Base'. +assignmentCompatWithConstructSignatures4.ts(57,9): error TS2322: Type 'new (...x: T[]) => T' is not assignable to type 'new (...x: Base[]) => Base'. + Types of parameters 'x' and 'x' are incompatible. + Property 'bar' is missing in type 'Base' but required in type 'Derived'. assignmentCompatWithConstructSignatures4.ts(58,9): error TS2322: Type 'new (...x: Base[]) => Base' is not assignable to type 'new (...x: T[]) => T'. Type 'Base' is not assignable to type 'T'. 'T' could be instantiated with an arbitrary type which could be unrelated to 'Base'. +assignmentCompatWithConstructSignatures4.ts(61,9): error TS2322: Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base'. + Types of parameters 'x' and 'x' are incompatible. + Property 'bar' is missing in type '{ foo: string; }' but required in type 'Derived'. assignmentCompatWithConstructSignatures4.ts(62,9): error TS2322: Type 'new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base' is not assignable to type 'new (x: T, y: T) => T'. Type 'Base' is not assignable to type 'T'. 'T' could be instantiated with an arbitrary type which could be unrelated to 'Base'. assignmentCompatWithConstructSignatures4.ts(66,9): error TS2322: Type 'new (x: Base[], y: Derived2[]) => Derived[]' is not assignable to type 'new >(x: Base[], y: Base[]) => T'. - Type 'Derived[]' is not assignable to type 'T'. - 'T' could be instantiated with an arbitrary type which could be unrelated to 'Derived[]'. + Types of parameters 'y' and 'y' are incompatible. + Type 'Base[]' is not assignable to type 'Derived2[]'. + Type 'Base' is missing the following properties from type 'Derived2': baz, bar assignmentCompatWithConstructSignatures4.ts(69,9): error TS2322: Type 'new (x: { a: T; b: T; }) => T' is not assignable to type 'new (x: { a: string; b: number; }) => number'. Types of parameters 'x' and 'x' are incompatible. Type '{ a: string; b: number; }' is not assignable to type '{ a: string; b: string; }'. @@ -47,13 +58,13 @@ assignmentCompatWithConstructSignatures4.ts(74,9): error TS2322: Type 'new (x: { Types of property 'a' are incompatible. Type 'T' is not assignable to type 'string'. Type 'Base' is not assignable to type 'string'. -assignmentCompatWithConstructSignatures4.ts(77,9): error TS2322: Type 'new (x: (a: T) => T) => T[]' is not assignable to type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }'. +assignmentCompatWithConstructSignatures4.ts(77,9): error TS2322: Type 'new (x: (a: T) => T) => T[]' is not assignable to type '{ new (x: { new (a: number): number; new (a?: number | undefined): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean | undefined): boolean; }): boolean[]; }'. Types of parameters 'x' and 'x' are incompatible. - Type '{ new (a: number): number; new (a?: number): number; }' is not assignable to type '(a: any) => any'. - Type '{ new (a: number): number; new (a?: number): number; }' provides no match for the signature '(a: any): any'. -assignmentCompatWithConstructSignatures4.ts(78,9): error TS2322: Type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }' is not assignable to type 'new (x: (a: T) => T) => T[]'. + Type '{ new (a: number): number; new (a?: number | undefined): number; }' is not assignable to type '(a: any) => any'. + Type '{ new (a: number): number; new (a?: number | undefined): number; }' provides no match for the signature '(a: any): any'. +assignmentCompatWithConstructSignatures4.ts(78,9): error TS2322: Type '{ new (x: { new (a: number): number; new (a?: number | undefined): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean | undefined): boolean; }): boolean[]; }' is not assignable to type 'new (x: (a: T) => T) => T[]'. Types of parameters 'x' and 'x' are incompatible. - Type '(a: any) => any' is not assignable to type '{ new (a: number): number; new (a?: number): number; }'. + Type '(a: any) => any' is not assignable to type '{ new (a: number): number; new (a?: number | undefined): number; }'. Type '(a: any) => any' provides no match for the signature 'new (a: number): number'. assignmentCompatWithConstructSignatures4.ts(81,9): error TS2322: Type 'new (x: (a: T) => T) => any[]' is not assignable to type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }'. Types of parameters 'x' and 'x' are incompatible. @@ -79,14 +90,22 @@ assignmentCompatWithConstructSignatures4.ts(96,9): error TS2322: Type 'new (x 'T' could be instantiated with an arbitrary type which could be unrelated to 'string'. -==== assignmentCompatWithConstructSignatures4.ts (19 errors) ==== +==== assignmentCompatWithConstructSignatures4.ts (25 errors) ==== // checking assignment compatibility relations for function types. namespace Errors { class Base { foo: string; } + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. class Derived extends Base { bar: string; } + ~~~ +!!! error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. class Derived2 extends Derived { baz: string; } + ~~~ +!!! error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. class OtherDerived extends Base { bing: string; } + ~~~~ +!!! error TS2564: Property 'bing' has no initializer and is not definitely assigned in the constructor. namespace WithNonGenericSignaturesInBaseType { // target type with non-generic call signatures @@ -161,6 +180,11 @@ assignmentCompatWithConstructSignatures4.ts(96,9): error TS2322: Type 'new (x declare var b10: new (...x: T[]) => T; a10 = b10; // ok + ~~~ +!!! error TS2322: Type 'new (...x: T[]) => T' is not assignable to type 'new (...x: Base[]) => Base'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Property 'bar' is missing in type 'Base' but required in type 'Derived'. +!!! related TS2728 assignmentCompatWithConstructSignatures4.ts:5:34: 'bar' is declared here. b10 = a10; // ok ~~~ !!! error TS2322: Type 'new (...x: Base[]) => Base' is not assignable to type 'new (...x: T[]) => T'. @@ -169,6 +193,11 @@ assignmentCompatWithConstructSignatures4.ts(96,9): error TS2322: Type 'new (x declare var b11: new (x: T, y: T) => T; a11 = b11; // ok + ~~~ +!!! error TS2322: Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Property 'bar' is missing in type '{ foo: string; }' but required in type 'Derived'. +!!! related TS2728 assignmentCompatWithConstructSignatures4.ts:5:34: 'bar' is declared here. b11 = a11; // ok ~~~ !!! error TS2322: Type 'new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base' is not assignable to type 'new (x: T, y: T) => T'. @@ -180,8 +209,9 @@ assignmentCompatWithConstructSignatures4.ts(96,9): error TS2322: Type 'new (x b12 = a12; // ok ~~~ !!! error TS2322: Type 'new (x: Base[], y: Derived2[]) => Derived[]' is not assignable to type 'new >(x: Base[], y: Base[]) => T'. -!!! error TS2322: Type 'Derived[]' is not assignable to type 'T'. -!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Derived[]'. +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type 'Base[]' is not assignable to type 'Derived2[]'. +!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': baz, bar declare var b15: new (x: { a: T; b: T }) => T; a15 = b15; // ok @@ -220,15 +250,15 @@ assignmentCompatWithConstructSignatures4.ts(96,9): error TS2322: Type 'new (x declare var b16: new (x: (a: T) => T) => T[]; a16 = b16; // error ~~~ -!!! error TS2322: Type 'new (x: (a: T) => T) => T[]' is not assignable to type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }'. +!!! error TS2322: Type 'new (x: (a: T) => T) => T[]' is not assignable to type '{ new (x: { new (a: number): number; new (a?: number | undefined): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean | undefined): boolean; }): boolean[]; }'. !!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type '{ new (a: number): number; new (a?: number): number; }' is not assignable to type '(a: any) => any'. -!!! error TS2322: Type '{ new (a: number): number; new (a?: number): number; }' provides no match for the signature '(a: any): any'. +!!! error TS2322: Type '{ new (a: number): number; new (a?: number | undefined): number; }' is not assignable to type '(a: any) => any'. +!!! error TS2322: Type '{ new (a: number): number; new (a?: number | undefined): number; }' provides no match for the signature '(a: any): any'. b16 = a16; // error ~~~ -!!! error TS2322: Type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }' is not assignable to type 'new (x: (a: T) => T) => T[]'. +!!! error TS2322: Type '{ new (x: { new (a: number): number; new (a?: number | undefined): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean | undefined): boolean; }): boolean[]; }' is not assignable to type 'new (x: (a: T) => T) => T[]'. !!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type '(a: any) => any' is not assignable to type '{ new (a: number): number; new (a?: number): number; }'. +!!! error TS2322: Type '(a: any) => any' is not assignable to type '{ new (a: number): number; new (a?: number | undefined): number; }'. !!! error TS2322: Type '(a: any) => any' provides no match for the signature 'new (a: number): number'. declare var b17: new (x: (a: T) => T) => any[]; diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.js index e17d36e46a057..993f7300d11e5 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.js @@ -101,6 +101,7 @@ namespace Errors { } //// [assignmentCompatWithConstructSignatures4.js] +"use strict"; // checking assignment compatibility relations for function types. var Errors; (function (Errors) { diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.types b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.types index 8351243da4be8..09cccdacb56d6 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.types +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.types @@ -136,8 +136,8 @@ namespace Errors { > : ^^^^^^ new (a?: number): number; ->a : number -> : ^^^^^^ +>a : number | undefined +> : ^^^^^^^^^^^^^^^^^^ }): number[]; new (x: { @@ -149,8 +149,8 @@ namespace Errors { > : ^^^^^^^ new (a?: boolean): boolean; ->a : boolean -> : ^^^^^^^ +>a : boolean | undefined +> : ^^^^^^^^^^^^^^^^^^^ }): boolean[]; }; diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures5.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignatures5.errors.txt index af7665124c159..4766f4250f068 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures5.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures5.errors.txt @@ -1,3 +1,7 @@ +assignmentCompatWithConstructSignatures5.ts(3,14): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. +assignmentCompatWithConstructSignatures5.ts(4,30): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. +assignmentCompatWithConstructSignatures5.ts(5,34): error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. +assignmentCompatWithConstructSignatures5.ts(6,35): error TS2564: Property 'bing' has no initializer and is not definitely assigned in the constructor. assignmentCompatWithConstructSignatures5.ts(40,1): error TS2322: Type 'new (x: T) => void' is not assignable to type 'new (x: T) => T'. Type 'void' is not assignable to type 'T'. 'T' could be instantiated with an arbitrary type which could be unrelated to 'void'. @@ -20,13 +24,21 @@ assignmentCompatWithConstructSignatures5.ts(58,1): error TS2322: Type 'new (x: T) => T[]; declare var a2: new (x: T) => string[]; diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures5.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures5.js index cfe57b5c866bc..ecb1e6457eead 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures5.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures5.js @@ -68,6 +68,7 @@ b18 = a18; // ok //// [assignmentCompatWithConstructSignatures5.js] +"use strict"; // checking assignment compat for function types. All valid class Base { } diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures6.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignatures6.errors.txt index 15c7c64f04863..f6b5601cb7038 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures6.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures6.errors.txt @@ -1,3 +1,7 @@ +assignmentCompatWithConstructSignatures6.ts(3,14): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. +assignmentCompatWithConstructSignatures6.ts(4,30): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. +assignmentCompatWithConstructSignatures6.ts(5,34): error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. +assignmentCompatWithConstructSignatures6.ts(6,35): error TS2564: Property 'bing' has no initializer and is not definitely assigned in the constructor. assignmentCompatWithConstructSignatures6.ts(30,1): error TS2322: Type 'new (x: T) => void' is not assignable to type 'new (x: T) => T'. Type 'void' is not assignable to type 'T'. 'T' could be instantiated with an arbitrary type which could be unrelated to 'void'. @@ -14,13 +18,21 @@ assignmentCompatWithConstructSignatures6.ts(42,1): error TS2322: Type 'new (x: T) => T[]; diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures6.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures6.js index 8c8ac42b8be07..e85bdc3c70c24 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures6.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures6.js @@ -45,6 +45,7 @@ x.a16 = b16; b16 = x.a16; //// [assignmentCompatWithConstructSignatures6.js] +"use strict"; // checking assignment compatibility relations for function types. All valid. class Base { } diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.errors.txt index 1ce4f49f737b9..5b20ad5ae212f 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.errors.txt @@ -1,16 +1,40 @@ assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(16,5): error TS2322: Type 'new (x: number) => number' is not assignable to type 'new () => number'. Target signature provides too few arguments. Expected 1 or more, but got 0. -assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(17,5): error TS2322: Type 'new (x: number, y?: number) => number' is not assignable to type 'new () => number'. +assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(17,5): error TS2322: Type 'new (x: number, y?: number | undefined) => number' is not assignable to type 'new () => number'. Target signature provides too few arguments. Expected 1 or more, but got 0. assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(19,5): error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new () => number'. Target signature provides too few arguments. Expected 2 or more, but got 0. -assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(27,5): error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x?: number) => number'. +assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(24,5): error TS2322: Type 'new (x: number) => number' is not assignable to type 'new (x?: number | undefined) => number'. + Types of parameters 'x' and 'x' are incompatible. + Type 'number | undefined' is not assignable to type 'number'. + Type 'undefined' is not assignable to type 'number'. +assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(25,5): error TS2322: Type 'new (x: number, y?: number | undefined) => number' is not assignable to type 'new (x?: number | undefined) => number'. + Types of parameters 'x' and 'x' are incompatible. + Type 'number | undefined' is not assignable to type 'number'. + Type 'undefined' is not assignable to type 'number'. +assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(27,5): error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x?: number | undefined) => number'. Target signature provides too few arguments. Expected 2 or more, but got 1. assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(35,5): error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number) => number'. Target signature provides too few arguments. Expected 2 or more, but got 1. +assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(43,5): error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number, y?: number | undefined) => number'. + Types of parameters 'y' and 'y' are incompatible. + Type 'number | undefined' is not assignable to type 'number'. + Type 'undefined' is not assignable to type 'number'. +assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(48,5): error TS2322: Type 'new (x: number) => number' is not assignable to type 'new (x?: number | undefined, y?: number | undefined) => number'. + Types of parameters 'x' and 'x' are incompatible. + Type 'number | undefined' is not assignable to type 'number'. + Type 'undefined' is not assignable to type 'number'. +assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(49,5): error TS2322: Type 'new (x: number, y?: number | undefined) => number' is not assignable to type 'new (x?: number | undefined, y?: number | undefined) => number'. + Types of parameters 'x' and 'x' are incompatible. + Type 'number | undefined' is not assignable to type 'number'. + Type 'undefined' is not assignable to type 'number'. +assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(51,5): error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x?: number | undefined, y?: number | undefined) => number'. + Types of parameters 'x' and 'x' are incompatible. + Type 'number | undefined' is not assignable to type 'number'. + Type 'undefined' is not assignable to type 'number'. -==== assignmentCompatWithConstructSignaturesWithOptionalParameters.ts (5 errors) ==== +==== assignmentCompatWithConstructSignaturesWithOptionalParameters.ts (11 errors) ==== // call signatures in derived types must have the same or fewer optional parameters as the base type interface Base { @@ -32,7 +56,7 @@ assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(35,5): error TS !!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0. a = b.a4; // error ~ -!!! error TS2322: Type 'new (x: number, y?: number) => number' is not assignable to type 'new () => number'. +!!! error TS2322: Type 'new (x: number, y?: number | undefined) => number' is not assignable to type 'new () => number'. !!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0. a = b.a5; // ok a = b.a6; // error @@ -44,11 +68,21 @@ assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(35,5): error TS a2 = b.a; // ok a2 = b.a2; // ok a2 = b.a3; // ok + ~~ +!!! error TS2322: Type 'new (x: number) => number' is not assignable to type 'new (x?: number | undefined) => number'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'number | undefined' is not assignable to type 'number'. +!!! error TS2322: Type 'undefined' is not assignable to type 'number'. a2 = b.a4; // ok + ~~ +!!! error TS2322: Type 'new (x: number, y?: number | undefined) => number' is not assignable to type 'new (x?: number | undefined) => number'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'number | undefined' is not assignable to type 'number'. +!!! error TS2322: Type 'undefined' is not assignable to type 'number'. a2 = b.a5; // ok a2 = b.a6; // error ~~ -!!! error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x?: number) => number'. +!!! error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x?: number | undefined) => number'. !!! error TS2322: Target signature provides too few arguments. Expected 2 or more, but got 1. declare var a3: new (x: number) => number; @@ -69,12 +103,32 @@ assignmentCompatWithConstructSignaturesWithOptionalParameters.ts(35,5): error TS a4 = b.a4; // ok a4 = b.a5; // ok a4 = b.a6; // ok + ~~ +!!! error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x: number, y?: number | undefined) => number'. +!!! error TS2322: Types of parameters 'y' and 'y' are incompatible. +!!! error TS2322: Type 'number | undefined' is not assignable to type 'number'. +!!! error TS2322: Type 'undefined' is not assignable to type 'number'. declare var a5: new (x?: number, y?: number) => number; a5 = b.a; // ok a5 = b.a2; // ok a5 = b.a3; // ok + ~~ +!!! error TS2322: Type 'new (x: number) => number' is not assignable to type 'new (x?: number | undefined, y?: number | undefined) => number'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'number | undefined' is not assignable to type 'number'. +!!! error TS2322: Type 'undefined' is not assignable to type 'number'. a5 = b.a4; // ok + ~~ +!!! error TS2322: Type 'new (x: number, y?: number | undefined) => number' is not assignable to type 'new (x?: number | undefined, y?: number | undefined) => number'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'number | undefined' is not assignable to type 'number'. +!!! error TS2322: Type 'undefined' is not assignable to type 'number'. a5 = b.a5; // ok a5 = b.a6; // ok + ~~ +!!! error TS2322: Type 'new (x: number, y: number) => number' is not assignable to type 'new (x?: number | undefined, y?: number | undefined) => number'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'number | undefined' is not assignable to type 'number'. +!!! error TS2322: Type 'undefined' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.js b/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.js index c5c90eb13e1f4..457ec7a820737 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.js @@ -55,6 +55,7 @@ declare var a5: new (x?: number, y?: number) => number; //// [assignmentCompatWithConstructSignaturesWithOptionalParameters.js] +"use strict"; // call signatures in derived types must have the same or fewer optional parameters as the base type a = b.a; // ok a = b.a2; // ok diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.types b/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.types index 3db3af3d51d63..f145ff3be8205 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.types +++ b/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.types @@ -11,8 +11,8 @@ interface Base { a2: new (x?: number) => number; >a2 : new (x?: number) => number > : ^^^^^ ^^^ ^^^^^ ->x : number -> : ^^^^^^ +>x : number | undefined +> : ^^^^^^^^^^^^^^^^^^ a3: new (x: number) => number; >a3 : new (x: number) => number @@ -25,16 +25,16 @@ interface Base { > : ^^^^^ ^^ ^^ ^^^ ^^^^^ >x : number > : ^^^^^^ ->y : number -> : ^^^^^^ +>y : number | undefined +> : ^^^^^^^^^^^^^^^^^^ a5: new (x?: number, y?: number) => number; >a5 : new (x?: number, y?: number) => number > : ^^^^^ ^^^ ^^ ^^^ ^^^^^ ->x : number -> : ^^^^^^ ->y : number -> : ^^^^^^ +>x : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>y : number | undefined +> : ^^^^^^^^^^^^^^^^^^ a6: new (x: number, y: number) => number; >a6 : new (x: number, y: number) => number @@ -127,8 +127,8 @@ declare var a: new () => number; declare var a2: new (x?: number) => number; >a2 : new (x?: number) => number > : ^^^^^ ^^^ ^^^^^ ->x : number -> : ^^^^^^ +>x : number | undefined +> : ^^^^^^^^^^^^^^^^^^ a2 = b.a; // ok >a2 = b.a : new () => number @@ -285,8 +285,8 @@ declare var a4: new (x: number, y?: number) => number; > : ^^^^^ ^^ ^^ ^^^ ^^^^^ >x : number > : ^^^^^^ ->y : number -> : ^^^^^^ +>y : number | undefined +> : ^^^^^^^^^^^^^^^^^^ a4 = b.a; // ok >a4 = b.a : new () => number @@ -363,10 +363,10 @@ declare var a4: new (x: number, y?: number) => number; declare var a5: new (x?: number, y?: number) => number; >a5 : new (x?: number, y?: number) => number > : ^^^^^ ^^^ ^^ ^^^ ^^^^^ ->x : number -> : ^^^^^^ ->y : number -> : ^^^^^^ +>x : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>y : number | undefined +> : ^^^^^^^^^^^^^^^^^^ a5 = b.a; // ok >a5 = b.a : new () => number diff --git a/tests/baselines/reference/assignmentCompatWithDiscriminatedUnion.errors.txt b/tests/baselines/reference/assignmentCompatWithDiscriminatedUnion.errors.txt index d843b963b6239..b67f5cdea64a4 100644 --- a/tests/baselines/reference/assignmentCompatWithDiscriminatedUnion.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithDiscriminatedUnion.errors.txt @@ -11,9 +11,10 @@ assignmentCompatWithDiscriminatedUnion.ts(82,5): error TS2322: Type 'S' is not a Types of property 'c' are incompatible. Type 'N' is not assignable to type '2'. Type '0' is not assignable to type '2'. +assignmentCompatWithDiscriminatedUnion.ts(140,27): error TS2322: Type 'undefined' is not assignable to type '"linear" | "categorical"'. -==== assignmentCompatWithDiscriminatedUnion.ts (3 errors) ==== +==== assignmentCompatWithDiscriminatedUnion.ts (4 errors) ==== // see 'typeRelatedToDiscriminatedType' in checker.ts: // IteratorResult @@ -171,6 +172,9 @@ assignmentCompatWithDiscriminatedUnion.ts(82,5): error TS2322: Type 'S' is not a const bad: IAxis = { type: getAxisType() }; const good: IAxis = { type: undefined }; + ~~~~ +!!! error TS2322: Type 'undefined' is not assignable to type '"linear" | "categorical"'. +!!! related TS6500 assignmentCompatWithDiscriminatedUnion.ts:124:29: The expected type comes from property 'type' which is declared here on type 'IAxis' good.type = getAxisType(); } diff --git a/tests/baselines/reference/assignmentCompatWithDiscriminatedUnion.js b/tests/baselines/reference/assignmentCompatWithDiscriminatedUnion.js index 01d9214511c83..9ba5d10131b99 100644 --- a/tests/baselines/reference/assignmentCompatWithDiscriminatedUnion.js +++ b/tests/baselines/reference/assignmentCompatWithDiscriminatedUnion.js @@ -229,6 +229,7 @@ namespace GH58603 { //// [assignmentCompatWithDiscriminatedUnion.js] +"use strict"; // see 'typeRelatedToDiscriminatedType' in checker.ts: // IteratorResult var Example1; diff --git a/tests/baselines/reference/assignmentCompatWithDiscriminatedUnion.types b/tests/baselines/reference/assignmentCompatWithDiscriminatedUnion.types index 4ae1e1ae3287b..69acabde6a6b6 100644 --- a/tests/baselines/reference/assignmentCompatWithDiscriminatedUnion.types +++ b/tests/baselines/reference/assignmentCompatWithDiscriminatedUnion.types @@ -425,8 +425,8 @@ namespace GH30170 { } interface Yellow { color?: 'yellow', ->color : "yellow" -> : ^^^^^^^^ +>color : "yellow" | undefined +> : ^^^^^^^^^^^^^^^^^^^^ } function draw(val: Blue | Yellow) { } >draw : (val: Blue | Yellow) => void @@ -437,20 +437,20 @@ namespace GH30170 { function drawWithColor(currentColor: 'blue' | 'yellow' | undefined) { >drawWithColor : (currentColor: "blue" | "yellow" | undefined) => void > : ^ ^^ ^^^^^^^^^ ->currentColor : "blue" | "yellow" -> : ^^^^^^^^^^^^^^^^^ +>currentColor : "blue" | "yellow" | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ return draw({ color: currentColor }); >draw({ color: currentColor }) : void > : ^^^^ >draw : (val: Blue | Yellow) => void > : ^ ^^ ^^^^^^^^^ ->{ color: currentColor } : { color: "blue" | "yellow"; } -> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->color : "blue" | "yellow" -> : ^^^^^^^^^^^^^^^^^ ->currentColor : "blue" | "yellow" -> : ^^^^^^^^^^^^^^^^^ +>{ color: currentColor } : { color: "blue" | "yellow" | undefined; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>color : "blue" | "yellow" | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>currentColor : "blue" | "yellow" | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ } } @@ -747,8 +747,8 @@ namespace GH58603 { > : ^^^^^^^^ >MyEnum : any > : ^^^ ->id : number -> : ^^^^^^ +>id : number | undefined +> : ^^^^^^^^^^^^^^^^^^ type TypeB = { kind: MyEnum.B } & ({ id?: undefined } | { id: number }); >TypeB : TypeB @@ -777,20 +777,20 @@ namespace GH58603 { > : ^ ^^ ^^ ^^^ ^^^^^ >kind : MyEnum > : ^^^^^^ ->id : number -> : ^^^^^^ +>id : number | undefined +> : ^^^^^^^^^^^^^^^^^^ something({ kind, id }); >something({ kind, id }) : void > : ^^^^ >something : (a: MyType) => void > : ^ ^^ ^^^^^ ->{ kind, id } : { kind: MyEnum; id: number; } -> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ kind, id } : { kind: MyEnum; id: number | undefined; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >kind : MyEnum > : ^^^^^^ ->id : number -> : ^^^^^^ +>id : number | undefined +> : ^^^^^^^^^^^^^^^^^^ } type Foo = { kind: "a" | "b", value: number } | { kind: "a", value: undefined } | { kind: "b", value: undefined }; @@ -816,8 +816,8 @@ namespace GH58603 { > : ^^^^^^^^ ^^^^^^^^^ ^^^ >kind : "a" | "b" > : ^^^^^^^^^ ->value : number -> : ^^^^^^ +>value : number | undefined +> : ^^^^^^^^^^^^^^^^^^ let x1: Foo = obj; >x1 : Foo @@ -828,8 +828,8 @@ namespace GH58603 { let x2: Foo = { kind: obj.kind, value: obj.value }; >x2 : Foo > : ^^^ ->{ kind: obj.kind, value: obj.value } : { kind: "a" | "b"; value: number; } -> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ kind: obj.kind, value: obj.value } : { kind: "a" | "b"; value: number | undefined; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >kind : "a" | "b" > : ^^^^^^^^^ >obj.kind : "a" | "b" @@ -838,14 +838,14 @@ namespace GH58603 { > : ^^^^^^^^ ^^^^^^^^^ ^^^ >kind : "a" | "b" > : ^^^^^^^^^ ->value : number -> : ^^^^^^ ->obj.value : number -> : ^^^^^^ +>value : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>obj.value : number | undefined +> : ^^^^^^^^^^^^^^^^^^ >obj : { kind: "a" | "b"; value: number | undefined; } > : ^^^^^^^^ ^^^^^^^^^ ^^^ ->value : number -> : ^^^^^^ +>value : number | undefined +> : ^^^^^^^^^^^^^^^^^^ } } diff --git a/tests/baselines/reference/assignmentCompatWithEnumIndexer.js b/tests/baselines/reference/assignmentCompatWithEnumIndexer.js index eeb071a8ef494..3ce61676707a1 100644 --- a/tests/baselines/reference/assignmentCompatWithEnumIndexer.js +++ b/tests/baselines/reference/assignmentCompatWithEnumIndexer.js @@ -9,6 +9,7 @@ let foo: Record = {} //// [assignmentCompatWithEnumIndexer.js] +"use strict"; var E; (function (E) { E[E["A"] = 0] = "A"; diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignatures.errors.txt b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures.errors.txt new file mode 100644 index 0000000000000..a1e760b08c535 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures.errors.txt @@ -0,0 +1,13 @@ +assignmentCompatWithGenericCallSignatures.ts(6,5): error TS2454: Variable 'g' is used before being assigned. + + +==== assignmentCompatWithGenericCallSignatures.ts (1 errors) ==== + // some complex cases of assignment compat of generic signatures that stress contextual signature instantiation + + var f: (x: S) => void + var g: (x: T[]) => void + + f = g; // ok + ~ +!!! error TS2454: Variable 'g' is used before being assigned. + g = f; // ok \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignatures.js b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures.js index 20a588e20ae48..7633d4aa2ec12 100644 --- a/tests/baselines/reference/assignmentCompatWithGenericCallSignatures.js +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures.js @@ -10,6 +10,7 @@ f = g; // ok g = f; // ok //// [assignmentCompatWithGenericCallSignatures.js] +"use strict"; // some complex cases of assignment compat of generic signatures that stress contextual signature instantiation var f; var g; diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignatures2.js b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures2.js index d4481339ebd19..2eacaa0e59ac1 100644 --- a/tests/baselines/reference/assignmentCompatWithGenericCallSignatures2.js +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures2.js @@ -20,6 +20,7 @@ b = a; //// [assignmentCompatWithGenericCallSignatures2.js] +"use strict"; // some complex cases of assignment compat of generic signatures. No contextual signature instantiation // Both errors a = b; diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignatures3.errors.txt b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures3.errors.txt new file mode 100644 index 0000000000000..c49d121bf81a0 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures3.errors.txt @@ -0,0 +1,16 @@ +assignmentCompatWithGenericCallSignatures3.ts(10,5): error TS2454: Variable 'h' is used before being assigned. + + +==== assignmentCompatWithGenericCallSignatures3.ts (1 errors) ==== + // some complex cases of assignment compat of generic signatures that stress contextual signature instantiation + + interface I { + (f: (x: T) => (y: S) => U): U + } + + var g: (x: T) => (y: S) => I + var h: (x: T) => (y: S) => { (f: (x: T) => (y: S) => U): U } + + g = h // ok + ~ +!!! error TS2454: Variable 'h' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignatures3.js b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures3.js index 5f396a569edcf..cf8275d96885f 100644 --- a/tests/baselines/reference/assignmentCompatWithGenericCallSignatures3.js +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures3.js @@ -13,6 +13,7 @@ var h: (x: T) => (y: S) => { (f: (x: T) => (y: S) => U): U } g = h // ok //// [assignmentCompatWithGenericCallSignatures3.js] +"use strict"; // some complex cases of assignment compat of generic signatures that stress contextual signature instantiation var g; var h; diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignatures4.js b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures4.js index f93dbf528e3fe..119f282954c59 100644 --- a/tests/baselines/reference/assignmentCompatWithGenericCallSignatures4.js +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures4.js @@ -16,6 +16,7 @@ y = x //// [assignmentCompatWithGenericCallSignatures4.js] +"use strict"; // some complex cases of assignment compat of generic signatures. // These both do not make sense as we would eventually be comparing I2 to I2>, and they are self referencing anyway x = y; diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.js b/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.js index 942fe3967283e..89538fb4bd440 100644 --- a/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.js +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.js @@ -133,6 +133,7 @@ namespace GenericSignaturesValid { } //// [assignmentCompatWithGenericCallSignaturesWithOptionalParameters.js] +"use strict"; // call signatures in derived types must have the same or fewer optional parameters as the target for assignment var ClassTypeParam; (function (ClassTypeParam) { diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer.js b/tests/baselines/reference/assignmentCompatWithNumericIndexer.js index f7852ecaf58ab..c9b793644eae6 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer.js +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer.js @@ -46,6 +46,7 @@ namespace Generics { } //// [assignmentCompatWithNumericIndexer.js] +"use strict"; // Derived type indexer must be subtype of base type indexer class A { } diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer2.js b/tests/baselines/reference/assignmentCompatWithNumericIndexer2.js index 1e15c05187860..3d7aef7fda755 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer2.js +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer2.js @@ -46,6 +46,7 @@ namespace Generics { } //// [assignmentCompatWithNumericIndexer2.js] +"use strict"; // Derived type indexer must be subtype of base type indexer a = b; b = a; // error diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer3.js b/tests/baselines/reference/assignmentCompatWithNumericIndexer3.js index 1b901a2e9aaea..4d2eb4df455ef 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer3.js +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer3.js @@ -43,6 +43,7 @@ namespace Generics { } //// [assignmentCompatWithNumericIndexer3.js] +"use strict"; // Derived type indexer must be subtype of base type indexer class A { } diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers.js b/tests/baselines/reference/assignmentCompatWithObjectMembers.js index 7b8babe05e507..764bd9569745d 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers.js @@ -88,6 +88,7 @@ namespace ObjectTypes { } //// [assignmentCompatWithObjectMembers.js] +"use strict"; // 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 var SimpleTypes; diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers2.js b/tests/baselines/reference/assignmentCompatWithObjectMembers2.js index d17a38e99c3ab..83b625e20ebc7 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers2.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers2.js @@ -45,6 +45,7 @@ a2 = t; //// [assignmentCompatWithObjectMembers2.js] +"use strict"; // 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 { diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers3.js b/tests/baselines/reference/assignmentCompatWithObjectMembers3.js index 33d5a14d979e7..091d6a4b95bce 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers3.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers3.js @@ -45,6 +45,7 @@ a2 = t; //// [assignmentCompatWithObjectMembers3.js] +"use strict"; // 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 { diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers4.js b/tests/baselines/reference/assignmentCompatWithObjectMembers4.js index 58ecfb8be5232..18623c0252d01 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers4.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers4.js @@ -94,6 +94,7 @@ namespace WithBase { } //// [assignmentCompatWithObjectMembers4.js] +"use strict"; // members N and M of types S and T have the same name, same accessibility, same optionality, and N is not assignable M var OnlyDerived; (function (OnlyDerived) { diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers5.js b/tests/baselines/reference/assignmentCompatWithObjectMembers5.js index 13e09cccd21fe..b7079600fb2b0 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers5.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers5.js @@ -17,6 +17,7 @@ c = i; // error i = c; // error //// [assignmentCompatWithObjectMembers5.js] +"use strict"; class C { } c = i; // error diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.js b/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.js index 20daaf82e1392..01cedd0d45146 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.js @@ -112,6 +112,7 @@ namespace TargetIsPublic { } //// [assignmentCompatWithObjectMembersAccessibility.js] +"use strict"; // members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M var TargetIsPublic; (function (TargetIsPublic) { diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.js b/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.js index b6a861f9f508f..986c97828525b 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.js @@ -45,6 +45,7 @@ a2 = t; //// [assignmentCompatWithObjectMembersNumericNames.js] +"use strict"; // 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 { diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js index e20f3c05b7f38..a52093fb2fa3c 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js @@ -91,6 +91,7 @@ namespace SourceHasOptional { } //// [assignmentCompatWithObjectMembersOptionality.js] +"use strict"; // Derived member is not optional but base member is, should be ok class Base { } diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js index b826539c8322a..14f466cadad0d 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js @@ -93,6 +93,7 @@ namespace SourceHasOptional { //// [assignmentCompatWithObjectMembersOptionality2.js] +"use strict"; // M is optional and S contains no property with the same name as M // N is optional and T contains no property with the same name as N class Base { diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.js b/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.js index 97a21b2192768..2ad3a8812036b 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.js @@ -88,6 +88,7 @@ namespace NumbersAndStrings { } //// [assignmentCompatWithObjectMembersStringNumericNames.js] +"use strict"; // members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M // string named numeric properties work correctly, errors below unless otherwise noted var JustStrings; diff --git a/tests/baselines/reference/assignmentCompatWithOverloads.errors.txt b/tests/baselines/reference/assignmentCompatWithOverloads.errors.txt index 79462dd40e34e..6ea777db14fd2 100644 --- a/tests/baselines/reference/assignmentCompatWithOverloads.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithOverloads.errors.txt @@ -1,3 +1,6 @@ +assignmentCompatWithOverloads.ts(1,34): error TS2322: Type 'null' is not assignable to type 'number'. +assignmentCompatWithOverloads.ts(3,34): error TS2322: Type 'null' is not assignable to type 'string'. +assignmentCompatWithOverloads.ts(5,34): error TS2322: Type 'null' is not assignable to type 'number'. assignmentCompatWithOverloads.ts(17,1): error TS2322: Type '(x: string) => string' is not assignable to type '(s1: string) => number'. Type 'string' is not assignable to type 'number'. assignmentCompatWithOverloads.ts(19,1): error TS2322: Type '(x: number) => number' is not assignable to type '(s1: string) => number'. @@ -12,12 +15,18 @@ assignmentCompatWithOverloads.ts(30,1): error TS2322: Type 'typeof C' is not ass Type 'number' is not assignable to type 'string'. -==== assignmentCompatWithOverloads.ts (4 errors) ==== +==== assignmentCompatWithOverloads.ts (7 errors) ==== function f1(x: string): number { return null; } + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'number'. function f2(x: string): string { return null; } + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'string'. function f3(x: number): number { return null; } + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'number'. function f4(x: string): string; diff --git a/tests/baselines/reference/assignmentCompatWithOverloads.js b/tests/baselines/reference/assignmentCompatWithOverloads.js index ff44cbf7002c4..da96bca851d1f 100644 --- a/tests/baselines/reference/assignmentCompatWithOverloads.js +++ b/tests/baselines/reference/assignmentCompatWithOverloads.js @@ -33,6 +33,7 @@ var d: new(x: number) => void; d = C; // Error //// [assignmentCompatWithOverloads.js] +"use strict"; function f1(x) { return null; } function f2(x) { return null; } function f3(x) { return null; } diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt b/tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt index fa5e764d17b2d..405fdd56a3b00 100644 --- a/tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt @@ -14,6 +14,7 @@ assignmentCompatWithStringIndexer.ts(46,9): error TS2322: Type '{ [x: string]: D 'string' index signatures are incompatible. Type 'Derived' is not assignable to type 'T'. 'Derived' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Base'. +assignmentCompatWithStringIndexer.ts(46,14): error TS2454: Variable 'b3' is used before being assigned. assignmentCompatWithStringIndexer.ts(47,9): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. 'string' index signatures are incompatible. Type 'T' is not assignable to type 'Derived'. @@ -22,13 +23,14 @@ assignmentCompatWithStringIndexer.ts(50,9): error TS2322: Type '{ [x: string]: D 'string' index signatures are incompatible. Type 'Derived2' is not assignable to type 'T'. 'Derived2' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Base'. +assignmentCompatWithStringIndexer.ts(50,14): error TS2454: Variable 'b4' is used before being assigned. assignmentCompatWithStringIndexer.ts(51,9): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. 'string' index signatures are incompatible. Type 'T' is not assignable to type 'Derived2'. Type 'Base' is missing the following properties from type 'Derived2': baz, bar -==== assignmentCompatWithStringIndexer.ts (8 errors) ==== +==== assignmentCompatWithStringIndexer.ts (10 errors) ==== // index signatures must be compatible in assignments interface Base { foo: string; } @@ -98,6 +100,8 @@ assignmentCompatWithStringIndexer.ts(51,9): error TS2322: Type 'A' is not ass !!! error TS2322: 'string' index signatures are incompatible. !!! error TS2322: Type 'Derived' is not assignable to type 'T'. !!! error TS2322: 'Derived' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Base'. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. b3 = a3; // error ~~ !!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. @@ -113,6 +117,8 @@ assignmentCompatWithStringIndexer.ts(51,9): error TS2322: Type 'A' is not ass !!! error TS2322: 'string' index signatures are incompatible. !!! error TS2322: Type 'Derived2' is not assignable to type 'T'. !!! error TS2322: 'Derived2' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Base'. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. b4 = a3; // error ~~ !!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer.js b/tests/baselines/reference/assignmentCompatWithStringIndexer.js index e8ea5651fa5cf..b23b51803439b 100644 --- a/tests/baselines/reference/assignmentCompatWithStringIndexer.js +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer.js @@ -57,6 +57,7 @@ namespace Generics { //// [assignmentCompatWithStringIndexer.js] +"use strict"; // index signatures must be compatible in assignments class A { } diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer2.js b/tests/baselines/reference/assignmentCompatWithStringIndexer2.js index 7f734d1629d65..89ac634f84615 100644 --- a/tests/baselines/reference/assignmentCompatWithStringIndexer2.js +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer2.js @@ -56,6 +56,7 @@ namespace Generics { } //// [assignmentCompatWithStringIndexer2.js] +"use strict"; // index signatures must be compatible in assignments a = b; // ok b = a; // error diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer3.js b/tests/baselines/reference/assignmentCompatWithStringIndexer3.js index 13940ddaa412a..0ed36af191c9f 100644 --- a/tests/baselines/reference/assignmentCompatWithStringIndexer3.js +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer3.js @@ -26,6 +26,7 @@ namespace Generics { } //// [assignmentCompatWithStringIndexer3.js] +"use strict"; // Derived type indexer must be subtype of base type indexer a = b1; // error b1 = a; // error diff --git a/tests/baselines/reference/assignmentCompatWithWithGenericConstructSignatures.js b/tests/baselines/reference/assignmentCompatWithWithGenericConstructSignatures.js index 2ebdb77c275ee..017b0f677eaf0 100644 --- a/tests/baselines/reference/assignmentCompatWithWithGenericConstructSignatures.js +++ b/tests/baselines/reference/assignmentCompatWithWithGenericConstructSignatures.js @@ -4,3 +4,4 @@ //// [assignmentCompatWithWithGenericConstructSignatures.js] +"use strict"; diff --git a/tests/baselines/reference/assignmentCompatability1.js b/tests/baselines/reference/assignmentCompatability1.js index 014b53e74c45f..4f8690c578eba 100644 --- a/tests/baselines/reference/assignmentCompatability1.js +++ b/tests/baselines/reference/assignmentCompatability1.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__aa = __test1__.__val__obj4 //// [assignmentCompatability1.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability1.types b/tests/baselines/reference/assignmentCompatability1.types index 9cb467bb8201f..4953fb9054fcd 100644 --- a/tests/baselines/reference/assignmentCompatability1.types +++ b/tests/baselines/reference/assignmentCompatability1.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability10.js b/tests/baselines/reference/assignmentCompatability10.js index 97cf7d99ae31f..47423d6cff1cc 100644 --- a/tests/baselines/reference/assignmentCompatability10.js +++ b/tests/baselines/reference/assignmentCompatability10.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__x4 = __test1__.__val__obj4 //// [assignmentCompatability10.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability10.types b/tests/baselines/reference/assignmentCompatability10.types index 4feaecef51783..7c0f57af11478 100644 --- a/tests/baselines/reference/assignmentCompatability10.types +++ b/tests/baselines/reference/assignmentCompatability10.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } @@ -34,8 +34,8 @@ namespace __test2__ { > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >x4 : classWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >new classWithPublicAndOptional(1) : classWithPublicAndOptional diff --git a/tests/baselines/reference/assignmentCompatability11.errors.txt b/tests/baselines/reference/assignmentCompatability11.errors.txt index 2b95f6692e854..2483c0a607ce7 100644 --- a/tests/baselines/reference/assignmentCompatability11.errors.txt +++ b/tests/baselines/reference/assignmentCompatability11.errors.txt @@ -1,6 +1,7 @@ assignmentCompatability11.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }'. Types of property 'two' are incompatible. - Type 'string' is not assignable to type 'number'. + Type 'string | undefined' is not assignable to type 'number'. + Type 'undefined' is not assignable to type 'number'. ==== assignmentCompatability11.ts (1 errors) ==== @@ -16,4 +17,5 @@ assignmentCompatability11.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOpt ~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }'. !!! error TS2322: Types of property 'two' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'string | undefined' is not assignable to type 'number'. +!!! error TS2322: Type 'undefined' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability11.js b/tests/baselines/reference/assignmentCompatability11.js index 82de662e634a0..37eab1e8692f6 100644 --- a/tests/baselines/reference/assignmentCompatability11.js +++ b/tests/baselines/reference/assignmentCompatability11.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__obj = __test1__.__val__obj4 //// [assignmentCompatability11.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability11.types b/tests/baselines/reference/assignmentCompatability11.types index c31dff580f78f..f198b38623242 100644 --- a/tests/baselines/reference/assignmentCompatability11.types +++ b/tests/baselines/reference/assignmentCompatability11.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability12.js b/tests/baselines/reference/assignmentCompatability12.js index be8b5d994d113..e3458b79c44e5 100644 --- a/tests/baselines/reference/assignmentCompatability12.js +++ b/tests/baselines/reference/assignmentCompatability12.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__obj = __test1__.__val__obj4 //// [assignmentCompatability12.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability12.types b/tests/baselines/reference/assignmentCompatability12.types index 7239836bd1447..239fc657299ca 100644 --- a/tests/baselines/reference/assignmentCompatability12.types +++ b/tests/baselines/reference/assignmentCompatability12.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability13.errors.txt b/tests/baselines/reference/assignmentCompatability13.errors.txt index 9d65ecfafea47..227a38e6e70a3 100644 --- a/tests/baselines/reference/assignmentCompatability13.errors.txt +++ b/tests/baselines/reference/assignmentCompatability13.errors.txt @@ -1,5 +1,7 @@ assignmentCompatability13.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }'. - Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type '{ two: string; }'. + Types of property 'two' are incompatible. + Type 'string | undefined' is not assignable to type 'string'. + Type 'undefined' is not assignable to type 'string'. ==== assignmentCompatability13.ts (1 errors) ==== @@ -14,4 +16,6 @@ assignmentCompatability13.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOpt __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }'. -!!! error TS2322: Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type '{ two: string; }'. \ No newline at end of file +!!! error TS2322: Types of property 'two' are incompatible. +!!! error TS2322: Type 'string | undefined' is not assignable to type 'string'. +!!! error TS2322: Type 'undefined' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability13.js b/tests/baselines/reference/assignmentCompatability13.js index 248d3be39bfa3..f53048040e504 100644 --- a/tests/baselines/reference/assignmentCompatability13.js +++ b/tests/baselines/reference/assignmentCompatability13.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__obj = __test1__.__val__obj4 //// [assignmentCompatability13.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability13.types b/tests/baselines/reference/assignmentCompatability13.types index 212d104782b2c..0769f7755cd9d 100644 --- a/tests/baselines/reference/assignmentCompatability13.types +++ b/tests/baselines/reference/assignmentCompatability13.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability14.js b/tests/baselines/reference/assignmentCompatability14.js index fe40338fa4613..bdbdae9f9fef3 100644 --- a/tests/baselines/reference/assignmentCompatability14.js +++ b/tests/baselines/reference/assignmentCompatability14.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__obj = __test1__.__val__obj4 //// [assignmentCompatability14.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability14.types b/tests/baselines/reference/assignmentCompatability14.types index 61db491ba3c0e..913772fe98f2d 100644 --- a/tests/baselines/reference/assignmentCompatability14.types +++ b/tests/baselines/reference/assignmentCompatability14.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability15.errors.txt b/tests/baselines/reference/assignmentCompatability15.errors.txt index c89069ea94e8d..308e01be27193 100644 --- a/tests/baselines/reference/assignmentCompatability15.errors.txt +++ b/tests/baselines/reference/assignmentCompatability15.errors.txt @@ -1,6 +1,7 @@ assignmentCompatability15.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean; }'. Types of property 'two' are incompatible. - Type 'string' is not assignable to type 'boolean'. + Type 'string | undefined' is not assignable to type 'boolean'. + Type 'undefined' is not assignable to type 'boolean'. ==== assignmentCompatability15.ts (1 errors) ==== @@ -16,4 +17,5 @@ assignmentCompatability15.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOpt ~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean; }'. !!! error TS2322: Types of property 'two' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. \ No newline at end of file +!!! error TS2322: Type 'string | undefined' is not assignable to type 'boolean'. +!!! error TS2322: Type 'undefined' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability15.js b/tests/baselines/reference/assignmentCompatability15.js index eaee07a0b8405..713b95ca672b0 100644 --- a/tests/baselines/reference/assignmentCompatability15.js +++ b/tests/baselines/reference/assignmentCompatability15.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__obj = __test1__.__val__obj4 //// [assignmentCompatability15.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability15.types b/tests/baselines/reference/assignmentCompatability15.types index 685d4aada8e78..606a0ee3dde3f 100644 --- a/tests/baselines/reference/assignmentCompatability15.types +++ b/tests/baselines/reference/assignmentCompatability15.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability16.js b/tests/baselines/reference/assignmentCompatability16.js index e6f151a8c0e20..b0851711fdcc1 100644 --- a/tests/baselines/reference/assignmentCompatability16.js +++ b/tests/baselines/reference/assignmentCompatability16.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__obj = __test1__.__val__obj4 //// [assignmentCompatability16.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability16.types b/tests/baselines/reference/assignmentCompatability16.types index 65c791abb9525..38be28e75cbdc 100644 --- a/tests/baselines/reference/assignmentCompatability16.types +++ b/tests/baselines/reference/assignmentCompatability16.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability17.errors.txt b/tests/baselines/reference/assignmentCompatability17.errors.txt index 2813e6c21a65b..3a9a884f9f59f 100644 --- a/tests/baselines/reference/assignmentCompatability17.errors.txt +++ b/tests/baselines/reference/assignmentCompatability17.errors.txt @@ -1,6 +1,7 @@ assignmentCompatability17.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: any[]; }'. Types of property 'two' are incompatible. - Type 'string' is not assignable to type 'any[]'. + Type 'string | undefined' is not assignable to type 'any[]'. + Type 'undefined' is not assignable to type 'any[]'. ==== assignmentCompatability17.ts (1 errors) ==== @@ -16,4 +17,5 @@ assignmentCompatability17.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOpt ~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: any[]; }'. !!! error TS2322: Types of property 'two' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'any[]'. \ No newline at end of file +!!! error TS2322: Type 'string | undefined' is not assignable to type 'any[]'. +!!! error TS2322: Type 'undefined' is not assignable to type 'any[]'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability17.js b/tests/baselines/reference/assignmentCompatability17.js index 4b91c72cb9972..279943af46c0f 100644 --- a/tests/baselines/reference/assignmentCompatability17.js +++ b/tests/baselines/reference/assignmentCompatability17.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__obj = __test1__.__val__obj4 //// [assignmentCompatability17.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability17.types b/tests/baselines/reference/assignmentCompatability17.types index c61b0a2bf47ea..c83d42999b766 100644 --- a/tests/baselines/reference/assignmentCompatability17.types +++ b/tests/baselines/reference/assignmentCompatability17.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability18.js b/tests/baselines/reference/assignmentCompatability18.js index 92d0d89d2101b..d3f01b7216a47 100644 --- a/tests/baselines/reference/assignmentCompatability18.js +++ b/tests/baselines/reference/assignmentCompatability18.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__obj = __test1__.__val__obj4 //// [assignmentCompatability18.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability18.types b/tests/baselines/reference/assignmentCompatability18.types index 0e2f5a97f0bd7..ea3a5e3338425 100644 --- a/tests/baselines/reference/assignmentCompatability18.types +++ b/tests/baselines/reference/assignmentCompatability18.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability19.errors.txt b/tests/baselines/reference/assignmentCompatability19.errors.txt index bf0252f855909..a717fea09f2c9 100644 --- a/tests/baselines/reference/assignmentCompatability19.errors.txt +++ b/tests/baselines/reference/assignmentCompatability19.errors.txt @@ -1,6 +1,7 @@ assignmentCompatability19.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number[]; }'. Types of property 'two' are incompatible. - Type 'string' is not assignable to type 'number[]'. + Type 'string | undefined' is not assignable to type 'number[]'. + Type 'undefined' is not assignable to type 'number[]'. ==== assignmentCompatability19.ts (1 errors) ==== @@ -16,4 +17,5 @@ assignmentCompatability19.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOpt ~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number[]; }'. !!! error TS2322: Types of property 'two' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number[]'. \ No newline at end of file +!!! error TS2322: Type 'string | undefined' is not assignable to type 'number[]'. +!!! error TS2322: Type 'undefined' is not assignable to type 'number[]'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability19.js b/tests/baselines/reference/assignmentCompatability19.js index 638c2bc22b161..db27c327a6f7f 100644 --- a/tests/baselines/reference/assignmentCompatability19.js +++ b/tests/baselines/reference/assignmentCompatability19.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__obj = __test1__.__val__obj4 //// [assignmentCompatability19.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability19.types b/tests/baselines/reference/assignmentCompatability19.types index a6d54acad985e..5ab09b75651e6 100644 --- a/tests/baselines/reference/assignmentCompatability19.types +++ b/tests/baselines/reference/assignmentCompatability19.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability2.errors.txt b/tests/baselines/reference/assignmentCompatability2.errors.txt new file mode 100644 index 0000000000000..d6372407403f3 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability2.errors.txt @@ -0,0 +1,15 @@ +assignmentCompatability2.ts(7,28): error TS2454: Variable 'aa' is used before being assigned. + + +==== assignmentCompatability2.ts (1 errors) ==== + namespace __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + namespace __test2__ { + export var aa:{};; + export var __val__aa = aa; + ~~ +!!! error TS2454: Variable 'aa' is used before being assigned. + } + __test2__.__val__aa = __test1__.__val__obj4 \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability2.js b/tests/baselines/reference/assignmentCompatability2.js index 5b92dfb77d358..f1eb02f815c9d 100644 --- a/tests/baselines/reference/assignmentCompatability2.js +++ b/tests/baselines/reference/assignmentCompatability2.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__aa = __test1__.__val__obj4 //// [assignmentCompatability2.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability2.types b/tests/baselines/reference/assignmentCompatability2.types index 2fd841a73d30b..948aecbde53da 100644 --- a/tests/baselines/reference/assignmentCompatability2.types +++ b/tests/baselines/reference/assignmentCompatability2.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability20.js b/tests/baselines/reference/assignmentCompatability20.js index e5743ce43c336..d0011d2e81b30 100644 --- a/tests/baselines/reference/assignmentCompatability20.js +++ b/tests/baselines/reference/assignmentCompatability20.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__obj = __test1__.__val__obj4 //// [assignmentCompatability20.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability20.types b/tests/baselines/reference/assignmentCompatability20.types index 3228c05f7c191..8e62b2626ebf4 100644 --- a/tests/baselines/reference/assignmentCompatability20.types +++ b/tests/baselines/reference/assignmentCompatability20.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability21.errors.txt b/tests/baselines/reference/assignmentCompatability21.errors.txt index d11e65b94c989..9182c142a32c6 100644 --- a/tests/baselines/reference/assignmentCompatability21.errors.txt +++ b/tests/baselines/reference/assignmentCompatability21.errors.txt @@ -1,6 +1,7 @@ assignmentCompatability21.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string[]; }'. Types of property 'two' are incompatible. - Type 'string' is not assignable to type 'string[]'. + Type 'string | undefined' is not assignable to type 'string[]'. + Type 'undefined' is not assignable to type 'string[]'. ==== assignmentCompatability21.ts (1 errors) ==== @@ -16,4 +17,5 @@ assignmentCompatability21.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOpt ~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string[]; }'. !!! error TS2322: Types of property 'two' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'string[]'. \ No newline at end of file +!!! error TS2322: Type 'string | undefined' is not assignable to type 'string[]'. +!!! error TS2322: Type 'undefined' is not assignable to type 'string[]'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability21.js b/tests/baselines/reference/assignmentCompatability21.js index 963bd13a87104..5af7b5e98fdc3 100644 --- a/tests/baselines/reference/assignmentCompatability21.js +++ b/tests/baselines/reference/assignmentCompatability21.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__obj = __test1__.__val__obj4 //// [assignmentCompatability21.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability21.types b/tests/baselines/reference/assignmentCompatability21.types index a39c42867d980..03c27224ffb11 100644 --- a/tests/baselines/reference/assignmentCompatability21.types +++ b/tests/baselines/reference/assignmentCompatability21.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability22.js b/tests/baselines/reference/assignmentCompatability22.js index 9e2994c0de4b1..8730b1859775d 100644 --- a/tests/baselines/reference/assignmentCompatability22.js +++ b/tests/baselines/reference/assignmentCompatability22.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__obj = __test1__.__val__obj4 //// [assignmentCompatability22.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability22.types b/tests/baselines/reference/assignmentCompatability22.types index 51a1a24302651..911be0509443f 100644 --- a/tests/baselines/reference/assignmentCompatability22.types +++ b/tests/baselines/reference/assignmentCompatability22.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability23.errors.txt b/tests/baselines/reference/assignmentCompatability23.errors.txt index 11d78b22c6de9..8a63d2c0721a4 100644 --- a/tests/baselines/reference/assignmentCompatability23.errors.txt +++ b/tests/baselines/reference/assignmentCompatability23.errors.txt @@ -1,6 +1,7 @@ assignmentCompatability23.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean[]; }'. Types of property 'two' are incompatible. - Type 'string' is not assignable to type 'boolean[]'. + Type 'string | undefined' is not assignable to type 'boolean[]'. + Type 'undefined' is not assignable to type 'boolean[]'. ==== assignmentCompatability23.ts (1 errors) ==== @@ -16,4 +17,5 @@ assignmentCompatability23.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOpt ~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean[]; }'. !!! error TS2322: Types of property 'two' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'boolean[]'. \ No newline at end of file +!!! error TS2322: Type 'string | undefined' is not assignable to type 'boolean[]'. +!!! error TS2322: Type 'undefined' is not assignable to type 'boolean[]'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability23.js b/tests/baselines/reference/assignmentCompatability23.js index 81a3b770b981e..119d1ec63bde0 100644 --- a/tests/baselines/reference/assignmentCompatability23.js +++ b/tests/baselines/reference/assignmentCompatability23.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__obj = __test1__.__val__obj4 //// [assignmentCompatability23.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability23.types b/tests/baselines/reference/assignmentCompatability23.types index eecbc82b56f06..01439487808ef 100644 --- a/tests/baselines/reference/assignmentCompatability23.types +++ b/tests/baselines/reference/assignmentCompatability23.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability24.js b/tests/baselines/reference/assignmentCompatability24.js index d2d615089087a..c963816b91791 100644 --- a/tests/baselines/reference/assignmentCompatability24.js +++ b/tests/baselines/reference/assignmentCompatability24.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__obj = __test1__.__val__obj4 //// [assignmentCompatability24.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability24.types b/tests/baselines/reference/assignmentCompatability24.types index a836668c11670..00ab74ca65970 100644 --- a/tests/baselines/reference/assignmentCompatability24.types +++ b/tests/baselines/reference/assignmentCompatability24.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability25.errors.txt b/tests/baselines/reference/assignmentCompatability25.errors.txt index 23ee1d973b762..10d9e9d596023 100644 --- a/tests/baselines/reference/assignmentCompatability25.errors.txt +++ b/tests/baselines/reference/assignmentCompatability25.errors.txt @@ -1,6 +1,7 @@ assignmentCompatability25.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }'. Types of property 'two' are incompatible. - Type 'string' is not assignable to type 'number'. + Type 'string | undefined' is not assignable to type 'number'. + Type 'undefined' is not assignable to type 'number'. ==== assignmentCompatability25.ts (1 errors) ==== @@ -16,4 +17,5 @@ assignmentCompatability25.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOpt ~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number; }'. !!! error TS2322: Types of property 'two' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type 'string | undefined' is not assignable to type 'number'. +!!! error TS2322: Type 'undefined' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability25.js b/tests/baselines/reference/assignmentCompatability25.js index bfbd06830c24d..d19ab80762c61 100644 --- a/tests/baselines/reference/assignmentCompatability25.js +++ b/tests/baselines/reference/assignmentCompatability25.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__aa = __test1__.__val__obj4 //// [assignmentCompatability25.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability25.types b/tests/baselines/reference/assignmentCompatability25.types index 540528ba2aada..19697929b42a6 100644 --- a/tests/baselines/reference/assignmentCompatability25.types +++ b/tests/baselines/reference/assignmentCompatability25.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability26.js b/tests/baselines/reference/assignmentCompatability26.js index 5dbee18d2ab8b..3de4a3cbbdfb7 100644 --- a/tests/baselines/reference/assignmentCompatability26.js +++ b/tests/baselines/reference/assignmentCompatability26.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__aa = __test1__.__val__obj4 //// [assignmentCompatability26.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability26.types b/tests/baselines/reference/assignmentCompatability26.types index 5cc45834ada84..7093d4ea42859 100644 --- a/tests/baselines/reference/assignmentCompatability26.types +++ b/tests/baselines/reference/assignmentCompatability26.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability27.errors.txt b/tests/baselines/reference/assignmentCompatability27.errors.txt index 2d8ca9431480a..7adaec745af3e 100644 --- a/tests/baselines/reference/assignmentCompatability27.errors.txt +++ b/tests/baselines/reference/assignmentCompatability27.errors.txt @@ -1,5 +1,7 @@ assignmentCompatability27.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }'. - Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type '{ two: string; }'. + Types of property 'two' are incompatible. + Type 'string | undefined' is not assignable to type 'string'. + Type 'undefined' is not assignable to type 'string'. ==== assignmentCompatability27.ts (1 errors) ==== @@ -14,4 +16,6 @@ assignmentCompatability27.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOpt __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string; }'. -!!! error TS2322: Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type '{ two: string; }'. \ No newline at end of file +!!! error TS2322: Types of property 'two' are incompatible. +!!! error TS2322: Type 'string | undefined' is not assignable to type 'string'. +!!! error TS2322: Type 'undefined' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability27.js b/tests/baselines/reference/assignmentCompatability27.js index 45dfd39266bb4..c2f2fde41190e 100644 --- a/tests/baselines/reference/assignmentCompatability27.js +++ b/tests/baselines/reference/assignmentCompatability27.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__aa = __test1__.__val__obj4 //// [assignmentCompatability27.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability27.types b/tests/baselines/reference/assignmentCompatability27.types index d44f18c5dd679..0edd3e559fb55 100644 --- a/tests/baselines/reference/assignmentCompatability27.types +++ b/tests/baselines/reference/assignmentCompatability27.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability28.js b/tests/baselines/reference/assignmentCompatability28.js index 1f6d520ef9697..928b372077bbb 100644 --- a/tests/baselines/reference/assignmentCompatability28.js +++ b/tests/baselines/reference/assignmentCompatability28.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__aa = __test1__.__val__obj4 //// [assignmentCompatability28.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability28.types b/tests/baselines/reference/assignmentCompatability28.types index 2bceac4487fa9..81ea6f5c84b0c 100644 --- a/tests/baselines/reference/assignmentCompatability28.types +++ b/tests/baselines/reference/assignmentCompatability28.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability29.js b/tests/baselines/reference/assignmentCompatability29.js index 1bf4358ba85c4..e41e319fff480 100644 --- a/tests/baselines/reference/assignmentCompatability29.js +++ b/tests/baselines/reference/assignmentCompatability29.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__aa = __test1__.__val__obj4 //// [assignmentCompatability29.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability29.types b/tests/baselines/reference/assignmentCompatability29.types index 5bb36b7ba33b2..d0244703d89ce 100644 --- a/tests/baselines/reference/assignmentCompatability29.types +++ b/tests/baselines/reference/assignmentCompatability29.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability3.js b/tests/baselines/reference/assignmentCompatability3.js index 116e44f5f020f..e85565236698a 100644 --- a/tests/baselines/reference/assignmentCompatability3.js +++ b/tests/baselines/reference/assignmentCompatability3.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__obj = __test1__.__val__obj4 //// [assignmentCompatability3.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability3.types b/tests/baselines/reference/assignmentCompatability3.types index 195a546f3b6a2..e4059a2574b75 100644 --- a/tests/baselines/reference/assignmentCompatability3.types +++ b/tests/baselines/reference/assignmentCompatability3.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability30.js b/tests/baselines/reference/assignmentCompatability30.js index a1d4fe8bf8298..bf2481cc738b4 100644 --- a/tests/baselines/reference/assignmentCompatability30.js +++ b/tests/baselines/reference/assignmentCompatability30.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__aa = __test1__.__val__obj4 //// [assignmentCompatability30.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability30.types b/tests/baselines/reference/assignmentCompatability30.types index 6433a3e5bbf6e..42eb51c19cf6c 100644 --- a/tests/baselines/reference/assignmentCompatability30.types +++ b/tests/baselines/reference/assignmentCompatability30.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability31.js b/tests/baselines/reference/assignmentCompatability31.js index b51435a5f2df6..6620c1d9ca324 100644 --- a/tests/baselines/reference/assignmentCompatability31.js +++ b/tests/baselines/reference/assignmentCompatability31.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__aa = __test1__.__val__obj4 //// [assignmentCompatability31.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability31.types b/tests/baselines/reference/assignmentCompatability31.types index 6feb28f0786e7..dc17756af9227 100644 --- a/tests/baselines/reference/assignmentCompatability31.types +++ b/tests/baselines/reference/assignmentCompatability31.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability32.js b/tests/baselines/reference/assignmentCompatability32.js index 54f556ec8504f..42758a31082d1 100644 --- a/tests/baselines/reference/assignmentCompatability32.js +++ b/tests/baselines/reference/assignmentCompatability32.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__aa = __test1__.__val__obj4 //// [assignmentCompatability32.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability32.types b/tests/baselines/reference/assignmentCompatability32.types index 7701d2dee3511..ae03d5a2dc22b 100644 --- a/tests/baselines/reference/assignmentCompatability32.types +++ b/tests/baselines/reference/assignmentCompatability32.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability33.js b/tests/baselines/reference/assignmentCompatability33.js index 16212b2cf9bb5..ec1fd81e1333d 100644 --- a/tests/baselines/reference/assignmentCompatability33.js +++ b/tests/baselines/reference/assignmentCompatability33.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__obj = __test1__.__val__obj4 //// [assignmentCompatability33.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability33.types b/tests/baselines/reference/assignmentCompatability33.types index db71c0aa18923..24e0b3086f74d 100644 --- a/tests/baselines/reference/assignmentCompatability33.types +++ b/tests/baselines/reference/assignmentCompatability33.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability34.js b/tests/baselines/reference/assignmentCompatability34.js index 00a0e3254c3e6..a3fc8c601158e 100644 --- a/tests/baselines/reference/assignmentCompatability34.js +++ b/tests/baselines/reference/assignmentCompatability34.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__obj = __test1__.__val__obj4 //// [assignmentCompatability34.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability34.types b/tests/baselines/reference/assignmentCompatability34.types index 423b3fc0a2958..5fc851bbc10ce 100644 --- a/tests/baselines/reference/assignmentCompatability34.types +++ b/tests/baselines/reference/assignmentCompatability34.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability35.js b/tests/baselines/reference/assignmentCompatability35.js index 043b98933ed8e..dc6efdea2dcc3 100644 --- a/tests/baselines/reference/assignmentCompatability35.js +++ b/tests/baselines/reference/assignmentCompatability35.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__aa = __test1__.__val__obj4 //// [assignmentCompatability35.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability35.types b/tests/baselines/reference/assignmentCompatability35.types index dce1e8ebc614c..2aa716ffb61e8 100644 --- a/tests/baselines/reference/assignmentCompatability35.types +++ b/tests/baselines/reference/assignmentCompatability35.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability36.errors.txt b/tests/baselines/reference/assignmentCompatability36.errors.txt new file mode 100644 index 0000000000000..40cb9545cc7b6 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability36.errors.txt @@ -0,0 +1,15 @@ +assignmentCompatability36.ts(7,28): error TS2454: Variable 'aa' is used before being assigned. + + +==== assignmentCompatability36.ts (1 errors) ==== + namespace __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + namespace __test2__ { + export var aa:{[index:string]:any;};; + export var __val__aa = aa; + ~~ +!!! error TS2454: Variable 'aa' is used before being assigned. + } + __test2__.__val__aa = __test1__.__val__obj4 \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability36.js b/tests/baselines/reference/assignmentCompatability36.js index 7260e84353563..cf168e7263cc9 100644 --- a/tests/baselines/reference/assignmentCompatability36.js +++ b/tests/baselines/reference/assignmentCompatability36.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__aa = __test1__.__val__obj4 //// [assignmentCompatability36.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability36.types b/tests/baselines/reference/assignmentCompatability36.types index e94b2dd9a9145..076cbb45fabfd 100644 --- a/tests/baselines/reference/assignmentCompatability36.types +++ b/tests/baselines/reference/assignmentCompatability36.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability37.js b/tests/baselines/reference/assignmentCompatability37.js index 2b639372376b4..5f1ac0f13c20a 100644 --- a/tests/baselines/reference/assignmentCompatability37.js +++ b/tests/baselines/reference/assignmentCompatability37.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__aa = __test1__.__val__obj4 //// [assignmentCompatability37.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability38.js b/tests/baselines/reference/assignmentCompatability38.js index 66c46eaeeec0f..29d958fe2cd46 100644 --- a/tests/baselines/reference/assignmentCompatability38.js +++ b/tests/baselines/reference/assignmentCompatability38.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__aa = __test1__.__val__obj4 //// [assignmentCompatability38.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability39.errors.txt b/tests/baselines/reference/assignmentCompatability39.errors.txt index beab98b8a7523..5cd937df2b83d 100644 --- a/tests/baselines/reference/assignmentCompatability39.errors.txt +++ b/tests/baselines/reference/assignmentCompatability39.errors.txt @@ -1,5 +1,7 @@ assignmentCompatability39.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPublic'. - Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'classWithTwoPublic'. + Types of property 'two' are incompatible. + Type 'string | undefined' is not assignable to type 'string'. + Type 'undefined' is not assignable to type 'string'. ==== assignmentCompatability39.ts (1 errors) ==== @@ -14,4 +16,6 @@ assignmentCompatability39.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOpt __test2__.__val__x2 = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'classWithTwoPublic'. -!!! error TS2322: Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'classWithTwoPublic'. \ No newline at end of file +!!! error TS2322: Types of property 'two' are incompatible. +!!! error TS2322: Type 'string | undefined' is not assignable to type 'string'. +!!! error TS2322: Type 'undefined' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability39.js b/tests/baselines/reference/assignmentCompatability39.js index ed095fc6125ed..e6077402af0b5 100644 --- a/tests/baselines/reference/assignmentCompatability39.js +++ b/tests/baselines/reference/assignmentCompatability39.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__x2 = __test1__.__val__obj4 //// [assignmentCompatability39.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability39.types b/tests/baselines/reference/assignmentCompatability39.types index dabd1cfd30ab3..cbc6cc25320f9 100644 --- a/tests/baselines/reference/assignmentCompatability39.types +++ b/tests/baselines/reference/assignmentCompatability39.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability4.errors.txt b/tests/baselines/reference/assignmentCompatability4.errors.txt new file mode 100644 index 0000000000000..6f44daab8d91a --- /dev/null +++ b/tests/baselines/reference/assignmentCompatability4.errors.txt @@ -0,0 +1,15 @@ +assignmentCompatability4.ts(7,28): error TS2454: Variable 'aa' is used before being assigned. + + +==== assignmentCompatability4.ts (1 errors) ==== + namespace __test1__ { + export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; + export var __val__obj4 = obj4; + } + namespace __test2__ { + export var aa:{one:number;};; + export var __val__aa = aa; + ~~ +!!! error TS2454: Variable 'aa' is used before being assigned. + } + __test2__.__val__aa = __test1__.__val__obj4 \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability4.js b/tests/baselines/reference/assignmentCompatability4.js index 91f1015e667f7..7980fd2a4ef26 100644 --- a/tests/baselines/reference/assignmentCompatability4.js +++ b/tests/baselines/reference/assignmentCompatability4.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__aa = __test1__.__val__obj4 //// [assignmentCompatability4.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability4.types b/tests/baselines/reference/assignmentCompatability4.types index bec3dfdf6a676..a2799de9b5686 100644 --- a/tests/baselines/reference/assignmentCompatability4.types +++ b/tests/baselines/reference/assignmentCompatability4.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability40.js b/tests/baselines/reference/assignmentCompatability40.js index ba25bcee8af47..3ed2535a9e0fb 100644 --- a/tests/baselines/reference/assignmentCompatability40.js +++ b/tests/baselines/reference/assignmentCompatability40.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__x5 = __test1__.__val__obj4 //// [assignmentCompatability40.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability40.types b/tests/baselines/reference/assignmentCompatability40.types index 9a880e827354d..7fe26dbb93dee 100644 --- a/tests/baselines/reference/assignmentCompatability40.types +++ b/tests/baselines/reference/assignmentCompatability40.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability41.js b/tests/baselines/reference/assignmentCompatability41.js index 176f6d1a34257..cc269452ef11e 100644 --- a/tests/baselines/reference/assignmentCompatability41.js +++ b/tests/baselines/reference/assignmentCompatability41.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__x6 = __test1__.__val__obj4 //// [assignmentCompatability41.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability41.types b/tests/baselines/reference/assignmentCompatability41.types index a3d32c2abdb94..3ab2568c72fdc 100644 --- a/tests/baselines/reference/assignmentCompatability41.types +++ b/tests/baselines/reference/assignmentCompatability41.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability42.js b/tests/baselines/reference/assignmentCompatability42.js index 3efcdb54a6d63..cbed18d4502c7 100644 --- a/tests/baselines/reference/assignmentCompatability42.js +++ b/tests/baselines/reference/assignmentCompatability42.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__x7 = __test1__.__val__obj4 //// [assignmentCompatability42.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability42.types b/tests/baselines/reference/assignmentCompatability42.types index ca97bda799550..7967bc9a87490 100644 --- a/tests/baselines/reference/assignmentCompatability42.types +++ b/tests/baselines/reference/assignmentCompatability42.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability43.errors.txt b/tests/baselines/reference/assignmentCompatability43.errors.txt index e31b507cac194..8b531ecb87bcf 100644 --- a/tests/baselines/reference/assignmentCompatability43.errors.txt +++ b/tests/baselines/reference/assignmentCompatability43.errors.txt @@ -1,5 +1,7 @@ assignmentCompatability43.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'interfaceTwo'. - Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'interfaceTwo'. + Types of property 'two' are incompatible. + Type 'string | undefined' is not assignable to type 'string'. + Type 'undefined' is not assignable to type 'string'. ==== assignmentCompatability43.ts (1 errors) ==== @@ -14,4 +16,6 @@ assignmentCompatability43.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOpt __test2__.__val__obj2 = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type 'interfaceTwo'. -!!! error TS2322: Property 'two' is optional in type 'interfaceWithPublicAndOptional' but required in type 'interfaceTwo'. \ No newline at end of file +!!! error TS2322: Types of property 'two' are incompatible. +!!! error TS2322: Type 'string | undefined' is not assignable to type 'string'. +!!! error TS2322: Type 'undefined' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability43.js b/tests/baselines/reference/assignmentCompatability43.js index c9b87f6e9010a..acd238d3a2027 100644 --- a/tests/baselines/reference/assignmentCompatability43.js +++ b/tests/baselines/reference/assignmentCompatability43.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__obj2 = __test1__.__val__obj4 //// [assignmentCompatability43.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability43.types b/tests/baselines/reference/assignmentCompatability43.types index bf99c73b79d57..2f4182a4a79b3 100644 --- a/tests/baselines/reference/assignmentCompatability43.types +++ b/tests/baselines/reference/assignmentCompatability43.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability44.js b/tests/baselines/reference/assignmentCompatability44.js index 738de24a038ba..e11fa5f87623e 100644 --- a/tests/baselines/reference/assignmentCompatability44.js +++ b/tests/baselines/reference/assignmentCompatability44.js @@ -9,6 +9,7 @@ const foo: { new(): Foo } = Foo; //// [assignmentCompatability44.js] +"use strict"; class Foo { constructor(x) { } } diff --git a/tests/baselines/reference/assignmentCompatability45.js b/tests/baselines/reference/assignmentCompatability45.js index c7ae1fb63ca81..88b417bc90cea 100644 --- a/tests/baselines/reference/assignmentCompatability45.js +++ b/tests/baselines/reference/assignmentCompatability45.js @@ -11,6 +11,7 @@ const b: typeof A = B; //// [assignmentCompatability45.js] +"use strict"; class A { } class B extends A { diff --git a/tests/baselines/reference/assignmentCompatability46.js b/tests/baselines/reference/assignmentCompatability46.js index fe963750a07e0..86a1011a86299 100644 --- a/tests/baselines/reference/assignmentCompatability46.js +++ b/tests/baselines/reference/assignmentCompatability46.js @@ -8,5 +8,6 @@ fn({ a: 1, b: 2 }) //// [assignmentCompatability46.js] +"use strict"; fn([1, 2, 3]); fn({ a: 1, b: 2 }); diff --git a/tests/baselines/reference/assignmentCompatability5.js b/tests/baselines/reference/assignmentCompatability5.js index 1d348afb9c500..648b350a1f7ce 100644 --- a/tests/baselines/reference/assignmentCompatability5.js +++ b/tests/baselines/reference/assignmentCompatability5.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__obj1 = __test1__.__val__obj4 //// [assignmentCompatability5.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability5.types b/tests/baselines/reference/assignmentCompatability5.types index 831e0a5f2e160..3af6d4701a924 100644 --- a/tests/baselines/reference/assignmentCompatability5.types +++ b/tests/baselines/reference/assignmentCompatability5.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability6.js b/tests/baselines/reference/assignmentCompatability6.js index 5bf506ecf3d9a..8dd0a184dd3da 100644 --- a/tests/baselines/reference/assignmentCompatability6.js +++ b/tests/baselines/reference/assignmentCompatability6.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__obj3 = __test1__.__val__obj4 //// [assignmentCompatability6.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability6.types b/tests/baselines/reference/assignmentCompatability6.types index d8506be1d881a..a4579079e9519 100644 --- a/tests/baselines/reference/assignmentCompatability6.types +++ b/tests/baselines/reference/assignmentCompatability6.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } @@ -30,8 +30,8 @@ namespace __test2__ { > : ^^^^^^^^^^^^^^^^ export interface interfaceWithOptional { one?: T; }; var obj3: interfaceWithOptional = { };; ->one : T -> : ^ +>one : T | undefined +> : ^^^^^^^^^^^^^ >obj3 : interfaceWithOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ } : {} diff --git a/tests/baselines/reference/assignmentCompatability7.js b/tests/baselines/reference/assignmentCompatability7.js index cb7e0807a077f..4e41e2cc01146 100644 --- a/tests/baselines/reference/assignmentCompatability7.js +++ b/tests/baselines/reference/assignmentCompatability7.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__obj4 = __test1__.__val__obj4 //// [assignmentCompatability7.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability7.types b/tests/baselines/reference/assignmentCompatability7.types index d24581a95a6f2..f7f004ae2a430 100644 --- a/tests/baselines/reference/assignmentCompatability7.types +++ b/tests/baselines/reference/assignmentCompatability7.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } @@ -32,8 +32,8 @@ namespace __test2__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability8.js b/tests/baselines/reference/assignmentCompatability8.js index e0e9fd7fb5ebf..25106ac067c31 100644 --- a/tests/baselines/reference/assignmentCompatability8.js +++ b/tests/baselines/reference/assignmentCompatability8.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__x1 = __test1__.__val__obj4 //// [assignmentCompatability8.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability8.types b/tests/baselines/reference/assignmentCompatability8.types index 8ca125dcb8bc7..8c484e88ecd2f 100644 --- a/tests/baselines/reference/assignmentCompatability8.types +++ b/tests/baselines/reference/assignmentCompatability8.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } diff --git a/tests/baselines/reference/assignmentCompatability9.js b/tests/baselines/reference/assignmentCompatability9.js index f6951b819e576..0154110e46e12 100644 --- a/tests/baselines/reference/assignmentCompatability9.js +++ b/tests/baselines/reference/assignmentCompatability9.js @@ -12,6 +12,7 @@ namespace __test2__ { __test2__.__val__x3 = __test1__.__val__obj4 //// [assignmentCompatability9.js] +"use strict"; var __test1__; (function (__test1__) { ; diff --git a/tests/baselines/reference/assignmentCompatability9.types b/tests/baselines/reference/assignmentCompatability9.types index 0bbe1f19a18eb..58135b310f4d2 100644 --- a/tests/baselines/reference/assignmentCompatability9.types +++ b/tests/baselines/reference/assignmentCompatability9.types @@ -8,8 +8,8 @@ namespace __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; >one : T > : ^ ->two : U -> : ^ +>two : U | undefined +> : ^^^^^^^^^^^^^ >obj4 : interfaceWithPublicAndOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{ one: 1 } : { one: number; } @@ -32,8 +32,8 @@ namespace __test2__ { export class classWithOptional { constructor(public one?: T) {} } var x3 = new classWithOptional();; >classWithOptional : classWithOptional > : ^^^^^^^^^^^^^^^^^^^^ ->one : T -> : ^ +>one : T | undefined +> : ^^^^^^^^^^^^^ >x3 : classWithOptional > : ^^^^^^^^^^^^^^^^^^^^^^^^^ >new classWithOptional() : classWithOptional diff --git a/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.js b/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.js index 96bae1d84ffed..a365c6c662b5a 100644 --- a/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.js +++ b/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.js @@ -33,6 +33,7 @@ fn(a => { }); //// [assignmentCompatability_checking-apply-member-off-of-function-interface.js] +"use strict"; // 3.8.4 Assignment Compatibility var x; // Should fail diff --git a/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.js b/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.js index f4d2de50fcc33..a0c431705cfa3 100644 --- a/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.js +++ b/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.js @@ -33,6 +33,7 @@ fn(a => { }); //// [assignmentCompatability_checking-call-member-off-of-function-interface.js] +"use strict"; // 3.8.4 Assignment Compatibility var x; // Should fail diff --git a/tests/baselines/reference/assignmentCompatibilityForConstrainedTypeParameters.errors.txt b/tests/baselines/reference/assignmentCompatibilityForConstrainedTypeParameters.errors.txt new file mode 100644 index 0000000000000..581cea6aa778c --- /dev/null +++ b/tests/baselines/reference/assignmentCompatibilityForConstrainedTypeParameters.errors.txt @@ -0,0 +1,13 @@ +assignmentCompatibilityForConstrainedTypeParameters.ts(5,12): error TS2454: Variable 'x' is used before being assigned. + + +==== assignmentCompatibilityForConstrainedTypeParameters.ts (1 errors) ==== + function foo() { + function bar() { + var x: S; + var y: T; + y = x; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatibilityForConstrainedTypeParameters.js b/tests/baselines/reference/assignmentCompatibilityForConstrainedTypeParameters.js index f8b059e02d55a..fcef544c22e56 100644 --- a/tests/baselines/reference/assignmentCompatibilityForConstrainedTypeParameters.js +++ b/tests/baselines/reference/assignmentCompatibilityForConstrainedTypeParameters.js @@ -10,6 +10,7 @@ function foo() { } //// [assignmentCompatibilityForConstrainedTypeParameters.js] +"use strict"; function foo() { function bar() { var x; diff --git a/tests/baselines/reference/assignmentGenericLookupTypeNarrowing.js b/tests/baselines/reference/assignmentGenericLookupTypeNarrowing.js index 1c86cba51bbac..d54b7256536df 100644 --- a/tests/baselines/reference/assignmentGenericLookupTypeNarrowing.js +++ b/tests/baselines/reference/assignmentGenericLookupTypeNarrowing.js @@ -15,6 +15,7 @@ function bar(key: K) { //// [assignmentGenericLookupTypeNarrowing.js] +"use strict"; // Repro from #26130 let mappedObject = { foo: { x: "hello" } }; function bar(key) { diff --git a/tests/baselines/reference/assignmentGenericLookupTypeNarrowing.types b/tests/baselines/reference/assignmentGenericLookupTypeNarrowing.types index de7504bed4c23..20d99e5187ba9 100644 --- a/tests/baselines/reference/assignmentGenericLookupTypeNarrowing.types +++ b/tests/baselines/reference/assignmentGenericLookupTypeNarrowing.types @@ -4,8 +4,8 @@ // Repro from #26130 let mappedObject: {[K in "foo"]: null | {x: string}} = {foo: {x: "hello"}}; ->mappedObject : { foo: { x: string; }; } -> : ^^^^^^^^^^^^ ^^^^^^ +>mappedObject : { foo: { x: string; } | null; } +> : ^^^^^^^^^^^^ ^^^^^^^^^^^^^ >x : string > : ^^^^^^ >{foo: {x: "hello"}} : { foo: { x: string; }; } @@ -32,24 +32,24 @@ function bar(key: K) { > : ^ const element = foo(mappedObject[key]); ->element : { foo: { x: string; }; }[K] -> : ^^^^^^^^^^^^ ^^^^^^^^^ ->foo(mappedObject[key]) : { foo: { x: string; }; }[K] -> : ^^^^^^^^^^^^ ^^^^^^^^^ +>element : { foo: { x: string; } | null; }[K] | null +> : ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ +>foo(mappedObject[key]) : { foo: { x: string; } | null; }[K] | null +> : ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ >foo : (x: T) => null | T > : ^ ^^ ^^ ^^^^^ ->mappedObject[key] : { foo: { x: string; }; }[K] -> : ^^^^^^^^^^^^ ^^^^^^^^^ ->mappedObject : { foo: { x: string; }; } -> : ^^^^^^^^^^^^ ^^^^^^ +>mappedObject[key] : { foo: { x: string; } | null; }[K] +> : ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ +>mappedObject : { foo: { x: string; } | null; } +> : ^^^^^^^^^^^^ ^^^^^^^^^^^^^ >key : K > : ^ if (element == null) >element == null : boolean > : ^^^^^^^ ->element : { foo: { x: string; }; }[K] -> : ^^^^^^^^^^^^ ^^^^^^^^^ +>element : { foo: { x: string; } | null; }[K] | null +> : ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ return; const x = element.x; @@ -57,8 +57,8 @@ function bar(key: K) { > : ^^^^^^ >element.x : string > : ^^^^^^ ->element : { foo: { x: string; }; }[K] -> : ^^^^^^^^^^^^ ^^^^^^^^^ +>element : { x: string; } +> : ^^^^^ ^^^ >x : string > : ^^^^^^ } diff --git a/tests/baselines/reference/assignmentIndexedToPrimitives.js b/tests/baselines/reference/assignmentIndexedToPrimitives.js index ebd79a745d750..58d843d1f2962 100644 --- a/tests/baselines/reference/assignmentIndexedToPrimitives.js +++ b/tests/baselines/reference/assignmentIndexedToPrimitives.js @@ -19,6 +19,7 @@ const so3: string = { 0: "1" }; //// [assignmentIndexedToPrimitives.js] +"use strict"; const n1 = [0]; const n2 = ["0"]; const n3 = [0, "1"]; diff --git a/tests/baselines/reference/assignmentLHSIsReference.errors.txt b/tests/baselines/reference/assignmentLHSIsReference.errors.txt new file mode 100644 index 0000000000000..6c9c618feb1ba --- /dev/null +++ b/tests/baselines/reference/assignmentLHSIsReference.errors.txt @@ -0,0 +1,39 @@ +assignmentLHSIsReference.ts(13,1): error TS2454: Variable 'x3' is used before being assigned. +assignmentLHSIsReference.ts(14,1): error TS2454: Variable 'x3' is used before being assigned. +assignmentLHSIsReference.ts(23,2): error TS2454: Variable 'x3' is used before being assigned. +assignmentLHSIsReference.ts(24,2): error TS2454: Variable 'x3' is used before being assigned. + + +==== assignmentLHSIsReference.ts (4 errors) ==== + var value: any; + + // identifiers: variable and parameter + var x1: number; + x1 = value; + + function fn1(x2: number) { + x2 = value; + } + + // property accesses + var x3: { a: string }; + x3.a = value; + ~~ +!!! error TS2454: Variable 'x3' is used before being assigned. + x3['a'] = value; + ~~ +!!! error TS2454: Variable 'x3' is used before being assigned. + + // parentheses, the contained expression is reference + (x1) = value; + + function fn2(x4: number) { + (x4) = value; + } + + (x3.a) = value; + ~~ +!!! error TS2454: Variable 'x3' is used before being assigned. + (x3['a']) = value; + ~~ +!!! error TS2454: Variable 'x3' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentLHSIsReference.js b/tests/baselines/reference/assignmentLHSIsReference.js index 347d4f1c30968..b6839c66495ad 100644 --- a/tests/baselines/reference/assignmentLHSIsReference.js +++ b/tests/baselines/reference/assignmentLHSIsReference.js @@ -27,6 +27,7 @@ function fn2(x4: number) { (x3['a']) = value; //// [assignmentLHSIsReference.js] +"use strict"; var value; // identifiers: variable and parameter var x1; diff --git a/tests/baselines/reference/assignmentLHSIsReference.types b/tests/baselines/reference/assignmentLHSIsReference.types index 7e765da01a44f..b5df7b354887e 100644 --- a/tests/baselines/reference/assignmentLHSIsReference.types +++ b/tests/baselines/reference/assignmentLHSIsReference.types @@ -3,6 +3,7 @@ === assignmentLHSIsReference.ts === var value: any; >value : any +> : ^^^ // identifiers: variable and parameter var x1: number; @@ -11,9 +12,11 @@ var x1: number; x1 = value; >x1 = value : any +> : ^^^ >x1 : number > : ^^^^^^ >value : any +> : ^^^ function fn1(x2: number) { >fn1 : (x2: number) => void @@ -23,9 +26,11 @@ function fn1(x2: number) { x2 = value; >x2 = value : any +> : ^^^ >x2 : number > : ^^^^^^ >value : any +> : ^^^ } // property accesses @@ -37,6 +42,7 @@ var x3: { a: string }; x3.a = value; >x3.a = value : any +> : ^^^ >x3.a : string > : ^^^^^^ >x3 : { a: string; } @@ -44,9 +50,11 @@ x3.a = value; >a : string > : ^^^^^^ >value : any +> : ^^^ x3['a'] = value; >x3['a'] = value : any +> : ^^^ >x3['a'] : string > : ^^^^^^ >x3 : { a: string; } @@ -54,15 +62,18 @@ x3['a'] = value; >'a' : "a" > : ^^^ >value : any +> : ^^^ // parentheses, the contained expression is reference (x1) = value; >(x1) = value : any +> : ^^^ >(x1) : number > : ^^^^^^ >x1 : number > : ^^^^^^ >value : any +> : ^^^ function fn2(x4: number) { >fn2 : (x4: number) => void @@ -72,15 +83,18 @@ function fn2(x4: number) { (x4) = value; >(x4) = value : any +> : ^^^ >(x4) : number > : ^^^^^^ >x4 : number > : ^^^^^^ >value : any +> : ^^^ } (x3.a) = value; >(x3.a) = value : any +> : ^^^ >(x3.a) : string > : ^^^^^^ >x3.a : string @@ -90,9 +104,11 @@ function fn2(x4: number) { >a : string > : ^^^^^^ >value : any +> : ^^^ (x3['a']) = value; >(x3['a']) = value : any +> : ^^^ >(x3['a']) : string > : ^^^^^^ >x3['a'] : string @@ -102,4 +118,5 @@ function fn2(x4: number) { >'a' : "a" > : ^^^ >value : any +> : ^^^ diff --git a/tests/baselines/reference/assignmentLHSIsValue.js b/tests/baselines/reference/assignmentLHSIsValue.js index cc6dd6342a1f4..1f72fa9a898e4 100644 --- a/tests/baselines/reference/assignmentLHSIsValue.js +++ b/tests/baselines/reference/assignmentLHSIsValue.js @@ -73,6 +73,7 @@ foo() = value; (foo()) = value; //// [assignmentLHSIsValue.js] +"use strict"; // expected error for all the LHS of assignments var value; // this diff --git a/tests/baselines/reference/assignmentNestedInLiterals.js b/tests/baselines/reference/assignmentNestedInLiterals.js index 5b70082168b93..bd3c6055bdf8a 100644 --- a/tests/baselines/reference/assignmentNestedInLiterals.js +++ b/tests/baselines/reference/assignmentNestedInLiterals.js @@ -13,6 +13,7 @@ for (kowloona of [c = 1, d = c]) { //// [assignmentNestedInLiterals.js] +"use strict"; var target, x, y; target = [x = 1, y = x]; var aegis, a, b; diff --git a/tests/baselines/reference/assignmentNonObjectTypeConstraints.js b/tests/baselines/reference/assignmentNonObjectTypeConstraints.js index 5edb595c6d624..cbe34c0b06cc5 100644 --- a/tests/baselines/reference/assignmentNonObjectTypeConstraints.js +++ b/tests/baselines/reference/assignmentNonObjectTypeConstraints.js @@ -22,6 +22,7 @@ bar(new B); //// [assignmentNonObjectTypeConstraints.js] +"use strict"; function foo(x) { var y = x; // Ok } diff --git a/tests/baselines/reference/assignmentRestElementWithErrorSourceType.js b/tests/baselines/reference/assignmentRestElementWithErrorSourceType.js index 7b08e17158db1..cb48549d9fca8 100644 --- a/tests/baselines/reference/assignmentRestElementWithErrorSourceType.js +++ b/tests/baselines/reference/assignmentRestElementWithErrorSourceType.js @@ -5,5 +5,6 @@ var tuple: [string, number]; [...c] = tupel; // intentionally misspelled //// [assignmentRestElementWithErrorSourceType.js] +"use strict"; var tuple; [...c] = tupel; // intentionally misspelled diff --git a/tests/baselines/reference/assignmentStricterConstraints.js b/tests/baselines/reference/assignmentStricterConstraints.js index 110f2157e0412..223b7c9900d00 100644 --- a/tests/baselines/reference/assignmentStricterConstraints.js +++ b/tests/baselines/reference/assignmentStricterConstraints.js @@ -12,6 +12,7 @@ g(1, "") //// [assignmentStricterConstraints.js] +"use strict"; var f = function (x, y) { x = y; }; diff --git a/tests/baselines/reference/assignmentToConditionalBrandedStringTemplateOrMapping.js b/tests/baselines/reference/assignmentToConditionalBrandedStringTemplateOrMapping.js index c8d43222ce0ed..159ec054e03ed 100644 --- a/tests/baselines/reference/assignmentToConditionalBrandedStringTemplateOrMapping.js +++ b/tests/baselines/reference/assignmentToConditionalBrandedStringTemplateOrMapping.js @@ -13,6 +13,7 @@ c = d; //// [assignmentToConditionalBrandedStringTemplateOrMapping.js] +"use strict"; let a = null; let b = null; a = b; diff --git a/tests/baselines/reference/assignmentToConditionalBrandedStringTemplateOrMapping.types b/tests/baselines/reference/assignmentToConditionalBrandedStringTemplateOrMapping.types index 61dc9b88001e7..6b317425cb0cb 100644 --- a/tests/baselines/reference/assignmentToConditionalBrandedStringTemplateOrMapping.types +++ b/tests/baselines/reference/assignmentToConditionalBrandedStringTemplateOrMapping.types @@ -6,16 +6,16 @@ let a: (() => T extends `${'a' & { a: 1 }}` ? 1 : 2) = null!; > : ^ ^^^^^^^ >a : 1 > : ^ ->null! : null -> : ^^^^ +>null! : never +> : ^^^^^ let b: (() => T extends `${'a' & { a: 1 }}` ? 1 : 2) = null!; >b : () => T extends `${"a" & { a: 1; }}` ? 1 : 2 > : ^ ^^^^^^^ >a : 1 > : ^ ->null! : null -> : ^^^^ +>null! : never +> : ^^^^^ a = b; >a = b : () => T extends `${"a" & { a: 1; }}` ? 1 : 2 @@ -30,16 +30,16 @@ let c: (() => T extends Uppercase<'a' & { a: 1 }> ? 1 : 2) = null!; > : ^ ^^^^^^^ >a : 1 > : ^ ->null! : null -> : ^^^^ +>null! : never +> : ^^^^^ let d: (() => T extends Uppercase<'a' & { a: 1 }> ? 1 : 2) = null!; >d : () => T extends Uppercase<"a" & { a: 1; }> ? 1 : 2 > : ^ ^^^^^^^ >a : 1 > : ^ ->null! : null -> : ^^^^ +>null! : never +> : ^^^^^ c = d; >c = d : () => T extends Uppercase<"a" & { a: 1; }> ? 1 : 2 diff --git a/tests/baselines/reference/assignmentToExpandingArrayType.js b/tests/baselines/reference/assignmentToExpandingArrayType.js index 56ecd88ad8055..17cfbadf3bbef 100644 --- a/tests/baselines/reference/assignmentToExpandingArrayType.js +++ b/tests/baselines/reference/assignmentToExpandingArrayType.js @@ -30,6 +30,7 @@ x[0] = { foo: 'hi' } //// [assignmentToExpandingArrayType.js] +"use strict"; // Fixes exponential time/space in #14628 let x = []; x[0] = { foo: 'hi' }; diff --git a/tests/baselines/reference/assignmentToExpandingArrayType.types b/tests/baselines/reference/assignmentToExpandingArrayType.types index 22e009fcd23c4..9ae73964c4569 100644 --- a/tests/baselines/reference/assignmentToExpandingArrayType.types +++ b/tests/baselines/reference/assignmentToExpandingArrayType.types @@ -5,8 +5,8 @@ let x = [] >x : any[] > : ^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ x[0] = { foo: 'hi' } >x[0] = { foo: 'hi' } : { foo: string; } diff --git a/tests/baselines/reference/assignmentToFunction.js b/tests/baselines/reference/assignmentToFunction.js index 6858bf3d9a8d7..4b57f66940a81 100644 --- a/tests/baselines/reference/assignmentToFunction.js +++ b/tests/baselines/reference/assignmentToFunction.js @@ -13,6 +13,7 @@ namespace foo { } //// [assignmentToFunction.js] +"use strict"; function fn() { } fn = () => 3; var foo; diff --git a/tests/baselines/reference/assignmentToObject.js b/tests/baselines/reference/assignmentToObject.js index aaa8c079afed5..26b6b2e555173 100644 --- a/tests/baselines/reference/assignmentToObject.js +++ b/tests/baselines/reference/assignmentToObject.js @@ -7,6 +7,7 @@ var c: Object = a; // should be error //// [assignmentToObject.js] +"use strict"; var a = { toString: 5 }; var b = a; // ok var c = a; // should be error diff --git a/tests/baselines/reference/assignmentToObjectAndFunction.js b/tests/baselines/reference/assignmentToObjectAndFunction.js index 3bc4cc4bcb2f1..ca5b60e1ec3d5 100644 --- a/tests/baselines/reference/assignmentToObjectAndFunction.js +++ b/tests/baselines/reference/assignmentToObjectAndFunction.js @@ -32,6 +32,7 @@ namespace bad { var badFundule: Function = bad; // error //// [assignmentToObjectAndFunction.js] +"use strict"; var errObj = { toString: 0 }; // Error, incompatible toString var goodObj = { toString(x) { diff --git a/tests/baselines/reference/assignmentToParenthesizedExpression1.js b/tests/baselines/reference/assignmentToParenthesizedExpression1.js index 9164baa42a0e5..5215ea835a2e0 100644 --- a/tests/baselines/reference/assignmentToParenthesizedExpression1.js +++ b/tests/baselines/reference/assignmentToParenthesizedExpression1.js @@ -5,5 +5,6 @@ var x; (1, x)=0; //// [assignmentToParenthesizedExpression1.js] +"use strict"; var x; (1, x) = 0; diff --git a/tests/baselines/reference/assignmentToParenthesizedExpression1.types b/tests/baselines/reference/assignmentToParenthesizedExpression1.types index 705df9c7892ec..820fa7d8ce656 100644 --- a/tests/baselines/reference/assignmentToParenthesizedExpression1.types +++ b/tests/baselines/reference/assignmentToParenthesizedExpression1.types @@ -8,14 +8,14 @@ var x; (1, x)=0; >(1, x)=0 : 0 > : ^ ->(1, x) : any -> : ^^^ ->1, x : any -> : ^^^ +>(1, x) : undefined +> : ^^^^^^^^^ +>1, x : undefined +> : ^^^^^^^^^ >1 : 1 > : ^ ->x : any -> : ^^^ +>x : undefined +> : ^^^^^^^^^ >0 : 0 > : ^ diff --git a/tests/baselines/reference/assignmentToParenthesizedIdentifiers.js b/tests/baselines/reference/assignmentToParenthesizedIdentifiers.js index f8f18ea30942a..7617515ab01e3 100644 --- a/tests/baselines/reference/assignmentToParenthesizedIdentifiers.js +++ b/tests/baselines/reference/assignmentToParenthesizedIdentifiers.js @@ -74,6 +74,7 @@ C = undefined; // Error //// [assignmentToParenthesizedIdentifiers.js] +"use strict"; var x; x = 3; // OK (x) = 3; // OK diff --git a/tests/baselines/reference/assignmentToReferenceTypes.js b/tests/baselines/reference/assignmentToReferenceTypes.js index ac5b8e673d382..68529fb6cc821 100644 --- a/tests/baselines/reference/assignmentToReferenceTypes.js +++ b/tests/baselines/reference/assignmentToReferenceTypes.js @@ -26,6 +26,7 @@ function g(x) { } //// [assignmentToReferenceTypes.js] +"use strict"; // Should all be allowed M = null; class C { diff --git a/tests/baselines/reference/assignmentToVoidZero1.errors.txt b/tests/baselines/reference/assignmentToVoidZero1.errors.txt new file mode 100644 index 0000000000000..4f5084346d893 --- /dev/null +++ b/tests/baselines/reference/assignmentToVoidZero1.errors.txt @@ -0,0 +1,14 @@ +assignmentToVoidZero1.js(2,1): error TS2322: Type 'undefined' is not assignable to type '2'. +assignmentToVoidZero1.js(2,13): error TS2322: Type 'undefined' is not assignable to type '1'. + + +==== assignmentToVoidZero1.js (2 errors) ==== + // #38552 + exports.y = exports.x = void 0; + ~~~~~~~~~ +!!! error TS2322: Type 'undefined' is not assignable to type '2'. + ~~~~~~~~~ +!!! error TS2322: Type 'undefined' is not assignable to type '1'. + exports.x = 1; + exports.y = 2; + \ No newline at end of file diff --git a/tests/baselines/reference/assignmentToVoidZero1.js b/tests/baselines/reference/assignmentToVoidZero1.js index 2aba92d0edacc..576e9a6560265 100644 --- a/tests/baselines/reference/assignmentToVoidZero1.js +++ b/tests/baselines/reference/assignmentToVoidZero1.js @@ -8,6 +8,7 @@ exports.y = 2; //// [assignmentToVoidZero1.js] +"use strict"; // #38552 exports.y = exports.x = void 0; exports.x = 1; diff --git a/tests/baselines/reference/assignmentToVoidZero2.js b/tests/baselines/reference/assignmentToVoidZero2.js index 3d12268850d27..a65b98fdff7d0 100644 --- a/tests/baselines/reference/assignmentToVoidZero2.js +++ b/tests/baselines/reference/assignmentToVoidZero2.js @@ -21,6 +21,7 @@ j + k //// [assignmentToVoidZero2.js] +"use strict"; exports.j = 1; exports.k = void 0; var o = {}; diff --git a/tests/baselines/reference/assignmentTypeNarrowing.errors.txt b/tests/baselines/reference/assignmentTypeNarrowing.errors.txt new file mode 100644 index 0000000000000..95cfd8d02d326 --- /dev/null +++ b/tests/baselines/reference/assignmentTypeNarrowing.errors.txt @@ -0,0 +1,41 @@ +assignmentTypeNarrowing.ts(26,11): error TS2454: Variable 'a' is used before being assigned. + + +==== assignmentTypeNarrowing.ts (1 errors) ==== + let x: string | number | boolean | RegExp; + + x = ""; + x; // string + + [x] = [true]; + x; // boolean + + [x = ""] = [1]; + x; // string | number + + ({x} = {x: true}); + x; // boolean + + ({y: x} = {y: 1}); + x; // number + + ({x = ""} = {x: true}); + x; // string | boolean + + ({y: x = /a/} = {y: 1}); + x; // number | RegExp + + let a: string[]; + + for (x of a) { + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + x; // string + } + + // Repro from #26405 + + type AOrArrA = T | T[]; + const arr: AOrArrA<{x?: "ok"}> = [{ x: "ok" }]; // weak type + arr.push({ x: "ok" }); + \ No newline at end of file diff --git a/tests/baselines/reference/assignmentTypeNarrowing.js b/tests/baselines/reference/assignmentTypeNarrowing.js index 85457ff356b16..04d1bb758c041 100644 --- a/tests/baselines/reference/assignmentTypeNarrowing.js +++ b/tests/baselines/reference/assignmentTypeNarrowing.js @@ -38,6 +38,7 @@ arr.push({ x: "ok" }); //// [assignmentTypeNarrowing.js] +"use strict"; let x; x = ""; x; // string diff --git a/tests/baselines/reference/assignmentTypeNarrowing.types b/tests/baselines/reference/assignmentTypeNarrowing.types index b4105c636150b..c6756e2d9e838 100644 --- a/tests/baselines/reference/assignmentTypeNarrowing.types +++ b/tests/baselines/reference/assignmentTypeNarrowing.types @@ -167,8 +167,8 @@ type AOrArrA = T | T[]; const arr: AOrArrA<{x?: "ok"}> = [{ x: "ok" }]; // weak type >arr : AOrArrA<{ x?: "ok"; }> > : ^^^^^^^^^^^^^^ ^^^^ ->x : "ok" -> : ^^^^ +>x : "ok" | undefined +> : ^^^^^^^^^^^^^^^^ >[{ x: "ok" }] : { x: "ok"; }[] > : ^^^^^^^^^^^^^^ >{ x: "ok" } : { x: "ok"; } diff --git a/tests/baselines/reference/assignments.js b/tests/baselines/reference/assignments.js index dac0ea346af56..4bbbd488bf52e 100644 --- a/tests/baselines/reference/assignments.js +++ b/tests/baselines/reference/assignments.js @@ -34,6 +34,7 @@ interface I { } I = null; // Error //// [assignments.js] +"use strict"; // In this file: // Assign to a module // Assign to a class diff --git a/tests/baselines/reference/asyncAliasReturnType_es5(target=es2015).js b/tests/baselines/reference/asyncAliasReturnType_es5(target=es2015).js index 7d8afa6da467e..587b15738865b 100644 --- a/tests/baselines/reference/asyncAliasReturnType_es5(target=es2015).js +++ b/tests/baselines/reference/asyncAliasReturnType_es5(target=es2015).js @@ -7,6 +7,7 @@ async function f(): PromiseAlias { } //// [asyncAliasReturnType_es5.js] +"use strict"; function f() { return __awaiter(this, void 0, void 0, function* () { }); diff --git a/tests/baselines/reference/asyncAliasReturnType_es5(target=es5).js b/tests/baselines/reference/asyncAliasReturnType_es5(target=es5).js index 5a6514b88e691..d52a8a2c459ec 100644 --- a/tests/baselines/reference/asyncAliasReturnType_es5(target=es5).js +++ b/tests/baselines/reference/asyncAliasReturnType_es5(target=es5).js @@ -7,6 +7,7 @@ async function f(): PromiseAlias { } //// [asyncAliasReturnType_es5.js] +"use strict"; function f() { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { diff --git a/tests/baselines/reference/asyncAliasReturnType_es6.js b/tests/baselines/reference/asyncAliasReturnType_es6.js index 47be5bd6b08a6..aafde75d17c8b 100644 --- a/tests/baselines/reference/asyncAliasReturnType_es6.js +++ b/tests/baselines/reference/asyncAliasReturnType_es6.js @@ -7,6 +7,7 @@ async function f(): PromiseAlias { } //// [asyncAliasReturnType_es6.js] +"use strict"; function f() { return __awaiter(this, void 0, void 0, function* () { }); diff --git a/tests/baselines/reference/asyncArrowFunction10_es2017.js b/tests/baselines/reference/asyncArrowFunction10_es2017.js index a66589308c19c..4bb7b00dcd910 100644 --- a/tests/baselines/reference/asyncArrowFunction10_es2017.js +++ b/tests/baselines/reference/asyncArrowFunction10_es2017.js @@ -8,6 +8,7 @@ var foo = async (): Promise => { //// [asyncArrowFunction10_es2017.js] +"use strict"; var foo = async () => { // Legal to use 'await' in a type context. var v; diff --git a/tests/baselines/reference/asyncArrowFunction10_es5(target=es2015).js b/tests/baselines/reference/asyncArrowFunction10_es5(target=es2015).js index 8c315b6d44af7..f65ee9b25ba57 100644 --- a/tests/baselines/reference/asyncArrowFunction10_es5(target=es2015).js +++ b/tests/baselines/reference/asyncArrowFunction10_es5(target=es2015).js @@ -8,7 +8,8 @@ var foo = async (): Promise => { //// [asyncArrowFunction10_es5.js] -var foo = () => __awaiter(this, void 0, void 0, function* () { +"use strict"; +var foo = () => __awaiter(void 0, void 0, void 0, function* () { // Legal to use 'await' in a type context. var v; }); diff --git a/tests/baselines/reference/asyncArrowFunction10_es5(target=es5).js b/tests/baselines/reference/asyncArrowFunction10_es5(target=es5).js index 521fb57df0cb4..c1af3f15acc3c 100644 --- a/tests/baselines/reference/asyncArrowFunction10_es5(target=es5).js +++ b/tests/baselines/reference/asyncArrowFunction10_es5(target=es5).js @@ -8,8 +8,8 @@ var foo = async (): Promise => { //// [asyncArrowFunction10_es5.js] -var _this = this; -var foo = function () { return __awaiter(_this, void 0, void 0, function () { +"use strict"; +var foo = function () { return __awaiter(void 0, void 0, void 0, function () { var v; return __generator(this, function (_a) { return [2 /*return*/]; diff --git a/tests/baselines/reference/asyncArrowFunction10_es6.js b/tests/baselines/reference/asyncArrowFunction10_es6.js index c4d70600d9b85..37bd039984520 100644 --- a/tests/baselines/reference/asyncArrowFunction10_es6.js +++ b/tests/baselines/reference/asyncArrowFunction10_es6.js @@ -8,7 +8,8 @@ var foo = async (): Promise => { //// [asyncArrowFunction10_es6.js] -var foo = () => __awaiter(this, void 0, void 0, function* () { +"use strict"; +var foo = () => __awaiter(void 0, void 0, void 0, function* () { // Legal to use 'await' in a type context. var v; }); diff --git a/tests/baselines/reference/asyncArrowFunction11_es5(target=es2015).js b/tests/baselines/reference/asyncArrowFunction11_es5(target=es2015).js index 80a7fd774664c..af689ede169a7 100644 --- a/tests/baselines/reference/asyncArrowFunction11_es5(target=es2015).js +++ b/tests/baselines/reference/asyncArrowFunction11_es5(target=es2015).js @@ -10,6 +10,7 @@ class A { } //// [asyncArrowFunction11_es5.js] +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { diff --git a/tests/baselines/reference/asyncArrowFunction11_es5(target=es5).js b/tests/baselines/reference/asyncArrowFunction11_es5(target=es5).js index 932079f3c83f9..b0cf216455139 100644 --- a/tests/baselines/reference/asyncArrowFunction11_es5(target=es5).js +++ b/tests/baselines/reference/asyncArrowFunction11_es5(target=es5).js @@ -10,6 +10,7 @@ class A { } //// [asyncArrowFunction11_es5.js] +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { diff --git a/tests/baselines/reference/asyncArrowFunction1_es2017.js b/tests/baselines/reference/asyncArrowFunction1_es2017.js index 6f5c29d33911c..3128935dfe259 100644 --- a/tests/baselines/reference/asyncArrowFunction1_es2017.js +++ b/tests/baselines/reference/asyncArrowFunction1_es2017.js @@ -5,5 +5,6 @@ var foo = async (): Promise => { }; //// [asyncArrowFunction1_es2017.js] +"use strict"; var foo = async () => { }; diff --git a/tests/baselines/reference/asyncArrowFunction1_es5(target=es2015).js b/tests/baselines/reference/asyncArrowFunction1_es5(target=es2015).js index 6b747595f8e99..d932712519c87 100644 --- a/tests/baselines/reference/asyncArrowFunction1_es5(target=es2015).js +++ b/tests/baselines/reference/asyncArrowFunction1_es5(target=es2015).js @@ -5,5 +5,6 @@ var foo = async (): Promise => { }; //// [asyncArrowFunction1_es5.js] -var foo = () => __awaiter(this, void 0, void 0, function* () { +"use strict"; +var foo = () => __awaiter(void 0, void 0, void 0, function* () { }); diff --git a/tests/baselines/reference/asyncArrowFunction1_es5(target=es5).js b/tests/baselines/reference/asyncArrowFunction1_es5(target=es5).js index def5dec68d75c..912518b3d141f 100644 --- a/tests/baselines/reference/asyncArrowFunction1_es5(target=es5).js +++ b/tests/baselines/reference/asyncArrowFunction1_es5(target=es5).js @@ -5,8 +5,8 @@ var foo = async (): Promise => { }; //// [asyncArrowFunction1_es5.js] -var _this = this; -var foo = function () { return __awaiter(_this, void 0, void 0, function () { +"use strict"; +var foo = function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) { return [2 /*return*/]; }); diff --git a/tests/baselines/reference/asyncArrowFunction1_es6.js b/tests/baselines/reference/asyncArrowFunction1_es6.js index 51be9a1d71c55..426eb5570f3d5 100644 --- a/tests/baselines/reference/asyncArrowFunction1_es6.js +++ b/tests/baselines/reference/asyncArrowFunction1_es6.js @@ -5,5 +5,6 @@ var foo = async (): Promise => { }; //// [asyncArrowFunction1_es6.js] -var foo = () => __awaiter(this, void 0, void 0, function* () { +"use strict"; +var foo = () => __awaiter(void 0, void 0, void 0, function* () { }); diff --git a/tests/baselines/reference/asyncArrowFunction2_es2017.js b/tests/baselines/reference/asyncArrowFunction2_es2017.js index ec3fe6d438078..60f0a3a4f21e1 100644 --- a/tests/baselines/reference/asyncArrowFunction2_es2017.js +++ b/tests/baselines/reference/asyncArrowFunction2_es2017.js @@ -5,5 +5,6 @@ var f = (await) => { } //// [asyncArrowFunction2_es2017.js] +"use strict"; var f = (await) => { }; diff --git a/tests/baselines/reference/asyncArrowFunction2_es5(target=es2015).js b/tests/baselines/reference/asyncArrowFunction2_es5(target=es2015).js index b37b17ccf6cf9..345bcb80eab72 100644 --- a/tests/baselines/reference/asyncArrowFunction2_es5(target=es2015).js +++ b/tests/baselines/reference/asyncArrowFunction2_es5(target=es2015).js @@ -5,5 +5,6 @@ var f = (await) => { } //// [asyncArrowFunction2_es5.js] +"use strict"; var f = (await) => { }; diff --git a/tests/baselines/reference/asyncArrowFunction2_es5(target=es5).js b/tests/baselines/reference/asyncArrowFunction2_es5(target=es5).js index 682593e04a2de..a3b057cb4b270 100644 --- a/tests/baselines/reference/asyncArrowFunction2_es5(target=es5).js +++ b/tests/baselines/reference/asyncArrowFunction2_es5(target=es5).js @@ -5,5 +5,6 @@ var f = (await) => { } //// [asyncArrowFunction2_es5.js] +"use strict"; var f = function (await) { }; diff --git a/tests/baselines/reference/asyncArrowFunction2_es6.js b/tests/baselines/reference/asyncArrowFunction2_es6.js index c7e10b6f70cd4..34c355d9cd83d 100644 --- a/tests/baselines/reference/asyncArrowFunction2_es6.js +++ b/tests/baselines/reference/asyncArrowFunction2_es6.js @@ -5,5 +5,6 @@ var f = (await) => { } //// [asyncArrowFunction2_es6.js] +"use strict"; var f = (await) => { }; diff --git a/tests/baselines/reference/asyncArrowFunction3_es2017.js b/tests/baselines/reference/asyncArrowFunction3_es2017.js index e51841e43764b..28fbddf018e12 100644 --- a/tests/baselines/reference/asyncArrowFunction3_es2017.js +++ b/tests/baselines/reference/asyncArrowFunction3_es2017.js @@ -5,5 +5,6 @@ function f(await = await) { } //// [asyncArrowFunction3_es2017.js] +"use strict"; function f(await = await) { } diff --git a/tests/baselines/reference/asyncArrowFunction3_es5(target=es2015).js b/tests/baselines/reference/asyncArrowFunction3_es5(target=es2015).js index 68fe8338bebc0..885a7cb90e1f3 100644 --- a/tests/baselines/reference/asyncArrowFunction3_es5(target=es2015).js +++ b/tests/baselines/reference/asyncArrowFunction3_es5(target=es2015).js @@ -5,5 +5,6 @@ function f(await = await) { } //// [asyncArrowFunction3_es5.js] +"use strict"; function f(await = await) { } diff --git a/tests/baselines/reference/asyncArrowFunction3_es5(target=es5).js b/tests/baselines/reference/asyncArrowFunction3_es5(target=es5).js index 9d000b0d1a880..34d9b8f61488c 100644 --- a/tests/baselines/reference/asyncArrowFunction3_es5(target=es5).js +++ b/tests/baselines/reference/asyncArrowFunction3_es5(target=es5).js @@ -5,6 +5,7 @@ function f(await = await) { } //// [asyncArrowFunction3_es5.js] +"use strict"; function f(await) { if (await === void 0) { await = await; } } diff --git a/tests/baselines/reference/asyncArrowFunction3_es6.js b/tests/baselines/reference/asyncArrowFunction3_es6.js index 60aa9910e5abc..cb561e34194fd 100644 --- a/tests/baselines/reference/asyncArrowFunction3_es6.js +++ b/tests/baselines/reference/asyncArrowFunction3_es6.js @@ -5,5 +5,6 @@ function f(await = await) { } //// [asyncArrowFunction3_es6.js] +"use strict"; function f(await = await) { } diff --git a/tests/baselines/reference/asyncArrowFunction4_es2017.js b/tests/baselines/reference/asyncArrowFunction4_es2017.js index af9ef4449f81f..c883a2b1cb401 100644 --- a/tests/baselines/reference/asyncArrowFunction4_es2017.js +++ b/tests/baselines/reference/asyncArrowFunction4_es2017.js @@ -5,5 +5,6 @@ var await = () => { } //// [asyncArrowFunction4_es2017.js] +"use strict"; var await = () => { }; diff --git a/tests/baselines/reference/asyncArrowFunction4_es5(target=es2015).js b/tests/baselines/reference/asyncArrowFunction4_es5(target=es2015).js index 966093d5516eb..febca1da7039f 100644 --- a/tests/baselines/reference/asyncArrowFunction4_es5(target=es2015).js +++ b/tests/baselines/reference/asyncArrowFunction4_es5(target=es2015).js @@ -5,5 +5,6 @@ var await = () => { } //// [asyncArrowFunction4_es5.js] +"use strict"; var await = () => { }; diff --git a/tests/baselines/reference/asyncArrowFunction4_es5(target=es5).js b/tests/baselines/reference/asyncArrowFunction4_es5(target=es5).js index 36d3d52f6cd84..0f79ad017ca6a 100644 --- a/tests/baselines/reference/asyncArrowFunction4_es5(target=es5).js +++ b/tests/baselines/reference/asyncArrowFunction4_es5(target=es5).js @@ -5,5 +5,6 @@ var await = () => { } //// [asyncArrowFunction4_es5.js] +"use strict"; var await = function () { }; diff --git a/tests/baselines/reference/asyncArrowFunction4_es6.js b/tests/baselines/reference/asyncArrowFunction4_es6.js index 7e80f55f30bd5..3a39a462ee2e0 100644 --- a/tests/baselines/reference/asyncArrowFunction4_es6.js +++ b/tests/baselines/reference/asyncArrowFunction4_es6.js @@ -5,5 +5,6 @@ var await = () => { } //// [asyncArrowFunction4_es6.js] +"use strict"; var await = () => { }; diff --git a/tests/baselines/reference/asyncArrowFunction5_es2017.js b/tests/baselines/reference/asyncArrowFunction5_es2017.js index 62da22fa6d5ce..2bdb8fbb37ae0 100644 --- a/tests/baselines/reference/asyncArrowFunction5_es2017.js +++ b/tests/baselines/reference/asyncArrowFunction5_es2017.js @@ -5,5 +5,6 @@ var foo = async (await): Promise => { } //// [asyncArrowFunction5_es2017.js] +"use strict"; var foo = async (await) => { }; diff --git a/tests/baselines/reference/asyncArrowFunction5_es5(target=es2015).js b/tests/baselines/reference/asyncArrowFunction5_es5(target=es2015).js index 80f461b5b5ef9..ded4a059b67a6 100644 --- a/tests/baselines/reference/asyncArrowFunction5_es5(target=es2015).js +++ b/tests/baselines/reference/asyncArrowFunction5_es5(target=es2015).js @@ -5,5 +5,6 @@ var foo = async (await): Promise => { } //// [asyncArrowFunction5_es5.js] -var foo = (await) => __awaiter(this, void 0, void 0, function* () { +"use strict"; +var foo = (await) => __awaiter(void 0, void 0, void 0, function* () { }); diff --git a/tests/baselines/reference/asyncArrowFunction5_es5(target=es5).js b/tests/baselines/reference/asyncArrowFunction5_es5(target=es5).js index 395a3eebbc371..9460508412135 100644 --- a/tests/baselines/reference/asyncArrowFunction5_es5(target=es5).js +++ b/tests/baselines/reference/asyncArrowFunction5_es5(target=es5).js @@ -5,8 +5,8 @@ var foo = async (await): Promise => { } //// [asyncArrowFunction5_es5.js] -var _this = this; -var foo = function (await) { return __awaiter(_this, void 0, void 0, function () { +"use strict"; +var foo = function (await) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) { return [2 /*return*/]; }); diff --git a/tests/baselines/reference/asyncArrowFunction5_es6.js b/tests/baselines/reference/asyncArrowFunction5_es6.js index b42bc6709df62..9b6d33e70af35 100644 --- a/tests/baselines/reference/asyncArrowFunction5_es6.js +++ b/tests/baselines/reference/asyncArrowFunction5_es6.js @@ -5,5 +5,6 @@ var foo = async (await): Promise => { } //// [asyncArrowFunction5_es6.js] -var foo = (await) => __awaiter(this, void 0, void 0, function* () { +"use strict"; +var foo = (await) => __awaiter(void 0, void 0, void 0, function* () { }); diff --git a/tests/baselines/reference/asyncArrowFunction6_es2017.js b/tests/baselines/reference/asyncArrowFunction6_es2017.js index 09d610694f293..6dac6697d8b09 100644 --- a/tests/baselines/reference/asyncArrowFunction6_es2017.js +++ b/tests/baselines/reference/asyncArrowFunction6_es2017.js @@ -5,5 +5,6 @@ var foo = async (a = await): Promise => { } //// [asyncArrowFunction6_es2017.js] +"use strict"; var foo = async (a = await ) => { }; diff --git a/tests/baselines/reference/asyncArrowFunction6_es5(target=es2015).js b/tests/baselines/reference/asyncArrowFunction6_es5(target=es2015).js index 2e7f25010af40..39bd8e72baaa0 100644 --- a/tests/baselines/reference/asyncArrowFunction6_es5(target=es2015).js +++ b/tests/baselines/reference/asyncArrowFunction6_es5(target=es2015).js @@ -5,5 +5,6 @@ var foo = async (a = await): Promise => { } //// [asyncArrowFunction6_es5.js] -var foo = (...args_1) => __awaiter(this, [...args_1], void 0, function* (a = yield ) { +"use strict"; +var foo = (...args_1) => __awaiter(void 0, [...args_1], void 0, function* (a = yield ) { }); diff --git a/tests/baselines/reference/asyncArrowFunction6_es5(target=es5).js b/tests/baselines/reference/asyncArrowFunction6_es5(target=es5).js index 52cfc0427eca5..cae0dccce9712 100644 --- a/tests/baselines/reference/asyncArrowFunction6_es5(target=es5).js +++ b/tests/baselines/reference/asyncArrowFunction6_es5(target=es5).js @@ -5,13 +5,13 @@ var foo = async (a = await): Promise => { } //// [asyncArrowFunction6_es5.js] -var _this = this; +"use strict"; var foo = function () { var args_1 = []; for (var _i = 0; _i < arguments.length; _i++) { args_1[_i] = arguments[_i]; } - return __awaiter(_this, __spreadArray([], args_1, true), void 0, function (a) { + return __awaiter(void 0, __spreadArray([], args_1, true), void 0, function (a) { if (a === void 0) { a = _a.sent(); } return __generator(this, function (_a) { switch (_a.label) { diff --git a/tests/baselines/reference/asyncArrowFunction6_es6.js b/tests/baselines/reference/asyncArrowFunction6_es6.js index 4fc2e2b4113e7..5aa899524a0ac 100644 --- a/tests/baselines/reference/asyncArrowFunction6_es6.js +++ b/tests/baselines/reference/asyncArrowFunction6_es6.js @@ -5,5 +5,6 @@ var foo = async (a = await): Promise => { } //// [asyncArrowFunction6_es6.js] -var foo = (...args_1) => __awaiter(this, [...args_1], void 0, function* (a = yield ) { +"use strict"; +var foo = (...args_1) => __awaiter(void 0, [...args_1], void 0, function* (a = yield ) { }); diff --git a/tests/baselines/reference/asyncArrowFunction7_es2017.js b/tests/baselines/reference/asyncArrowFunction7_es2017.js index 5ed014d11f63a..dc100e55db51b 100644 --- a/tests/baselines/reference/asyncArrowFunction7_es2017.js +++ b/tests/baselines/reference/asyncArrowFunction7_es2017.js @@ -8,6 +8,7 @@ var bar = async (): Promise => { } //// [asyncArrowFunction7_es2017.js] +"use strict"; var bar = async () => { // 'await' here is an identifier, and not an await expression. var foo = async (a = await ) => { diff --git a/tests/baselines/reference/asyncArrowFunction7_es5(target=es2015).js b/tests/baselines/reference/asyncArrowFunction7_es5(target=es2015).js index e8b91e84dee15..700e038340b34 100644 --- a/tests/baselines/reference/asyncArrowFunction7_es5(target=es2015).js +++ b/tests/baselines/reference/asyncArrowFunction7_es5(target=es2015).js @@ -8,8 +8,9 @@ var bar = async (): Promise => { } //// [asyncArrowFunction7_es5.js] -var bar = () => __awaiter(this, void 0, void 0, function* () { +"use strict"; +var bar = () => __awaiter(void 0, void 0, void 0, function* () { // 'await' here is an identifier, and not an await expression. - var foo = (...args_1) => __awaiter(this, [...args_1], void 0, function* (a = yield ) { + var foo = (...args_1) => __awaiter(void 0, [...args_1], void 0, function* (a = yield ) { }); }); diff --git a/tests/baselines/reference/asyncArrowFunction7_es5(target=es5).js b/tests/baselines/reference/asyncArrowFunction7_es5(target=es5).js index 7144ebad6adaf..5e27c6dc23f3d 100644 --- a/tests/baselines/reference/asyncArrowFunction7_es5(target=es5).js +++ b/tests/baselines/reference/asyncArrowFunction7_es5(target=es5).js @@ -8,17 +8,16 @@ var bar = async (): Promise => { } //// [asyncArrowFunction7_es5.js] -var _this = this; -var bar = function () { return __awaiter(_this, void 0, void 0, function () { +"use strict"; +var bar = function () { return __awaiter(void 0, void 0, void 0, function () { var foo; - var _this = this; return __generator(this, function (_a) { foo = function () { var args_1 = []; for (var _i = 0; _i < arguments.length; _i++) { args_1[_i] = arguments[_i]; } - return __awaiter(_this, __spreadArray([], args_1, true), void 0, function (a) { + return __awaiter(void 0, __spreadArray([], args_1, true), void 0, function (a) { if (a === void 0) { a = _a.sent(); } return __generator(this, function (_a) { switch (_a.label) { diff --git a/tests/baselines/reference/asyncArrowFunction7_es6.js b/tests/baselines/reference/asyncArrowFunction7_es6.js index 7a1ee0eeef4b5..2d506c6e4f8dd 100644 --- a/tests/baselines/reference/asyncArrowFunction7_es6.js +++ b/tests/baselines/reference/asyncArrowFunction7_es6.js @@ -8,8 +8,9 @@ var bar = async (): Promise => { } //// [asyncArrowFunction7_es6.js] -var bar = () => __awaiter(this, void 0, void 0, function* () { +"use strict"; +var bar = () => __awaiter(void 0, void 0, void 0, function* () { // 'await' here is an identifier, and not an await expression. - var foo = (...args_1) => __awaiter(this, [...args_1], void 0, function* (a = yield ) { + var foo = (...args_1) => __awaiter(void 0, [...args_1], void 0, function* (a = yield ) { }); }); diff --git a/tests/baselines/reference/asyncArrowFunction8_es2017.js b/tests/baselines/reference/asyncArrowFunction8_es2017.js index de63a0ece0d90..9f9dfcb47d585 100644 --- a/tests/baselines/reference/asyncArrowFunction8_es2017.js +++ b/tests/baselines/reference/asyncArrowFunction8_es2017.js @@ -6,6 +6,7 @@ var foo = async (): Promise => { } //// [asyncArrowFunction8_es2017.js] +"use strict"; var foo = async () => { var v = { [await ]: foo }; }; diff --git a/tests/baselines/reference/asyncArrowFunction8_es5(target=es2015).js b/tests/baselines/reference/asyncArrowFunction8_es5(target=es2015).js index 22af0fe53083a..e7100b188a7dc 100644 --- a/tests/baselines/reference/asyncArrowFunction8_es5(target=es2015).js +++ b/tests/baselines/reference/asyncArrowFunction8_es5(target=es2015).js @@ -6,6 +6,7 @@ var foo = async (): Promise => { } //// [asyncArrowFunction8_es5.js] -var foo = () => __awaiter(this, void 0, void 0, function* () { +"use strict"; +var foo = () => __awaiter(void 0, void 0, void 0, function* () { var v = { [yield ]: foo }; }); diff --git a/tests/baselines/reference/asyncArrowFunction8_es5(target=es5).js b/tests/baselines/reference/asyncArrowFunction8_es5(target=es5).js index 8d1c8f0cb0e17..bac6b5df8ec7c 100644 --- a/tests/baselines/reference/asyncArrowFunction8_es5(target=es5).js +++ b/tests/baselines/reference/asyncArrowFunction8_es5(target=es5).js @@ -6,8 +6,8 @@ var foo = async (): Promise => { } //// [asyncArrowFunction8_es5.js] -var _this = this; -var foo = function () { return __awaiter(_this, void 0, void 0, function () { +"use strict"; +var foo = function () { return __awaiter(void 0, void 0, void 0, function () { var v; var _a; return __generator(this, function (_b) { diff --git a/tests/baselines/reference/asyncArrowFunction8_es6.js b/tests/baselines/reference/asyncArrowFunction8_es6.js index 951d39b867390..3233fb47a52af 100644 --- a/tests/baselines/reference/asyncArrowFunction8_es6.js +++ b/tests/baselines/reference/asyncArrowFunction8_es6.js @@ -6,6 +6,7 @@ var foo = async (): Promise => { } //// [asyncArrowFunction8_es6.js] -var foo = () => __awaiter(this, void 0, void 0, function* () { +"use strict"; +var foo = () => __awaiter(void 0, void 0, void 0, function* () { var v = { [yield ]: foo }; }); diff --git a/tests/baselines/reference/asyncArrowFunction9_es2017.js b/tests/baselines/reference/asyncArrowFunction9_es2017.js index 3f2cc6c9f69a7..2537d5ae18832 100644 --- a/tests/baselines/reference/asyncArrowFunction9_es2017.js +++ b/tests/baselines/reference/asyncArrowFunction9_es2017.js @@ -5,6 +5,7 @@ var foo = async (a = await => await): Promise => { } //// [asyncArrowFunction9_es2017.js] +"use strict"; var foo = async(a = await => await), Promise; ; { diff --git a/tests/baselines/reference/asyncArrowFunction9_es5(target=es2015).js b/tests/baselines/reference/asyncArrowFunction9_es5(target=es2015).js index 159225679709d..b5382a2974b8b 100644 --- a/tests/baselines/reference/asyncArrowFunction9_es5(target=es2015).js +++ b/tests/baselines/reference/asyncArrowFunction9_es5(target=es2015).js @@ -5,6 +5,7 @@ var foo = async (a = await => await): Promise => { } //// [asyncArrowFunction9_es5.js] +"use strict"; var foo = async(a = await => await), Promise; ; { diff --git a/tests/baselines/reference/asyncArrowFunction9_es5(target=es5).js b/tests/baselines/reference/asyncArrowFunction9_es5(target=es5).js index 8128f216ddcd6..8e6c2ebb2ad72 100644 --- a/tests/baselines/reference/asyncArrowFunction9_es5(target=es5).js +++ b/tests/baselines/reference/asyncArrowFunction9_es5(target=es5).js @@ -5,6 +5,7 @@ var foo = async (a = await => await): Promise => { } //// [asyncArrowFunction9_es5.js] +"use strict"; var foo = async(a = function (await) { return await; }), Promise; ; { diff --git a/tests/baselines/reference/asyncArrowFunction9_es6.js b/tests/baselines/reference/asyncArrowFunction9_es6.js index a9341bfb68cac..0e8b8ff9456ae 100644 --- a/tests/baselines/reference/asyncArrowFunction9_es6.js +++ b/tests/baselines/reference/asyncArrowFunction9_es6.js @@ -5,6 +5,7 @@ var foo = async (a = await => await): Promise => { } //// [asyncArrowFunction9_es6.js] +"use strict"; var foo = async(a = await => await), Promise; ; { diff --git a/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es2017.errors.txt b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es2017.errors.txt new file mode 100644 index 0000000000000..3860fe3e9cadc --- /dev/null +++ b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es2017.errors.txt @@ -0,0 +1,13 @@ +asyncArrowFunctionCapturesArguments_es2017.ts(4,52): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[]'. + + +==== asyncArrowFunctionCapturesArguments_es2017.ts (1 errors) ==== + class C { + method() { + function other() {} + var fn = async () => await other.apply(this, arguments); + ~~~~~~~~~ +!!! error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[]'. + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es2017.js b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es2017.js index 55a9decaf245c..b9528cded99f0 100644 --- a/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es2017.js +++ b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es2017.js @@ -10,6 +10,7 @@ class C { //// [asyncArrowFunctionCapturesArguments_es2017.js] +"use strict"; class C { method() { function other() { } diff --git a/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es2017.symbols b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es2017.symbols index 4425e8bc28d96..d53e21fdeaede 100644 --- a/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es2017.symbols +++ b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es2017.symbols @@ -12,9 +12,9 @@ class C { var fn = async () => await other.apply(this, arguments); >fn : Symbol(fn, Decl(asyncArrowFunctionCapturesArguments_es2017.ts, 3, 9)) ->other.apply : Symbol(Function.apply, Decl(lib.es5.d.ts, --, --)) +>other.apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >other : Symbol(other, Decl(asyncArrowFunctionCapturesArguments_es2017.ts, 1, 13)) ->apply : Symbol(Function.apply, Decl(lib.es5.d.ts, --, --)) +>apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >this : Symbol(C, Decl(asyncArrowFunctionCapturesArguments_es2017.ts, 0, 0)) >arguments : Symbol(arguments) } diff --git a/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es2017.types b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es2017.types index c04c36f711283..1f6fbcf53c412 100644 --- a/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es2017.types +++ b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es2017.types @@ -14,18 +14,20 @@ class C { > : ^^^^^^^^^^ var fn = async () => await other.apply(this, arguments); ->fn : () => Promise -> : ^^^^^^^^^^^^^^^^^^ ->async () => await other.apply(this, arguments) : () => Promise -> : ^^^^^^^^^^^^^^^^^^ ->await other.apply(this, arguments) : any ->other.apply(this, arguments) : any ->other.apply : (this: Function, thisArg: any, argArray?: any) => any -> : ^ ^^ ^^ ^^ ^^ ^^^ ^^^^^ +>fn : () => Promise +> : ^^^^^^^^^^^^^^^^^^^ +>async () => await other.apply(this, arguments) : () => Promise +> : ^^^^^^^^^^^^^^^^^^^ +>await other.apply(this, arguments) : void +> : ^^^^ +>other.apply(this, arguments) : void +> : ^^^^ +>other.apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } +> : ^^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ >other : () => void > : ^^^^^^^^^^ ->apply : (this: Function, thisArg: any, argArray?: any) => any -> : ^ ^^ ^^ ^^ ^^ ^^^ ^^^^^ +>apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } +> : ^^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ >this : this > : ^^^^ >arguments : IArguments diff --git a/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es5(target=es2015).errors.txt b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es5(target=es2015).errors.txt new file mode 100644 index 0000000000000..408df1a7231b0 --- /dev/null +++ b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es5(target=es2015).errors.txt @@ -0,0 +1,13 @@ +asyncArrowFunctionCapturesArguments_es5.ts(4,52): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[]'. + + +==== asyncArrowFunctionCapturesArguments_es5.ts (1 errors) ==== + class C { + method() { + function other() {} + var fn = async () => await other.apply(this, arguments); + ~~~~~~~~~ +!!! error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[]'. + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es5(target=es2015).js b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es5(target=es2015).js index 71eb0146ac930..2d27329cee99f 100644 --- a/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es5(target=es2015).js +++ b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es5(target=es2015).js @@ -10,6 +10,7 @@ class C { //// [asyncArrowFunctionCapturesArguments_es5.js] +"use strict"; class C { method() { function other() { } diff --git a/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es5(target=es2015).symbols b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es5(target=es2015).symbols index 4c7ec6afe1296..c2a826e3ff498 100644 --- a/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es5(target=es2015).symbols +++ b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es5(target=es2015).symbols @@ -12,9 +12,9 @@ class C { var fn = async () => await other.apply(this, arguments); >fn : Symbol(fn, Decl(asyncArrowFunctionCapturesArguments_es5.ts, 3, 9)) ->other.apply : Symbol(Function.apply, Decl(lib.es5.d.ts, --, --)) +>other.apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >other : Symbol(other, Decl(asyncArrowFunctionCapturesArguments_es5.ts, 1, 13)) ->apply : Symbol(Function.apply, Decl(lib.es5.d.ts, --, --)) +>apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >this : Symbol(C, Decl(asyncArrowFunctionCapturesArguments_es5.ts, 0, 0)) >arguments : Symbol(arguments) } diff --git a/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es5(target=es2015).types b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es5(target=es2015).types index 28155cec6f6c8..8d83d4969a928 100644 --- a/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es5(target=es2015).types +++ b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es5(target=es2015).types @@ -14,18 +14,20 @@ class C { > : ^^^^^^^^^^ var fn = async () => await other.apply(this, arguments); ->fn : () => Promise -> : ^^^^^^^^^^^^^^^^^^ ->async () => await other.apply(this, arguments) : () => Promise -> : ^^^^^^^^^^^^^^^^^^ ->await other.apply(this, arguments) : any ->other.apply(this, arguments) : any ->other.apply : (this: Function, thisArg: any, argArray?: any) => any -> : ^ ^^ ^^ ^^ ^^ ^^^ ^^^^^ +>fn : () => Promise +> : ^^^^^^^^^^^^^^^^^^^ +>async () => await other.apply(this, arguments) : () => Promise +> : ^^^^^^^^^^^^^^^^^^^ +>await other.apply(this, arguments) : void +> : ^^^^ +>other.apply(this, arguments) : void +> : ^^^^ +>other.apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } +> : ^^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ >other : () => void > : ^^^^^^^^^^ ->apply : (this: Function, thisArg: any, argArray?: any) => any -> : ^ ^^ ^^ ^^ ^^ ^^^ ^^^^^ +>apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } +> : ^^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ >this : this > : ^^^^ >arguments : IArguments diff --git a/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es5(target=es5).errors.txt b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es5(target=es5).errors.txt index f83125a493853..bce95f1bff9af 100644 --- a/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es5(target=es5).errors.txt +++ b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es5(target=es5).errors.txt @@ -1,14 +1,17 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +asyncArrowFunctionCapturesArguments_es5.ts(4,52): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[]'. asyncArrowFunctionCapturesArguments_es5.ts(4,52): error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== asyncArrowFunctionCapturesArguments_es5.ts (1 errors) ==== +==== asyncArrowFunctionCapturesArguments_es5.ts (2 errors) ==== class C { method() { function other() {} var fn = async () => await other.apply(this, arguments); ~~~~~~~~~ +!!! error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[]'. + ~~~~~~~~~ !!! error TS2496: The 'arguments' object cannot be referenced in an arrow function in ES5. Consider using a standard function expression. } } diff --git a/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es5(target=es5).js b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es5(target=es5).js index 5594f77accd7e..1d954adc1cef5 100644 --- a/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es5(target=es5).js +++ b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es5(target=es5).js @@ -10,6 +10,7 @@ class C { //// [asyncArrowFunctionCapturesArguments_es5.js] +"use strict"; var C = /** @class */ (function () { function C() { } diff --git a/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es5(target=es5).symbols b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es5(target=es5).symbols index 4c7ec6afe1296..c2a826e3ff498 100644 --- a/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es5(target=es5).symbols +++ b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es5(target=es5).symbols @@ -12,9 +12,9 @@ class C { var fn = async () => await other.apply(this, arguments); >fn : Symbol(fn, Decl(asyncArrowFunctionCapturesArguments_es5.ts, 3, 9)) ->other.apply : Symbol(Function.apply, Decl(lib.es5.d.ts, --, --)) +>other.apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >other : Symbol(other, Decl(asyncArrowFunctionCapturesArguments_es5.ts, 1, 13)) ->apply : Symbol(Function.apply, Decl(lib.es5.d.ts, --, --)) +>apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >this : Symbol(C, Decl(asyncArrowFunctionCapturesArguments_es5.ts, 0, 0)) >arguments : Symbol(arguments) } diff --git a/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es5(target=es5).types b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es5(target=es5).types index be3cc5d3315cb..8d83d4969a928 100644 --- a/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es5(target=es5).types +++ b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es5(target=es5).types @@ -14,20 +14,20 @@ class C { > : ^^^^^^^^^^ var fn = async () => await other.apply(this, arguments); ->fn : () => Promise -> : ^^^^^^^^^^^^^^^^^^ ->async () => await other.apply(this, arguments) : () => Promise -> : ^^^^^^^^^^^^^^^^^^ ->await other.apply(this, arguments) : any -> : ^^^ ->other.apply(this, arguments) : any -> : ^^^ ->other.apply : (this: Function, thisArg: any, argArray?: any) => any -> : ^ ^^ ^^ ^^ ^^ ^^^ ^^^^^ +>fn : () => Promise +> : ^^^^^^^^^^^^^^^^^^^ +>async () => await other.apply(this, arguments) : () => Promise +> : ^^^^^^^^^^^^^^^^^^^ +>await other.apply(this, arguments) : void +> : ^^^^ +>other.apply(this, arguments) : void +> : ^^^^ +>other.apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } +> : ^^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ >other : () => void > : ^^^^^^^^^^ ->apply : (this: Function, thisArg: any, argArray?: any) => any -> : ^ ^^ ^^ ^^ ^^ ^^^ ^^^^^ +>apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } +> : ^^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ >this : this > : ^^^^ >arguments : IArguments diff --git a/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es6.errors.txt b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es6.errors.txt new file mode 100644 index 0000000000000..23917e19b0c2b --- /dev/null +++ b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es6.errors.txt @@ -0,0 +1,16 @@ +asyncArrowFunctionCapturesArguments_es6.ts(4,52): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[]'. + + +==== asyncArrowFunctionCapturesArguments_es6.ts (1 errors) ==== + class C { + method() { + function other() {} + var fn = async () => await other.apply(this, arguments); + ~~~~~~~~~ +!!! error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[]'. + } + } + + function f() { + return async () => async () => arguments.length; + } \ No newline at end of file diff --git a/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es6.js b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es6.js index ae0db7fbe7cca..32b544bfa2d34 100644 --- a/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es6.js +++ b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es6.js @@ -13,6 +13,7 @@ function f() { } //// [asyncArrowFunctionCapturesArguments_es6.js] +"use strict"; class C { method() { function other() { } diff --git a/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es6.symbols b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es6.symbols index dd1e59a5d8360..fbb0e710d5c2c 100644 --- a/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es6.symbols +++ b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es6.symbols @@ -12,9 +12,9 @@ class C { var fn = async () => await other.apply(this, arguments); >fn : Symbol(fn, Decl(asyncArrowFunctionCapturesArguments_es6.ts, 3, 9)) ->other.apply : Symbol(Function.apply, Decl(lib.es5.d.ts, --, --)) +>other.apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >other : Symbol(other, Decl(asyncArrowFunctionCapturesArguments_es6.ts, 1, 13)) ->apply : Symbol(Function.apply, Decl(lib.es5.d.ts, --, --)) +>apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >this : Symbol(C, Decl(asyncArrowFunctionCapturesArguments_es6.ts, 0, 0)) >arguments : Symbol(arguments) } diff --git a/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es6.types b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es6.types index 80094228b3949..2874f001bcbce 100644 --- a/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es6.types +++ b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es6.types @@ -14,18 +14,20 @@ class C { > : ^^^^^^^^^^ var fn = async () => await other.apply(this, arguments); ->fn : () => Promise -> : ^^^^^^^^^^^^^^^^^^ ->async () => await other.apply(this, arguments) : () => Promise -> : ^^^^^^^^^^^^^^^^^^ ->await other.apply(this, arguments) : any ->other.apply(this, arguments) : any ->other.apply : (this: Function, thisArg: any, argArray?: any) => any -> : ^ ^^ ^^ ^^ ^^ ^^^ ^^^^^ +>fn : () => Promise +> : ^^^^^^^^^^^^^^^^^^^ +>async () => await other.apply(this, arguments) : () => Promise +> : ^^^^^^^^^^^^^^^^^^^ +>await other.apply(this, arguments) : void +> : ^^^^ +>other.apply(this, arguments) : void +> : ^^^^ +>other.apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } +> : ^^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ >other : () => void > : ^^^^^^^^^^ ->apply : (this: Function, thisArg: any, argArray?: any) => any -> : ^ ^^ ^^ ^^ ^^ ^^^ ^^^^^ +>apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } +> : ^^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ >this : this > : ^^^^ >arguments : IArguments diff --git a/tests/baselines/reference/asyncArrowFunctionCapturesThis_es2017.js b/tests/baselines/reference/asyncArrowFunctionCapturesThis_es2017.js index 92b716f2ec4a4..40deb3a514dec 100644 --- a/tests/baselines/reference/asyncArrowFunctionCapturesThis_es2017.js +++ b/tests/baselines/reference/asyncArrowFunctionCapturesThis_es2017.js @@ -9,6 +9,7 @@ class C { //// [asyncArrowFunctionCapturesThis_es2017.js] +"use strict"; class C { method() { var fn = async () => await this; diff --git a/tests/baselines/reference/asyncArrowFunctionCapturesThis_es5(target=es2015).js b/tests/baselines/reference/asyncArrowFunctionCapturesThis_es5(target=es2015).js index 8bc3c65f18db4..0f4c66be09f6b 100644 --- a/tests/baselines/reference/asyncArrowFunctionCapturesThis_es5(target=es2015).js +++ b/tests/baselines/reference/asyncArrowFunctionCapturesThis_es5(target=es2015).js @@ -9,6 +9,7 @@ class C { //// [asyncArrowFunctionCapturesThis_es5.js] +"use strict"; class C { method() { var fn = () => __awaiter(this, void 0, void 0, function* () { return yield this; }); diff --git a/tests/baselines/reference/asyncArrowFunctionCapturesThis_es5(target=es5).js b/tests/baselines/reference/asyncArrowFunctionCapturesThis_es5(target=es5).js index 4d275a70215f0..a4aa548a950e6 100644 --- a/tests/baselines/reference/asyncArrowFunctionCapturesThis_es5(target=es5).js +++ b/tests/baselines/reference/asyncArrowFunctionCapturesThis_es5(target=es5).js @@ -9,6 +9,7 @@ class C { //// [asyncArrowFunctionCapturesThis_es5.js] +"use strict"; var C = /** @class */ (function () { function C() { } diff --git a/tests/baselines/reference/asyncArrowFunctionCapturesThis_es6.js b/tests/baselines/reference/asyncArrowFunctionCapturesThis_es6.js index 1dd42adfc0339..cea268b11efc7 100644 --- a/tests/baselines/reference/asyncArrowFunctionCapturesThis_es6.js +++ b/tests/baselines/reference/asyncArrowFunctionCapturesThis_es6.js @@ -9,6 +9,7 @@ class C { //// [asyncArrowFunctionCapturesThis_es6.js] +"use strict"; class C { method() { var fn = () => __awaiter(this, void 0, void 0, function* () { return yield this; }); diff --git a/tests/baselines/reference/asyncArrowInClassES5(target=es2015).js b/tests/baselines/reference/asyncArrowInClassES5(target=es2015).js index 620d202e6ab00..f9d2c9295a9f2 100644 --- a/tests/baselines/reference/asyncArrowInClassES5(target=es2015).js +++ b/tests/baselines/reference/asyncArrowInClassES5(target=es2015).js @@ -10,10 +10,11 @@ class Test { //// [asyncArrowInClassES5.js] +"use strict"; // https://github.com/Microsoft/TypeScript/issues/16924 // Should capture `this` var _a; class Test { } _a = Test; -Test.member = (x) => __awaiter(_a, void 0, void 0, function* () { }); +Test.member = (x) => __awaiter(void 0, void 0, void 0, function* () { }); diff --git a/tests/baselines/reference/asyncArrowInClassES5(target=es5).js b/tests/baselines/reference/asyncArrowInClassES5(target=es5).js index d844b4310a8f8..c46faccdb5fd5 100644 --- a/tests/baselines/reference/asyncArrowInClassES5(target=es5).js +++ b/tests/baselines/reference/asyncArrowInClassES5(target=es5).js @@ -10,6 +10,7 @@ class Test { //// [asyncArrowInClassES5.js] +"use strict"; // https://github.com/Microsoft/TypeScript/issues/16924 // Should capture `this` var Test = /** @class */ (function () { @@ -17,7 +18,7 @@ var Test = /** @class */ (function () { } var _a; _a = Test; - Test.member = function (x) { return __awaiter(_a, void 0, void 0, function () { return __generator(_a, function (_b) { + Test.member = function (x) { return __awaiter(void 0, void 0, void 0, function () { return __generator(_a, function (_b) { return [2 /*return*/]; }); }); }; return Test; diff --git a/tests/baselines/reference/asyncAwaitNestedClasses_es5(target=es2015).errors.txt b/tests/baselines/reference/asyncAwaitNestedClasses_es5(target=es2015).errors.txt new file mode 100644 index 0000000000000..c6d366b3b1d31 --- /dev/null +++ b/tests/baselines/reference/asyncAwaitNestedClasses_es5(target=es2015).errors.txt @@ -0,0 +1,21 @@ +asyncAwaitNestedClasses_es5.ts(5,55): error TS2345: Argument of type 'null' is not assignable to parameter of type 'void | PromiseLike'. + + +==== asyncAwaitNestedClasses_es5.ts (1 errors) ==== + // https://github.com/Microsoft/TypeScript/issues/20744 + class A { + static B = class B { + static func2(): Promise { + return new Promise((resolve) => { resolve(null); }); + ~~~~ +!!! error TS2345: Argument of type 'null' is not assignable to parameter of type 'void | PromiseLike'. + } + static C = class C { + static async func() { + await B.func2(); + } + } + } + } + + A.B.C.func(); \ No newline at end of file diff --git a/tests/baselines/reference/asyncAwaitNestedClasses_es5(target=es2015).js b/tests/baselines/reference/asyncAwaitNestedClasses_es5(target=es2015).js index 52e101f25d4f4..a6b88c3068ee5 100644 --- a/tests/baselines/reference/asyncAwaitNestedClasses_es5(target=es2015).js +++ b/tests/baselines/reference/asyncAwaitNestedClasses_es5(target=es2015).js @@ -18,6 +18,7 @@ class A { A.B.C.func(); //// [asyncAwaitNestedClasses_es5.js] +"use strict"; var _a; // https://github.com/Microsoft/TypeScript/issues/20744 class A { diff --git a/tests/baselines/reference/asyncAwaitNestedClasses_es5(target=es5).errors.txt b/tests/baselines/reference/asyncAwaitNestedClasses_es5(target=es5).errors.txt index 82510e3d9f7b0..432f152f87d29 100644 --- a/tests/baselines/reference/asyncAwaitNestedClasses_es5(target=es5).errors.txt +++ b/tests/baselines/reference/asyncAwaitNestedClasses_es5(target=es5).errors.txt @@ -1,13 +1,16 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +asyncAwaitNestedClasses_es5.ts(5,55): error TS2345: Argument of type 'null' is not assignable to parameter of type 'void | PromiseLike'. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== asyncAwaitNestedClasses_es5.ts (0 errors) ==== +==== asyncAwaitNestedClasses_es5.ts (1 errors) ==== // https://github.com/Microsoft/TypeScript/issues/20744 class A { static B = class B { static func2(): Promise { return new Promise((resolve) => { resolve(null); }); + ~~~~ +!!! error TS2345: Argument of type 'null' is not assignable to parameter of type 'void | PromiseLike'. } static C = class C { static async func() { diff --git a/tests/baselines/reference/asyncAwaitNestedClasses_es5(target=es5).js b/tests/baselines/reference/asyncAwaitNestedClasses_es5(target=es5).js index 01404f9e6a65f..23ffbdae132e0 100644 --- a/tests/baselines/reference/asyncAwaitNestedClasses_es5(target=es5).js +++ b/tests/baselines/reference/asyncAwaitNestedClasses_es5(target=es5).js @@ -18,6 +18,7 @@ class A { A.B.C.func(); //// [asyncAwaitNestedClasses_es5.js] +"use strict"; // https://github.com/Microsoft/TypeScript/issues/20744 var A = /** @class */ (function () { function A() { diff --git a/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar(target=es2015).errors.txt b/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar(target=es2015).errors.txt new file mode 100644 index 0000000000000..09315a1f94446 --- /dev/null +++ b/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar(target=es2015).errors.txt @@ -0,0 +1,41 @@ +asyncAwaitWithCapturedBlockScopeVar.ts(27,23): error TS2366: Function lacks ending return statement and return type does not include 'undefined'. + + +==== asyncAwaitWithCapturedBlockScopeVar.ts (1 errors) ==== + async function fn1() { + let ar = []; + for (let i = 0; i < 1; i++) { + await 1; + ar.push(() => i); + } + } + + async function fn2() { + let ar = []; + for (let i = 0; i < 1; i++) { + await 1; + ar.push(() => i); + break; + } + } + + async function fn3() { + let ar = []; + for (let i = 0; i < 1; i++) { + await 1; + ar.push(() => i); + continue; + } + } + + async function fn4(): Promise { + ~~~~~~~~~~~~~~~ +!!! error TS2366: Function lacks ending return statement and return type does not include 'undefined'. + let ar = []; + for (let i = 0; i < 1; i++) { + await 1; + ar.push(() => i); + return 1; + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar(target=es2015).js b/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar(target=es2015).js index e642cb7d3ecef..279d6f50dc496 100644 --- a/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar(target=es2015).js +++ b/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar(target=es2015).js @@ -38,6 +38,7 @@ async function fn4(): Promise { //// [asyncAwaitWithCapturedBlockScopeVar.js] +"use strict"; function fn1() { return __awaiter(this, void 0, void 0, function* () { let ar = []; diff --git a/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar(target=es2015).types b/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar(target=es2015).types index 8eb9fd04ffec4..a392d1c71c25f 100644 --- a/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar(target=es2015).types +++ b/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar(target=es2015).types @@ -8,8 +8,8 @@ async function fn1() { let ar = []; >ar : any[] > : ^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ for (let i = 0; i < 1; i++) { >i : number @@ -56,8 +56,8 @@ async function fn2() { let ar = []; >ar : any[] > : ^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ for (let i = 0; i < 1; i++) { >i : number @@ -106,8 +106,8 @@ async function fn3() { let ar = []; >ar : any[] > : ^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ for (let i = 0; i < 1; i++) { >i : number @@ -156,8 +156,8 @@ async function fn4(): Promise { let ar = []; >ar : any[] > : ^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ for (let i = 0; i < 1; i++) { >i : number diff --git a/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar(target=es5).errors.txt b/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar(target=es5).errors.txt index 4b12e40312346..ba7c0b5ef7923 100644 --- a/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar(target=es5).errors.txt +++ b/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar(target=es5).errors.txt @@ -1,8 +1,9 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +asyncAwaitWithCapturedBlockScopeVar.ts(27,23): error TS2366: Function lacks ending return statement and return type does not include 'undefined'. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== asyncAwaitWithCapturedBlockScopeVar.ts (0 errors) ==== +==== asyncAwaitWithCapturedBlockScopeVar.ts (1 errors) ==== async function fn1() { let ar = []; for (let i = 0; i < 1; i++) { @@ -30,6 +31,8 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in Typ } async function fn4(): Promise { + ~~~~~~~~~~~~~~~ +!!! error TS2366: Function lacks ending return statement and return type does not include 'undefined'. let ar = []; for (let i = 0; i < 1; i++) { await 1; diff --git a/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar(target=es5).js b/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar(target=es5).js index fc8ef4ee2503f..aaa0f142ca11c 100644 --- a/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar(target=es5).js +++ b/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar(target=es5).js @@ -38,6 +38,7 @@ async function fn4(): Promise { //// [asyncAwaitWithCapturedBlockScopeVar.js] +"use strict"; function fn1() { return __awaiter(this, void 0, void 0, function () { var ar, _loop_1, i; diff --git a/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar(target=es5).types b/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar(target=es5).types index 8eb9fd04ffec4..a392d1c71c25f 100644 --- a/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar(target=es5).types +++ b/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar(target=es5).types @@ -8,8 +8,8 @@ async function fn1() { let ar = []; >ar : any[] > : ^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ for (let i = 0; i < 1; i++) { >i : number @@ -56,8 +56,8 @@ async function fn2() { let ar = []; >ar : any[] > : ^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ for (let i = 0; i < 1; i++) { >i : number @@ -106,8 +106,8 @@ async function fn3() { let ar = []; >ar : any[] > : ^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ for (let i = 0; i < 1; i++) { >i : number @@ -156,8 +156,8 @@ async function fn4(): Promise { let ar = []; >ar : any[] > : ^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ for (let i = 0; i < 1; i++) { >i : number diff --git a/tests/baselines/reference/asyncAwait_es2017.js b/tests/baselines/reference/asyncAwait_es2017.js index bd019a8dba892..61fc4994b0978 100644 --- a/tests/baselines/reference/asyncAwait_es2017.js +++ b/tests/baselines/reference/asyncAwait_es2017.js @@ -49,6 +49,7 @@ async function f14() { } //// [asyncAwait_es2017.js] +"use strict"; async function f0() { } async function f1() { } async function f3() { } diff --git a/tests/baselines/reference/asyncAwait_es5(target=es2015).js b/tests/baselines/reference/asyncAwait_es5(target=es2015).js index b54a4c18c0fc4..10418903a58bb 100644 --- a/tests/baselines/reference/asyncAwait_es5(target=es2015).js +++ b/tests/baselines/reference/asyncAwait_es5(target=es2015).js @@ -49,6 +49,7 @@ async function f14() { } //// [asyncAwait_es5.js] +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { @@ -76,13 +77,13 @@ let f5 = function () { let f6 = function () { return __awaiter(this, void 0, void 0, function* () { }); }; -let f7 = () => __awaiter(this, void 0, void 0, function* () { }); -let f8 = () => __awaiter(this, void 0, void 0, function* () { }); -let f9 = () => __awaiter(this, void 0, void 0, function* () { }); -let f10 = () => __awaiter(this, void 0, void 0, function* () { return p; }); -let f11 = () => __awaiter(this, void 0, void 0, function* () { return mp; }); -let f12 = () => __awaiter(this, void 0, void 0, function* () { return mp; }); -let f13 = () => __awaiter(this, void 0, void 0, function* () { return p; }); +let f7 = () => __awaiter(void 0, void 0, void 0, function* () { }); +let f8 = () => __awaiter(void 0, void 0, void 0, function* () { }); +let f9 = () => __awaiter(void 0, void 0, void 0, function* () { }); +let f10 = () => __awaiter(void 0, void 0, void 0, function* () { return p; }); +let f11 = () => __awaiter(void 0, void 0, void 0, function* () { return mp; }); +let f12 = () => __awaiter(void 0, void 0, void 0, function* () { return mp; }); +let f13 = () => __awaiter(void 0, void 0, void 0, function* () { return p; }); let o = { m1() { return __awaiter(this, void 0, void 0, function* () { }); diff --git a/tests/baselines/reference/asyncAwait_es5(target=es5).js b/tests/baselines/reference/asyncAwait_es5(target=es5).js index 1da4aa3c60ee7..cb3ccae780530 100644 --- a/tests/baselines/reference/asyncAwait_es5(target=es5).js +++ b/tests/baselines/reference/asyncAwait_es5(target=es5).js @@ -49,6 +49,7 @@ async function f14() { } //// [asyncAwait_es5.js] +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { @@ -85,7 +86,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) { if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } }; -var _this = this; function f0() { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { return [2 /*return*/]; @@ -116,25 +116,25 @@ var f6 = function () { return [2 /*return*/]; }); }); }; -var f7 = function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { +var f7 = function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) { return [2 /*return*/]; }); }); }; -var f8 = function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { +var f8 = function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) { return [2 /*return*/]; }); }); }; -var f9 = function () { return __awaiter(_this, void 0, MyPromise, function () { return __generator(this, function (_a) { +var f9 = function () { return __awaiter(void 0, void 0, MyPromise, function () { return __generator(this, function (_a) { return [2 /*return*/]; }); }); }; -var f10 = function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { +var f10 = function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) { return [2 /*return*/, p]; }); }); }; -var f11 = function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { +var f11 = function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) { return [2 /*return*/, mp]; }); }); }; -var f12 = function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { +var f12 = function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) { return [2 /*return*/, mp]; }); }); }; -var f13 = function () { return __awaiter(_this, void 0, MyPromise, function () { return __generator(this, function (_a) { +var f13 = function () { return __awaiter(void 0, void 0, MyPromise, function () { return __generator(this, function (_a) { return [2 /*return*/, p]; }); }); }; var o = { diff --git a/tests/baselines/reference/asyncAwait_es6.js b/tests/baselines/reference/asyncAwait_es6.js index 26e2ddc1c5e79..a4571ec7f0fcf 100644 --- a/tests/baselines/reference/asyncAwait_es6.js +++ b/tests/baselines/reference/asyncAwait_es6.js @@ -49,6 +49,7 @@ async function f14() { } //// [asyncAwait_es6.js] +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { @@ -76,13 +77,13 @@ let f5 = function () { let f6 = function () { return __awaiter(this, void 0, void 0, function* () { }); }; -let f7 = () => __awaiter(this, void 0, void 0, function* () { }); -let f8 = () => __awaiter(this, void 0, void 0, function* () { }); -let f9 = () => __awaiter(this, void 0, void 0, function* () { }); -let f10 = () => __awaiter(this, void 0, void 0, function* () { return p; }); -let f11 = () => __awaiter(this, void 0, void 0, function* () { return mp; }); -let f12 = () => __awaiter(this, void 0, void 0, function* () { return mp; }); -let f13 = () => __awaiter(this, void 0, void 0, function* () { return p; }); +let f7 = () => __awaiter(void 0, void 0, void 0, function* () { }); +let f8 = () => __awaiter(void 0, void 0, void 0, function* () { }); +let f9 = () => __awaiter(void 0, void 0, void 0, function* () { }); +let f10 = () => __awaiter(void 0, void 0, void 0, function* () { return p; }); +let f11 = () => __awaiter(void 0, void 0, void 0, function* () { return mp; }); +let f12 = () => __awaiter(void 0, void 0, void 0, function* () { return mp; }); +let f13 = () => __awaiter(void 0, void 0, void 0, function* () { return p; }); let o = { m1() { return __awaiter(this, void 0, void 0, function* () { }); diff --git a/tests/baselines/reference/asyncClass_es5(target=es2015).js b/tests/baselines/reference/asyncClass_es5(target=es2015).js index 709734d55b28f..421253f21d399 100644 --- a/tests/baselines/reference/asyncClass_es5(target=es2015).js +++ b/tests/baselines/reference/asyncClass_es5(target=es2015).js @@ -5,5 +5,6 @@ async class C { } //// [asyncClass_es5.js] +"use strict"; class C { } diff --git a/tests/baselines/reference/asyncClass_es5(target=es5).js b/tests/baselines/reference/asyncClass_es5(target=es5).js index 98230308f700b..6fb48a1ea0f37 100644 --- a/tests/baselines/reference/asyncClass_es5(target=es5).js +++ b/tests/baselines/reference/asyncClass_es5(target=es5).js @@ -5,6 +5,7 @@ async class C { } //// [asyncClass_es5.js] +"use strict"; var C = /** @class */ (function () { function C() { } diff --git a/tests/baselines/reference/asyncClass_es6.js b/tests/baselines/reference/asyncClass_es6.js index 505e8f45758dd..050452b858649 100644 --- a/tests/baselines/reference/asyncClass_es6.js +++ b/tests/baselines/reference/asyncClass_es6.js @@ -5,5 +5,6 @@ async class C { } //// [asyncClass_es6.js] +"use strict"; class C { } diff --git a/tests/baselines/reference/asyncConstructor_es5(target=es2015).js b/tests/baselines/reference/asyncConstructor_es5(target=es2015).js index 369b2efb83580..aef4560e7cb1d 100644 --- a/tests/baselines/reference/asyncConstructor_es5(target=es2015).js +++ b/tests/baselines/reference/asyncConstructor_es5(target=es2015).js @@ -7,6 +7,7 @@ class C { } //// [asyncConstructor_es5.js] +"use strict"; class C { constructor() { } diff --git a/tests/baselines/reference/asyncConstructor_es5(target=es5).js b/tests/baselines/reference/asyncConstructor_es5(target=es5).js index ad26e50f1ba3b..e8ea8802f728c 100644 --- a/tests/baselines/reference/asyncConstructor_es5(target=es5).js +++ b/tests/baselines/reference/asyncConstructor_es5(target=es5).js @@ -7,6 +7,7 @@ class C { } //// [asyncConstructor_es5.js] +"use strict"; var C = /** @class */ (function () { function C() { } diff --git a/tests/baselines/reference/asyncConstructor_es6.js b/tests/baselines/reference/asyncConstructor_es6.js index c5797911bf022..678c7a54a2219 100644 --- a/tests/baselines/reference/asyncConstructor_es6.js +++ b/tests/baselines/reference/asyncConstructor_es6.js @@ -7,6 +7,7 @@ class C { } //// [asyncConstructor_es6.js] +"use strict"; class C { constructor() { } diff --git a/tests/baselines/reference/asyncDeclare_es5(target=es2015).js b/tests/baselines/reference/asyncDeclare_es5(target=es2015).js index ee2b01033a50f..73932c16f12d1 100644 --- a/tests/baselines/reference/asyncDeclare_es5(target=es2015).js +++ b/tests/baselines/reference/asyncDeclare_es5(target=es2015).js @@ -4,3 +4,4 @@ declare async function foo(): Promise; //// [asyncDeclare_es5.js] +"use strict"; diff --git a/tests/baselines/reference/asyncDeclare_es5(target=es5).js b/tests/baselines/reference/asyncDeclare_es5(target=es5).js index ee2b01033a50f..73932c16f12d1 100644 --- a/tests/baselines/reference/asyncDeclare_es5(target=es5).js +++ b/tests/baselines/reference/asyncDeclare_es5(target=es5).js @@ -4,3 +4,4 @@ declare async function foo(): Promise; //// [asyncDeclare_es5.js] +"use strict"; diff --git a/tests/baselines/reference/asyncDeclare_es6.js b/tests/baselines/reference/asyncDeclare_es6.js index 1c1078c0f6bbe..ede8f375592e0 100644 --- a/tests/baselines/reference/asyncDeclare_es6.js +++ b/tests/baselines/reference/asyncDeclare_es6.js @@ -4,3 +4,4 @@ declare async function foo(): Promise; //// [asyncDeclare_es6.js] +"use strict"; diff --git a/tests/baselines/reference/asyncEnum_es5(target=es2015).js b/tests/baselines/reference/asyncEnum_es5(target=es2015).js index abeacf3871a8c..8178c181ef632 100644 --- a/tests/baselines/reference/asyncEnum_es5(target=es2015).js +++ b/tests/baselines/reference/asyncEnum_es5(target=es2015).js @@ -6,6 +6,7 @@ async enum E { } //// [asyncEnum_es5.js] +"use strict"; var E; (function (E) { E[E["Value"] = 0] = "Value"; diff --git a/tests/baselines/reference/asyncEnum_es5(target=es5).js b/tests/baselines/reference/asyncEnum_es5(target=es5).js index abeacf3871a8c..8178c181ef632 100644 --- a/tests/baselines/reference/asyncEnum_es5(target=es5).js +++ b/tests/baselines/reference/asyncEnum_es5(target=es5).js @@ -6,6 +6,7 @@ async enum E { } //// [asyncEnum_es5.js] +"use strict"; var E; (function (E) { E[E["Value"] = 0] = "Value"; diff --git a/tests/baselines/reference/asyncEnum_es6.js b/tests/baselines/reference/asyncEnum_es6.js index 368c7c29f176e..5f6fe899b5b1a 100644 --- a/tests/baselines/reference/asyncEnum_es6.js +++ b/tests/baselines/reference/asyncEnum_es6.js @@ -6,6 +6,7 @@ async enum E { } //// [asyncEnum_es6.js] +"use strict"; var E; (function (E) { E[E["Value"] = 0] = "Value"; diff --git a/tests/baselines/reference/asyncFunctionDeclaration10_es2017.js b/tests/baselines/reference/asyncFunctionDeclaration10_es2017.js index 7be1f862134a9..785ca853a0638 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration10_es2017.js +++ b/tests/baselines/reference/asyncFunctionDeclaration10_es2017.js @@ -5,5 +5,6 @@ async function foo(a = await => await): Promise { } //// [asyncFunctionDeclaration10_es2017.js] +"use strict"; async function foo(a = await , await) { } diff --git a/tests/baselines/reference/asyncFunctionDeclaration10_es5(target=es2015).js b/tests/baselines/reference/asyncFunctionDeclaration10_es5(target=es2015).js index 040435199ce52..866f56145be07 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration10_es5(target=es2015).js +++ b/tests/baselines/reference/asyncFunctionDeclaration10_es5(target=es2015).js @@ -5,6 +5,7 @@ async function foo(a = await => await): Promise { } //// [asyncFunctionDeclaration10_es5.js] +"use strict"; function foo() { return __awaiter(this, arguments, void 0, function* (a = yield , await) { }); diff --git a/tests/baselines/reference/asyncFunctionDeclaration10_es5(target=es5).js b/tests/baselines/reference/asyncFunctionDeclaration10_es5(target=es5).js index 3e4b240577f72..329d096f4277c 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration10_es5(target=es5).js +++ b/tests/baselines/reference/asyncFunctionDeclaration10_es5(target=es5).js @@ -5,6 +5,7 @@ async function foo(a = await => await): Promise { } //// [asyncFunctionDeclaration10_es5.js] +"use strict"; function foo() { return __awaiter(this, arguments, void 0, function (a, await) { if (a === void 0) { a = _a.sent(); } diff --git a/tests/baselines/reference/asyncFunctionDeclaration10_es6.js b/tests/baselines/reference/asyncFunctionDeclaration10_es6.js index f9f438cc67c02..634f669b52333 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration10_es6.js +++ b/tests/baselines/reference/asyncFunctionDeclaration10_es6.js @@ -5,6 +5,7 @@ async function foo(a = await => await): Promise { } //// [asyncFunctionDeclaration10_es6.js] +"use strict"; function foo() { return __awaiter(this, arguments, void 0, function* (a = yield , await) { }); diff --git a/tests/baselines/reference/asyncFunctionDeclaration11_es2017.js b/tests/baselines/reference/asyncFunctionDeclaration11_es2017.js index 00efbea86c6e2..e69015d45d45e 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration11_es2017.js +++ b/tests/baselines/reference/asyncFunctionDeclaration11_es2017.js @@ -5,5 +5,6 @@ async function await(): Promise { } //// [asyncFunctionDeclaration11_es2017.js] +"use strict"; async function await() { } diff --git a/tests/baselines/reference/asyncFunctionDeclaration11_es5(target=es2015).js b/tests/baselines/reference/asyncFunctionDeclaration11_es5(target=es2015).js index 163a34d8e32f2..0416e8553b739 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration11_es5(target=es2015).js +++ b/tests/baselines/reference/asyncFunctionDeclaration11_es5(target=es2015).js @@ -5,6 +5,7 @@ async function await(): Promise { } //// [asyncFunctionDeclaration11_es5.js] +"use strict"; function await() { return __awaiter(this, void 0, void 0, function* () { }); diff --git a/tests/baselines/reference/asyncFunctionDeclaration11_es5(target=es5).js b/tests/baselines/reference/asyncFunctionDeclaration11_es5(target=es5).js index c7894f82f0137..051dc2fc5ad75 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration11_es5(target=es5).js +++ b/tests/baselines/reference/asyncFunctionDeclaration11_es5(target=es5).js @@ -5,6 +5,7 @@ async function await(): Promise { } //// [asyncFunctionDeclaration11_es5.js] +"use strict"; function await() { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { diff --git a/tests/baselines/reference/asyncFunctionDeclaration11_es6.js b/tests/baselines/reference/asyncFunctionDeclaration11_es6.js index 75d0b74fff29f..3a0725b5515f8 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration11_es6.js +++ b/tests/baselines/reference/asyncFunctionDeclaration11_es6.js @@ -5,6 +5,7 @@ async function await(): Promise { } //// [asyncFunctionDeclaration11_es6.js] +"use strict"; function await() { return __awaiter(this, void 0, void 0, function* () { }); diff --git a/tests/baselines/reference/asyncFunctionDeclaration12_es2017.js b/tests/baselines/reference/asyncFunctionDeclaration12_es2017.js index 3cecf8c75d6e5..a18dc99c0f089 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration12_es2017.js +++ b/tests/baselines/reference/asyncFunctionDeclaration12_es2017.js @@ -4,4 +4,5 @@ var v = async function await(): Promise { } //// [asyncFunctionDeclaration12_es2017.js] +"use strict"; var v = async function await() { }; diff --git a/tests/baselines/reference/asyncFunctionDeclaration12_es5(target=es2015).js b/tests/baselines/reference/asyncFunctionDeclaration12_es5(target=es2015).js index 1eb788619a5f9..8e65d4928c7a5 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration12_es5(target=es2015).js +++ b/tests/baselines/reference/asyncFunctionDeclaration12_es5(target=es2015).js @@ -4,6 +4,7 @@ var v = async function await(): Promise { } //// [asyncFunctionDeclaration12_es5.js] +"use strict"; var v = function await() { return __awaiter(this, void 0, void 0, function* () { }); }; diff --git a/tests/baselines/reference/asyncFunctionDeclaration12_es5(target=es5).js b/tests/baselines/reference/asyncFunctionDeclaration12_es5(target=es5).js index 01ba79ec23bd2..426ad1d8aac01 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration12_es5(target=es5).js +++ b/tests/baselines/reference/asyncFunctionDeclaration12_es5(target=es5).js @@ -4,6 +4,7 @@ var v = async function await(): Promise { } //// [asyncFunctionDeclaration12_es5.js] +"use strict"; var v = function await() { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { return [2 /*return*/]; diff --git a/tests/baselines/reference/asyncFunctionDeclaration12_es6.js b/tests/baselines/reference/asyncFunctionDeclaration12_es6.js index 8cb102b18a5df..07bf8caa8e465 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration12_es6.js +++ b/tests/baselines/reference/asyncFunctionDeclaration12_es6.js @@ -4,6 +4,7 @@ var v = async function await(): Promise { } //// [asyncFunctionDeclaration12_es6.js] +"use strict"; var v = function await() { return __awaiter(this, void 0, void 0, function* () { }); }; diff --git a/tests/baselines/reference/asyncFunctionDeclaration13_es2017.js b/tests/baselines/reference/asyncFunctionDeclaration13_es2017.js index 4017c777eed8d..cb05b9b89f95e 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration13_es2017.js +++ b/tests/baselines/reference/asyncFunctionDeclaration13_es2017.js @@ -8,6 +8,7 @@ async function foo(): Promise { //// [asyncFunctionDeclaration13_es2017.js] +"use strict"; async function foo() { // Legal to use 'await' in a type context. var v; diff --git a/tests/baselines/reference/asyncFunctionDeclaration13_es5(target=es2015).js b/tests/baselines/reference/asyncFunctionDeclaration13_es5(target=es2015).js index 28708c96b746d..0592fbea43b13 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration13_es5(target=es2015).js +++ b/tests/baselines/reference/asyncFunctionDeclaration13_es5(target=es2015).js @@ -8,6 +8,7 @@ async function foo(): Promise { //// [asyncFunctionDeclaration13_es5.js] +"use strict"; function foo() { return __awaiter(this, void 0, void 0, function* () { // Legal to use 'await' in a type context. diff --git a/tests/baselines/reference/asyncFunctionDeclaration13_es5(target=es5).js b/tests/baselines/reference/asyncFunctionDeclaration13_es5(target=es5).js index 9c7612197116d..25b3bde43ef1a 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration13_es5(target=es5).js +++ b/tests/baselines/reference/asyncFunctionDeclaration13_es5(target=es5).js @@ -8,6 +8,7 @@ async function foo(): Promise { //// [asyncFunctionDeclaration13_es5.js] +"use strict"; function foo() { return __awaiter(this, void 0, void 0, function () { var v; diff --git a/tests/baselines/reference/asyncFunctionDeclaration13_es6.js b/tests/baselines/reference/asyncFunctionDeclaration13_es6.js index 1e358fb9303ac..6cfe91869914f 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration13_es6.js +++ b/tests/baselines/reference/asyncFunctionDeclaration13_es6.js @@ -8,6 +8,7 @@ async function foo(): Promise { //// [asyncFunctionDeclaration13_es6.js] +"use strict"; function foo() { return __awaiter(this, void 0, void 0, function* () { // Legal to use 'await' in a type context. diff --git a/tests/baselines/reference/asyncFunctionDeclaration14_es2017.js b/tests/baselines/reference/asyncFunctionDeclaration14_es2017.js index 90db5a5a9ca81..c39e6d7fbb7d5 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration14_es2017.js +++ b/tests/baselines/reference/asyncFunctionDeclaration14_es2017.js @@ -6,6 +6,7 @@ async function foo(): Promise { } //// [asyncFunctionDeclaration14_es2017.js] +"use strict"; async function foo() { return; } diff --git a/tests/baselines/reference/asyncFunctionDeclaration14_es5(target=es2015).js b/tests/baselines/reference/asyncFunctionDeclaration14_es5(target=es2015).js index 226249ed9db52..7210c6cac2356 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration14_es5(target=es2015).js +++ b/tests/baselines/reference/asyncFunctionDeclaration14_es5(target=es2015).js @@ -6,6 +6,7 @@ async function foo(): Promise { } //// [asyncFunctionDeclaration14_es5.js] +"use strict"; function foo() { return __awaiter(this, void 0, void 0, function* () { return; diff --git a/tests/baselines/reference/asyncFunctionDeclaration14_es5(target=es5).js b/tests/baselines/reference/asyncFunctionDeclaration14_es5(target=es5).js index b5a208fa9355a..a7392b426ab82 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration14_es5(target=es5).js +++ b/tests/baselines/reference/asyncFunctionDeclaration14_es5(target=es5).js @@ -6,6 +6,7 @@ async function foo(): Promise { } //// [asyncFunctionDeclaration14_es5.js] +"use strict"; function foo() { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { diff --git a/tests/baselines/reference/asyncFunctionDeclaration14_es6.js b/tests/baselines/reference/asyncFunctionDeclaration14_es6.js index 8183393a56120..63416515f5c27 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration14_es6.js +++ b/tests/baselines/reference/asyncFunctionDeclaration14_es6.js @@ -6,6 +6,7 @@ async function foo(): Promise { } //// [asyncFunctionDeclaration14_es6.js] +"use strict"; function foo() { return __awaiter(this, void 0, void 0, function* () { return; diff --git a/tests/baselines/reference/asyncFunctionDeclaration15_es5(target=es2015).js b/tests/baselines/reference/asyncFunctionDeclaration15_es5(target=es2015).js index 9a5737d1524b0..0a705b420d889 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration15_es5(target=es2015).js +++ b/tests/baselines/reference/asyncFunctionDeclaration15_es5(target=es2015).js @@ -27,6 +27,7 @@ async function fn19() { await thenable; } // error //// [asyncFunctionDeclaration15_es5.js] +"use strict"; function fn1() { return __awaiter(this, void 0, void 0, function* () { }); } // valid: Promise diff --git a/tests/baselines/reference/asyncFunctionDeclaration15_es5(target=es5).js b/tests/baselines/reference/asyncFunctionDeclaration15_es5(target=es5).js index c0e2ff621519a..561b5f70675d8 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration15_es5(target=es5).js +++ b/tests/baselines/reference/asyncFunctionDeclaration15_es5(target=es5).js @@ -27,6 +27,7 @@ async function fn19() { await thenable; } // error //// [asyncFunctionDeclaration15_es5.js] +"use strict"; function fn1() { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { return [2 /*return*/]; diff --git a/tests/baselines/reference/asyncFunctionDeclaration15_es6.js b/tests/baselines/reference/asyncFunctionDeclaration15_es6.js index 91923bbd5a08b..131622339875c 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration15_es6.js +++ b/tests/baselines/reference/asyncFunctionDeclaration15_es6.js @@ -27,6 +27,7 @@ async function fn19() { await thenable; } // error //// [asyncFunctionDeclaration15_es6.js] +"use strict"; function fn1() { return __awaiter(this, void 0, void 0, function* () { }); } // valid: Promise diff --git a/tests/baselines/reference/asyncFunctionDeclaration1_es2017.js b/tests/baselines/reference/asyncFunctionDeclaration1_es2017.js index 5142149133142..bdf54bd092b82 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration1_es2017.js +++ b/tests/baselines/reference/asyncFunctionDeclaration1_es2017.js @@ -5,5 +5,6 @@ async function foo(): Promise { } //// [asyncFunctionDeclaration1_es2017.js] +"use strict"; async function foo() { } diff --git a/tests/baselines/reference/asyncFunctionDeclaration1_es5(target=es2015).js b/tests/baselines/reference/asyncFunctionDeclaration1_es5(target=es2015).js index 959f4adac78ba..493067c58431a 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration1_es5(target=es2015).js +++ b/tests/baselines/reference/asyncFunctionDeclaration1_es5(target=es2015).js @@ -5,6 +5,7 @@ async function foo(): Promise { } //// [asyncFunctionDeclaration1_es5.js] +"use strict"; function foo() { return __awaiter(this, void 0, void 0, function* () { }); diff --git a/tests/baselines/reference/asyncFunctionDeclaration1_es5(target=es5).js b/tests/baselines/reference/asyncFunctionDeclaration1_es5(target=es5).js index 3efe6e9b8031f..5957f1f27b209 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration1_es5(target=es5).js +++ b/tests/baselines/reference/asyncFunctionDeclaration1_es5(target=es5).js @@ -5,6 +5,7 @@ async function foo(): Promise { } //// [asyncFunctionDeclaration1_es5.js] +"use strict"; function foo() { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { diff --git a/tests/baselines/reference/asyncFunctionDeclaration1_es6.js b/tests/baselines/reference/asyncFunctionDeclaration1_es6.js index f882cdc78e895..278c16f7c612a 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration1_es6.js +++ b/tests/baselines/reference/asyncFunctionDeclaration1_es6.js @@ -5,6 +5,7 @@ async function foo(): Promise { } //// [asyncFunctionDeclaration1_es6.js] +"use strict"; function foo() { return __awaiter(this, void 0, void 0, function* () { }); diff --git a/tests/baselines/reference/asyncFunctionDeclaration2_es2017.js b/tests/baselines/reference/asyncFunctionDeclaration2_es2017.js index 13e9ccaadf235..34eeb6f9ac3c9 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration2_es2017.js +++ b/tests/baselines/reference/asyncFunctionDeclaration2_es2017.js @@ -5,5 +5,6 @@ function f(await) { } //// [asyncFunctionDeclaration2_es2017.js] +"use strict"; function f(await) { } diff --git a/tests/baselines/reference/asyncFunctionDeclaration2_es5(target=es2015).js b/tests/baselines/reference/asyncFunctionDeclaration2_es5(target=es2015).js index 66c4cbddb1038..1de6000b3fb45 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration2_es5(target=es2015).js +++ b/tests/baselines/reference/asyncFunctionDeclaration2_es5(target=es2015).js @@ -5,5 +5,6 @@ function f(await) { } //// [asyncFunctionDeclaration2_es5.js] +"use strict"; function f(await) { } diff --git a/tests/baselines/reference/asyncFunctionDeclaration2_es5(target=es5).js b/tests/baselines/reference/asyncFunctionDeclaration2_es5(target=es5).js index 66c4cbddb1038..1de6000b3fb45 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration2_es5(target=es5).js +++ b/tests/baselines/reference/asyncFunctionDeclaration2_es5(target=es5).js @@ -5,5 +5,6 @@ function f(await) { } //// [asyncFunctionDeclaration2_es5.js] +"use strict"; function f(await) { } diff --git a/tests/baselines/reference/asyncFunctionDeclaration2_es6.js b/tests/baselines/reference/asyncFunctionDeclaration2_es6.js index e9e4ad3a09d4a..3692624795a90 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration2_es6.js +++ b/tests/baselines/reference/asyncFunctionDeclaration2_es6.js @@ -5,5 +5,6 @@ function f(await) { } //// [asyncFunctionDeclaration2_es6.js] +"use strict"; function f(await) { } diff --git a/tests/baselines/reference/asyncFunctionDeclaration3_es2017.js b/tests/baselines/reference/asyncFunctionDeclaration3_es2017.js index 59752e8624c7a..e2ad06940e57a 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration3_es2017.js +++ b/tests/baselines/reference/asyncFunctionDeclaration3_es2017.js @@ -5,5 +5,6 @@ function f(await = await) { } //// [asyncFunctionDeclaration3_es2017.js] +"use strict"; function f(await = await) { } diff --git a/tests/baselines/reference/asyncFunctionDeclaration3_es5(target=es2015).js b/tests/baselines/reference/asyncFunctionDeclaration3_es5(target=es2015).js index 7c74aa4b821af..405f70811fc13 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration3_es5(target=es2015).js +++ b/tests/baselines/reference/asyncFunctionDeclaration3_es5(target=es2015).js @@ -5,5 +5,6 @@ function f(await = await) { } //// [asyncFunctionDeclaration3_es5.js] +"use strict"; function f(await = await) { } diff --git a/tests/baselines/reference/asyncFunctionDeclaration3_es5(target=es5).js b/tests/baselines/reference/asyncFunctionDeclaration3_es5(target=es5).js index db9cc78f082b5..00c7fe9f4bf64 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration3_es5(target=es5).js +++ b/tests/baselines/reference/asyncFunctionDeclaration3_es5(target=es5).js @@ -5,6 +5,7 @@ function f(await = await) { } //// [asyncFunctionDeclaration3_es5.js] +"use strict"; function f(await) { if (await === void 0) { await = await; } } diff --git a/tests/baselines/reference/asyncFunctionDeclaration3_es6.js b/tests/baselines/reference/asyncFunctionDeclaration3_es6.js index 3771c751c3a54..4c0f502ab989c 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration3_es6.js +++ b/tests/baselines/reference/asyncFunctionDeclaration3_es6.js @@ -5,5 +5,6 @@ function f(await = await) { } //// [asyncFunctionDeclaration3_es6.js] +"use strict"; function f(await = await) { } diff --git a/tests/baselines/reference/asyncFunctionDeclaration4_es2017.js b/tests/baselines/reference/asyncFunctionDeclaration4_es2017.js index 7fc0fcd488113..e9b97d5ed0011 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration4_es2017.js +++ b/tests/baselines/reference/asyncFunctionDeclaration4_es2017.js @@ -5,5 +5,6 @@ function await() { } //// [asyncFunctionDeclaration4_es2017.js] +"use strict"; function await() { } diff --git a/tests/baselines/reference/asyncFunctionDeclaration4_es5(target=es2015).js b/tests/baselines/reference/asyncFunctionDeclaration4_es5(target=es2015).js index 3a4b2beafbba5..2c4decfa4b311 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration4_es5(target=es2015).js +++ b/tests/baselines/reference/asyncFunctionDeclaration4_es5(target=es2015).js @@ -5,5 +5,6 @@ function await() { } //// [asyncFunctionDeclaration4_es5.js] +"use strict"; function await() { } diff --git a/tests/baselines/reference/asyncFunctionDeclaration4_es5(target=es5).js b/tests/baselines/reference/asyncFunctionDeclaration4_es5(target=es5).js index 3a4b2beafbba5..2c4decfa4b311 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration4_es5(target=es5).js +++ b/tests/baselines/reference/asyncFunctionDeclaration4_es5(target=es5).js @@ -5,5 +5,6 @@ function await() { } //// [asyncFunctionDeclaration4_es5.js] +"use strict"; function await() { } diff --git a/tests/baselines/reference/asyncFunctionDeclaration4_es6.js b/tests/baselines/reference/asyncFunctionDeclaration4_es6.js index f6deb3948076c..faa2a1a5b8ec8 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration4_es6.js +++ b/tests/baselines/reference/asyncFunctionDeclaration4_es6.js @@ -5,5 +5,6 @@ function await() { } //// [asyncFunctionDeclaration4_es6.js] +"use strict"; function await() { } diff --git a/tests/baselines/reference/asyncFunctionDeclaration5_es2017.js b/tests/baselines/reference/asyncFunctionDeclaration5_es2017.js index 4d0a1a61ddd7e..0afbfca77a4fb 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration5_es2017.js +++ b/tests/baselines/reference/asyncFunctionDeclaration5_es2017.js @@ -5,5 +5,6 @@ async function foo(await): Promise { } //// [asyncFunctionDeclaration5_es2017.js] +"use strict"; async function foo(await) { } diff --git a/tests/baselines/reference/asyncFunctionDeclaration5_es5(target=es2015).js b/tests/baselines/reference/asyncFunctionDeclaration5_es5(target=es2015).js index 8c1c92f4e750b..e623f8b843d56 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration5_es5(target=es2015).js +++ b/tests/baselines/reference/asyncFunctionDeclaration5_es5(target=es2015).js @@ -5,6 +5,7 @@ async function foo(await): Promise { } //// [asyncFunctionDeclaration5_es5.js] +"use strict"; function foo(await) { return __awaiter(this, void 0, void 0, function* () { }); diff --git a/tests/baselines/reference/asyncFunctionDeclaration5_es5(target=es5).js b/tests/baselines/reference/asyncFunctionDeclaration5_es5(target=es5).js index 30a48dd8795af..f28f5173b77a4 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration5_es5(target=es5).js +++ b/tests/baselines/reference/asyncFunctionDeclaration5_es5(target=es5).js @@ -5,6 +5,7 @@ async function foo(await): Promise { } //// [asyncFunctionDeclaration5_es5.js] +"use strict"; function foo(await) { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { diff --git a/tests/baselines/reference/asyncFunctionDeclaration5_es6.js b/tests/baselines/reference/asyncFunctionDeclaration5_es6.js index e103205e1f95f..e3cd6d11df470 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration5_es6.js +++ b/tests/baselines/reference/asyncFunctionDeclaration5_es6.js @@ -5,6 +5,7 @@ async function foo(await): Promise { } //// [asyncFunctionDeclaration5_es6.js] +"use strict"; function foo(await) { return __awaiter(this, void 0, void 0, function* () { }); diff --git a/tests/baselines/reference/asyncFunctionDeclaration6_es2017.js b/tests/baselines/reference/asyncFunctionDeclaration6_es2017.js index 6e6abd59a198b..b4a9bf387555e 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration6_es2017.js +++ b/tests/baselines/reference/asyncFunctionDeclaration6_es2017.js @@ -5,5 +5,6 @@ async function foo(a = await): Promise { } //// [asyncFunctionDeclaration6_es2017.js] +"use strict"; async function foo(a = await ) { } diff --git a/tests/baselines/reference/asyncFunctionDeclaration6_es5(target=es2015).js b/tests/baselines/reference/asyncFunctionDeclaration6_es5(target=es2015).js index 3f8ba4ab69354..81cd53915f229 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration6_es5(target=es2015).js +++ b/tests/baselines/reference/asyncFunctionDeclaration6_es5(target=es2015).js @@ -5,6 +5,7 @@ async function foo(a = await): Promise { } //// [asyncFunctionDeclaration6_es5.js] +"use strict"; function foo() { return __awaiter(this, arguments, void 0, function* (a = yield ) { }); diff --git a/tests/baselines/reference/asyncFunctionDeclaration6_es5(target=es5).js b/tests/baselines/reference/asyncFunctionDeclaration6_es5(target=es5).js index 955e59b233202..5356d0ad3c758 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration6_es5(target=es5).js +++ b/tests/baselines/reference/asyncFunctionDeclaration6_es5(target=es5).js @@ -5,6 +5,7 @@ async function foo(a = await): Promise { } //// [asyncFunctionDeclaration6_es5.js] +"use strict"; function foo() { return __awaiter(this, arguments, void 0, function (a) { if (a === void 0) { a = _a.sent(); } diff --git a/tests/baselines/reference/asyncFunctionDeclaration6_es6.js b/tests/baselines/reference/asyncFunctionDeclaration6_es6.js index 419d67e8e0df0..0f8ad65bc242c 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration6_es6.js +++ b/tests/baselines/reference/asyncFunctionDeclaration6_es6.js @@ -5,6 +5,7 @@ async function foo(a = await): Promise { } //// [asyncFunctionDeclaration6_es6.js] +"use strict"; function foo() { return __awaiter(this, arguments, void 0, function* (a = yield ) { }); diff --git a/tests/baselines/reference/asyncFunctionDeclaration7_es2017.js b/tests/baselines/reference/asyncFunctionDeclaration7_es2017.js index 7a54a233f82dd..c4227d13b92f5 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration7_es2017.js +++ b/tests/baselines/reference/asyncFunctionDeclaration7_es2017.js @@ -8,6 +8,7 @@ async function bar(): Promise { } //// [asyncFunctionDeclaration7_es2017.js] +"use strict"; async function bar() { // 'await' here is an identifier, and not a yield expression. async function foo(a = await ) { diff --git a/tests/baselines/reference/asyncFunctionDeclaration7_es5(target=es2015).js b/tests/baselines/reference/asyncFunctionDeclaration7_es5(target=es2015).js index f8cca723ab2d7..78505162d1913 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration7_es5(target=es2015).js +++ b/tests/baselines/reference/asyncFunctionDeclaration7_es5(target=es2015).js @@ -8,6 +8,7 @@ async function bar(): Promise { } //// [asyncFunctionDeclaration7_es5.js] +"use strict"; function bar() { return __awaiter(this, void 0, void 0, function* () { // 'await' here is an identifier, and not a yield expression. diff --git a/tests/baselines/reference/asyncFunctionDeclaration7_es5(target=es5).js b/tests/baselines/reference/asyncFunctionDeclaration7_es5(target=es5).js index 39cd2ed76a95c..45bd725eddfb6 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration7_es5(target=es5).js +++ b/tests/baselines/reference/asyncFunctionDeclaration7_es5(target=es5).js @@ -8,6 +8,7 @@ async function bar(): Promise { } //// [asyncFunctionDeclaration7_es5.js] +"use strict"; function bar() { return __awaiter(this, void 0, void 0, function () { // 'await' here is an identifier, and not a yield expression. diff --git a/tests/baselines/reference/asyncFunctionDeclaration7_es6.js b/tests/baselines/reference/asyncFunctionDeclaration7_es6.js index bec37abf44280..69cbfc988fac6 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration7_es6.js +++ b/tests/baselines/reference/asyncFunctionDeclaration7_es6.js @@ -8,6 +8,7 @@ async function bar(): Promise { } //// [asyncFunctionDeclaration7_es6.js] +"use strict"; function bar() { return __awaiter(this, void 0, void 0, function* () { // 'await' here is an identifier, and not a yield expression. diff --git a/tests/baselines/reference/asyncFunctionDeclaration8_es2017.js b/tests/baselines/reference/asyncFunctionDeclaration8_es2017.js index 7231da90e5da0..32a1262e9755e 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration8_es2017.js +++ b/tests/baselines/reference/asyncFunctionDeclaration8_es2017.js @@ -4,4 +4,5 @@ var v = { [await]: foo } //// [asyncFunctionDeclaration8_es2017.js] +"use strict"; var v = { [await]: foo }; diff --git a/tests/baselines/reference/asyncFunctionDeclaration8_es5(target=es2015).js b/tests/baselines/reference/asyncFunctionDeclaration8_es5(target=es2015).js index dd2cda54382f3..368cf251ff527 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration8_es5(target=es2015).js +++ b/tests/baselines/reference/asyncFunctionDeclaration8_es5(target=es2015).js @@ -4,4 +4,5 @@ var v = { [await]: foo } //// [asyncFunctionDeclaration8_es5.js] +"use strict"; var v = { [await]: foo }; diff --git a/tests/baselines/reference/asyncFunctionDeclaration8_es5(target=es5).js b/tests/baselines/reference/asyncFunctionDeclaration8_es5(target=es5).js index c529aa25356b4..0fcd8bc69b8bb 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration8_es5(target=es5).js +++ b/tests/baselines/reference/asyncFunctionDeclaration8_es5(target=es5).js @@ -4,5 +4,6 @@ var v = { [await]: foo } //// [asyncFunctionDeclaration8_es5.js] +"use strict"; var _a; var v = (_a = {}, _a[await] = foo, _a); diff --git a/tests/baselines/reference/asyncFunctionDeclaration8_es6.js b/tests/baselines/reference/asyncFunctionDeclaration8_es6.js index 9cc3cb7d1b7e0..12b7dbcced9da 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration8_es6.js +++ b/tests/baselines/reference/asyncFunctionDeclaration8_es6.js @@ -4,4 +4,5 @@ var v = { [await]: foo } //// [asyncFunctionDeclaration8_es6.js] +"use strict"; var v = { [await]: foo }; diff --git a/tests/baselines/reference/asyncFunctionDeclaration9_es2017.js b/tests/baselines/reference/asyncFunctionDeclaration9_es2017.js index a157c6af6b759..aa97d2d23ac42 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration9_es2017.js +++ b/tests/baselines/reference/asyncFunctionDeclaration9_es2017.js @@ -6,6 +6,7 @@ async function foo(): Promise { } //// [asyncFunctionDeclaration9_es2017.js] +"use strict"; async function foo() { var v = { [await ]: foo }; } diff --git a/tests/baselines/reference/asyncFunctionDeclaration9_es5(target=es2015).js b/tests/baselines/reference/asyncFunctionDeclaration9_es5(target=es2015).js index 3986493546e3f..9e19f306aff7a 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration9_es5(target=es2015).js +++ b/tests/baselines/reference/asyncFunctionDeclaration9_es5(target=es2015).js @@ -6,6 +6,7 @@ async function foo(): Promise { } //// [asyncFunctionDeclaration9_es5.js] +"use strict"; function foo() { return __awaiter(this, void 0, void 0, function* () { var v = { [yield ]: foo }; diff --git a/tests/baselines/reference/asyncFunctionDeclaration9_es5(target=es5).js b/tests/baselines/reference/asyncFunctionDeclaration9_es5(target=es5).js index bc1f7b6416c4b..5bce06d87b3d6 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration9_es5(target=es5).js +++ b/tests/baselines/reference/asyncFunctionDeclaration9_es5(target=es5).js @@ -6,6 +6,7 @@ async function foo(): Promise { } //// [asyncFunctionDeclaration9_es5.js] +"use strict"; function foo() { return __awaiter(this, void 0, void 0, function () { var v; diff --git a/tests/baselines/reference/asyncFunctionDeclaration9_es6.js b/tests/baselines/reference/asyncFunctionDeclaration9_es6.js index 5e622d930843f..75249da182718 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration9_es6.js +++ b/tests/baselines/reference/asyncFunctionDeclaration9_es6.js @@ -6,6 +6,7 @@ async function foo(): Promise { } //// [asyncFunctionDeclaration9_es6.js] +"use strict"; function foo() { return __awaiter(this, void 0, void 0, function* () { var v = { [yield ]: foo }; diff --git a/tests/baselines/reference/asyncFunctionDeclarationCapturesArguments_es5(target=es2015).errors.txt b/tests/baselines/reference/asyncFunctionDeclarationCapturesArguments_es5(target=es2015).errors.txt new file mode 100644 index 0000000000000..6f4b7c10ffe0b --- /dev/null +++ b/tests/baselines/reference/asyncFunctionDeclarationCapturesArguments_es5(target=es2015).errors.txt @@ -0,0 +1,19 @@ +asyncFunctionDeclarationCapturesArguments_es5.ts(5,30): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. +asyncFunctionDeclarationCapturesArguments_es5.ts(5,36): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[]'. + + +==== asyncFunctionDeclarationCapturesArguments_es5.ts (2 errors) ==== + class C { + method() { + function other() {} + async function fn () { + await other.apply(this, arguments); + ~~~~ +!!! error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. +!!! related TS2738 asyncFunctionDeclarationCapturesArguments_es5.ts:4:22: An outer value of 'this' is shadowed by this container. + ~~~~~~~~~ +!!! error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[]'. + } + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/asyncFunctionDeclarationCapturesArguments_es5(target=es2015).js b/tests/baselines/reference/asyncFunctionDeclarationCapturesArguments_es5(target=es2015).js index 0f553556de390..5e9775ce720f6 100644 --- a/tests/baselines/reference/asyncFunctionDeclarationCapturesArguments_es5(target=es2015).js +++ b/tests/baselines/reference/asyncFunctionDeclarationCapturesArguments_es5(target=es2015).js @@ -12,6 +12,7 @@ class C { //// [asyncFunctionDeclarationCapturesArguments_es5.js] +"use strict"; class C { method() { function other() { } diff --git a/tests/baselines/reference/asyncFunctionDeclarationCapturesArguments_es5(target=es2015).symbols b/tests/baselines/reference/asyncFunctionDeclarationCapturesArguments_es5(target=es2015).symbols index ed65437339dca..a89d55af0189f 100644 --- a/tests/baselines/reference/asyncFunctionDeclarationCapturesArguments_es5(target=es2015).symbols +++ b/tests/baselines/reference/asyncFunctionDeclarationCapturesArguments_es5(target=es2015).symbols @@ -14,9 +14,9 @@ class C { >fn : Symbol(fn, Decl(asyncFunctionDeclarationCapturesArguments_es5.ts, 2, 25)) await other.apply(this, arguments); ->other.apply : Symbol(Function.apply, Decl(lib.es5.d.ts, --, --)) +>other.apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >other : Symbol(other, Decl(asyncFunctionDeclarationCapturesArguments_es5.ts, 1, 13)) ->apply : Symbol(Function.apply, Decl(lib.es5.d.ts, --, --)) +>apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >arguments : Symbol(arguments) } } diff --git a/tests/baselines/reference/asyncFunctionDeclarationCapturesArguments_es5(target=es2015).types b/tests/baselines/reference/asyncFunctionDeclarationCapturesArguments_es5(target=es2015).types index c6269bd45edd9..60b938fc15328 100644 --- a/tests/baselines/reference/asyncFunctionDeclarationCapturesArguments_es5(target=es2015).types +++ b/tests/baselines/reference/asyncFunctionDeclarationCapturesArguments_es5(target=es2015).types @@ -18,15 +18,18 @@ class C { > : ^^^^^^^^^^^^^^^^^^^ await other.apply(this, arguments); ->await other.apply(this, arguments) : any ->other.apply(this, arguments) : any ->other.apply : (this: Function, thisArg: any, argArray?: any) => any -> : ^ ^^ ^^ ^^ ^^ ^^^ ^^^^^ +>await other.apply(this, arguments) : void +> : ^^^^ +>other.apply(this, arguments) : void +> : ^^^^ +>other.apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } +> : ^^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ >other : () => void > : ^^^^^^^^^^ ->apply : (this: Function, thisArg: any, argArray?: any) => any -> : ^ ^^ ^^ ^^ ^^ ^^^ ^^^^^ +>apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } +> : ^^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ >this : any +> : ^^^ >arguments : IArguments > : ^^^^^^^^^^ } diff --git a/tests/baselines/reference/asyncFunctionDeclarationCapturesArguments_es5(target=es5).errors.txt b/tests/baselines/reference/asyncFunctionDeclarationCapturesArguments_es5(target=es5).errors.txt index 6971bcff9a5de..28c9431ab40df 100644 --- a/tests/baselines/reference/asyncFunctionDeclarationCapturesArguments_es5(target=es5).errors.txt +++ b/tests/baselines/reference/asyncFunctionDeclarationCapturesArguments_es5(target=es5).errors.txt @@ -1,14 +1,21 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +asyncFunctionDeclarationCapturesArguments_es5.ts(5,30): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. +asyncFunctionDeclarationCapturesArguments_es5.ts(5,36): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[]'. asyncFunctionDeclarationCapturesArguments_es5.ts(5,36): error TS2522: The 'arguments' object cannot be referenced in an async function or method in ES5. Consider using a standard function or method. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== asyncFunctionDeclarationCapturesArguments_es5.ts (1 errors) ==== +==== asyncFunctionDeclarationCapturesArguments_es5.ts (3 errors) ==== class C { method() { function other() {} async function fn () { await other.apply(this, arguments); + ~~~~ +!!! error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. +!!! related TS2738 asyncFunctionDeclarationCapturesArguments_es5.ts:4:22: An outer value of 'this' is shadowed by this container. + ~~~~~~~~~ +!!! error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[]'. ~~~~~~~~~ !!! error TS2522: The 'arguments' object cannot be referenced in an async function or method in ES5. Consider using a standard function or method. } diff --git a/tests/baselines/reference/asyncFunctionDeclarationCapturesArguments_es5(target=es5).js b/tests/baselines/reference/asyncFunctionDeclarationCapturesArguments_es5(target=es5).js index b254df413ba4d..1231a3611d636 100644 --- a/tests/baselines/reference/asyncFunctionDeclarationCapturesArguments_es5(target=es5).js +++ b/tests/baselines/reference/asyncFunctionDeclarationCapturesArguments_es5(target=es5).js @@ -12,6 +12,7 @@ class C { //// [asyncFunctionDeclarationCapturesArguments_es5.js] +"use strict"; var C = /** @class */ (function () { function C() { } diff --git a/tests/baselines/reference/asyncFunctionDeclarationCapturesArguments_es5(target=es5).symbols b/tests/baselines/reference/asyncFunctionDeclarationCapturesArguments_es5(target=es5).symbols index ed65437339dca..a89d55af0189f 100644 --- a/tests/baselines/reference/asyncFunctionDeclarationCapturesArguments_es5(target=es5).symbols +++ b/tests/baselines/reference/asyncFunctionDeclarationCapturesArguments_es5(target=es5).symbols @@ -14,9 +14,9 @@ class C { >fn : Symbol(fn, Decl(asyncFunctionDeclarationCapturesArguments_es5.ts, 2, 25)) await other.apply(this, arguments); ->other.apply : Symbol(Function.apply, Decl(lib.es5.d.ts, --, --)) +>other.apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >other : Symbol(other, Decl(asyncFunctionDeclarationCapturesArguments_es5.ts, 1, 13)) ->apply : Symbol(Function.apply, Decl(lib.es5.d.ts, --, --)) +>apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >arguments : Symbol(arguments) } } diff --git a/tests/baselines/reference/asyncFunctionDeclarationCapturesArguments_es5(target=es5).types b/tests/baselines/reference/asyncFunctionDeclarationCapturesArguments_es5(target=es5).types index 5f5a1a148d35f..60b938fc15328 100644 --- a/tests/baselines/reference/asyncFunctionDeclarationCapturesArguments_es5(target=es5).types +++ b/tests/baselines/reference/asyncFunctionDeclarationCapturesArguments_es5(target=es5).types @@ -18,16 +18,16 @@ class C { > : ^^^^^^^^^^^^^^^^^^^ await other.apply(this, arguments); ->await other.apply(this, arguments) : any -> : ^^^ ->other.apply(this, arguments) : any -> : ^^^ ->other.apply : (this: Function, thisArg: any, argArray?: any) => any -> : ^ ^^ ^^ ^^ ^^ ^^^ ^^^^^ +>await other.apply(this, arguments) : void +> : ^^^^ +>other.apply(this, arguments) : void +> : ^^^^ +>other.apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } +> : ^^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ >other : () => void > : ^^^^^^^^^^ ->apply : (this: Function, thisArg: any, argArray?: any) => any -> : ^ ^^ ^^ ^^ ^^ ^^^ ^^^^^ +>apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } +> : ^^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ >this : any > : ^^^ >arguments : IArguments diff --git a/tests/baselines/reference/asyncFunctionDeclarationParameterEvaluation(target=es2015).js b/tests/baselines/reference/asyncFunctionDeclarationParameterEvaluation(target=es2015).js index 8b3f87a20b063..ea4f5efe96569 100644 --- a/tests/baselines/reference/asyncFunctionDeclarationParameterEvaluation(target=es2015).js +++ b/tests/baselines/reference/asyncFunctionDeclarationParameterEvaluation(target=es2015).js @@ -28,6 +28,7 @@ function f() { } //// [asyncFunctionDeclarationParameterEvaluation.js] +"use strict"; // https://github.com/microsoft/TypeScript/issues/40410 function f1(x_1) { return __awaiter(this, arguments, void 0, function* (x, y = z) { }); diff --git a/tests/baselines/reference/asyncFunctionDeclarationParameterEvaluation(target=es2017).js b/tests/baselines/reference/asyncFunctionDeclarationParameterEvaluation(target=es2017).js index ec09c5f4d8883..9bec8a05f5b65 100644 --- a/tests/baselines/reference/asyncFunctionDeclarationParameterEvaluation(target=es2017).js +++ b/tests/baselines/reference/asyncFunctionDeclarationParameterEvaluation(target=es2017).js @@ -28,6 +28,7 @@ function f() { } //// [asyncFunctionDeclarationParameterEvaluation.js] +"use strict"; // https://github.com/microsoft/TypeScript/issues/40410 async function f1(x, y = z) { } async function f2({ [z]: x }) { } diff --git a/tests/baselines/reference/asyncFunctionNoReturnType.js b/tests/baselines/reference/asyncFunctionNoReturnType.js index 7b601649bc720..6f469183c1e22 100644 --- a/tests/baselines/reference/asyncFunctionNoReturnType.js +++ b/tests/baselines/reference/asyncFunctionNoReturnType.js @@ -8,6 +8,7 @@ async () => { //// [asyncFunctionNoReturnType.js] +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { @@ -17,7 +18,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -() => __awaiter(this, void 0, void 0, function* () { +() => __awaiter(void 0, void 0, void 0, function* () { if (window) return; }); diff --git a/tests/baselines/reference/asyncFunctionNoReturnType.types b/tests/baselines/reference/asyncFunctionNoReturnType.types index 7b2fa1e95bc97..18c73e82211f4 100644 --- a/tests/baselines/reference/asyncFunctionNoReturnType.types +++ b/tests/baselines/reference/asyncFunctionNoReturnType.types @@ -1,5 +1,8 @@ //// [tests/cases/compiler/asyncFunctionNoReturnType.ts] //// +=== Performance Stats === +Type Count: 1,000 + === asyncFunctionNoReturnType.ts === async () => { >async () => { if (window) return;} : () => Promise diff --git a/tests/baselines/reference/asyncFunctionReturnExpressionErrorSpans.js b/tests/baselines/reference/asyncFunctionReturnExpressionErrorSpans.js index 94f02b0b38843..39379a41eb372 100644 --- a/tests/baselines/reference/asyncFunctionReturnExpressionErrorSpans.js +++ b/tests/baselines/reference/asyncFunctionReturnExpressionErrorSpans.js @@ -24,6 +24,7 @@ async function asyncFoo(): Promise { } //// [asyncFunctionReturnExpressionErrorSpans.js] +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { diff --git a/tests/baselines/reference/asyncFunctionReturnType.2.js b/tests/baselines/reference/asyncFunctionReturnType.2.js index 1580513685952..c88f339c5c8ec 100644 --- a/tests/baselines/reference/asyncFunctionReturnType.2.js +++ b/tests/baselines/reference/asyncFunctionReturnType.2.js @@ -7,6 +7,7 @@ class X { } //// [asyncFunctionReturnType.2.js] +"use strict"; // https://github.com/microsoft/TypeScript/issues/47291 class X { f = async () => this; diff --git a/tests/baselines/reference/asyncFunctionReturnType.js b/tests/baselines/reference/asyncFunctionReturnType.js index 425e25904d59d..a28436da88206 100644 --- a/tests/baselines/reference/asyncFunctionReturnType.js +++ b/tests/baselines/reference/asyncFunctionReturnType.js @@ -78,6 +78,7 @@ async function fGenericIndexedTypeForExplicitPromiseOfKProp bar(await foo); //// [asyncFunctionTempVariableScoping.js] +"use strict"; // https://github.com/Microsoft/TypeScript/issues/19187 var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } @@ -27,7 +28,7 @@ var __rest = (this && this.__rest) || function (s, e) { } return t; }; -(_a) => __awaiter(this, void 0, void 0, function* () { +(_a) => __awaiter(void 0, void 0, void 0, function* () { var { foo, bar } = _a, rest = __rest(_a, ["foo", "bar"]); return bar(yield foo); }); diff --git a/tests/baselines/reference/asyncFunctionTempVariableScoping(target=es5).js b/tests/baselines/reference/asyncFunctionTempVariableScoping(target=es5).js index a5a52a5c518b7..89bd1d4167b6f 100644 --- a/tests/baselines/reference/asyncFunctionTempVariableScoping(target=es5).js +++ b/tests/baselines/reference/asyncFunctionTempVariableScoping(target=es5).js @@ -6,6 +6,7 @@ async ({ foo, bar, ...rest }) => bar(await foo); //// [asyncFunctionTempVariableScoping.js] +"use strict"; // https://github.com/Microsoft/TypeScript/issues/19187 var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } @@ -54,8 +55,7 @@ var __rest = (this && this.__rest) || function (s, e) { } return t; }; -var _this = this; -(function (_a) { return __awaiter(_this, void 0, void 0, function () { +(function (_a) { return __awaiter(void 0, void 0, void 0, function () { var _b; var foo = _a.foo, bar = _a.bar, rest = __rest(_a, ["foo", "bar"]); return __generator(this, function (_c) { diff --git a/tests/baselines/reference/asyncFunctionWithForStatementNoInitializer.js b/tests/baselines/reference/asyncFunctionWithForStatementNoInitializer.js index f5175c71944ce..c79f350ebd6d5 100644 --- a/tests/baselines/reference/asyncFunctionWithForStatementNoInitializer.js +++ b/tests/baselines/reference/asyncFunctionWithForStatementNoInitializer.js @@ -27,6 +27,7 @@ async function test4() { } //// [asyncFunctionWithForStatementNoInitializer.js] +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { diff --git a/tests/baselines/reference/asyncFunctionsAndStrictNullChecks.js b/tests/baselines/reference/asyncFunctionsAndStrictNullChecks.js index b04f3e7e8019d..a54b7029e68c3 100644 --- a/tests/baselines/reference/asyncFunctionsAndStrictNullChecks.js +++ b/tests/baselines/reference/asyncFunctionsAndStrictNullChecks.js @@ -28,6 +28,7 @@ async function sample2(x?: number) { //// [asyncFunctionsAndStrictNullChecks.js] +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { diff --git a/tests/baselines/reference/asyncGeneratorParameterEvaluation(target=es2015).js b/tests/baselines/reference/asyncGeneratorParameterEvaluation(target=es2015).js index 2cbad17364e65..b01ac6b8e69a3 100644 --- a/tests/baselines/reference/asyncGeneratorParameterEvaluation(target=es2015).js +++ b/tests/baselines/reference/asyncGeneratorParameterEvaluation(target=es2015).js @@ -12,6 +12,7 @@ class Sub extends Super { //// [asyncGeneratorParameterEvaluation.js] +"use strict"; // https://github.com/microsoft/TypeScript/issues/40410 function f1(x_1) { return __asyncGenerator(this, arguments, function* f1_1(x, y = z) { }); } function f2(_a) { return __asyncGenerator(this, arguments, function* f2_1({ [z]: x }) { }); } diff --git a/tests/baselines/reference/asyncGeneratorParameterEvaluation(target=es2017).js b/tests/baselines/reference/asyncGeneratorParameterEvaluation(target=es2017).js index 2cbad17364e65..b01ac6b8e69a3 100644 --- a/tests/baselines/reference/asyncGeneratorParameterEvaluation(target=es2017).js +++ b/tests/baselines/reference/asyncGeneratorParameterEvaluation(target=es2017).js @@ -12,6 +12,7 @@ class Sub extends Super { //// [asyncGeneratorParameterEvaluation.js] +"use strict"; // https://github.com/microsoft/TypeScript/issues/40410 function f1(x_1) { return __asyncGenerator(this, arguments, function* f1_1(x, y = z) { }); } function f2(_a) { return __asyncGenerator(this, arguments, function* f2_1({ [z]: x }) { }); } diff --git a/tests/baselines/reference/asyncGeneratorParameterEvaluation(target=es2018).js b/tests/baselines/reference/asyncGeneratorParameterEvaluation(target=es2018).js index 1e72faf417bae..936d77da9b1a0 100644 --- a/tests/baselines/reference/asyncGeneratorParameterEvaluation(target=es2018).js +++ b/tests/baselines/reference/asyncGeneratorParameterEvaluation(target=es2018).js @@ -12,6 +12,7 @@ class Sub extends Super { //// [asyncGeneratorParameterEvaluation.js] +"use strict"; // https://github.com/microsoft/TypeScript/issues/40410 async function* f1(x, y = z) { } async function* f2({ [z]: x }) { } diff --git a/tests/baselines/reference/asyncGetter_es5(target=es2015).js b/tests/baselines/reference/asyncGetter_es5(target=es2015).js index 9ed14a8aa05ce..1de9ef1ae7b40 100644 --- a/tests/baselines/reference/asyncGetter_es5(target=es2015).js +++ b/tests/baselines/reference/asyncGetter_es5(target=es2015).js @@ -7,6 +7,7 @@ class C { } //// [asyncGetter_es5.js] +"use strict"; class C { get foo() { } diff --git a/tests/baselines/reference/asyncGetter_es5(target=es5).js b/tests/baselines/reference/asyncGetter_es5(target=es5).js index 4fff3daebb808..0981ed36a2a8b 100644 --- a/tests/baselines/reference/asyncGetter_es5(target=es5).js +++ b/tests/baselines/reference/asyncGetter_es5(target=es5).js @@ -7,6 +7,7 @@ class C { } //// [asyncGetter_es5.js] +"use strict"; var C = /** @class */ (function () { function C() { } diff --git a/tests/baselines/reference/asyncGetter_es6.js b/tests/baselines/reference/asyncGetter_es6.js index 0f97533b0af06..fbec4ae52e6fe 100644 --- a/tests/baselines/reference/asyncGetter_es6.js +++ b/tests/baselines/reference/asyncGetter_es6.js @@ -7,6 +7,7 @@ class C { } //// [asyncGetter_es6.js] +"use strict"; class C { get foo() { } diff --git a/tests/baselines/reference/asyncIIFE.js b/tests/baselines/reference/asyncIIFE.js index a05980d1d5dee..f273d8cee1690 100644 --- a/tests/baselines/reference/asyncIIFE.js +++ b/tests/baselines/reference/asyncIIFE.js @@ -12,6 +12,7 @@ function f1() { //// [asyncIIFE.js] +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { diff --git a/tests/baselines/reference/asyncImportNestedYield.js b/tests/baselines/reference/asyncImportNestedYield.js index 73a55fe1ec2b8..f54fde34c6a9a 100644 --- a/tests/baselines/reference/asyncImportNestedYield.js +++ b/tests/baselines/reference/asyncImportNestedYield.js @@ -6,6 +6,7 @@ async function* foo() { } //// [asyncImportNestedYield.js] +"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); diff --git a/tests/baselines/reference/asyncImportedPromise_es5(target=es2015).errors.txt b/tests/baselines/reference/asyncImportedPromise_es5(target=es2015).errors.txt index e26e60423e201..74db2ebc32c9f 100644 --- a/tests/baselines/reference/asyncImportedPromise_es5(target=es2015).errors.txt +++ b/tests/baselines/reference/asyncImportedPromise_es5(target=es2015).errors.txt @@ -1,13 +1,18 @@ test.ts(3,25): error TS1064: The return type of an async function or method must be the global Promise type. Did you mean to write 'Promise'? +test.ts(3,35): error TS2322: Type 'undefined' is not assignable to type 'T'. + 'T' could be instantiated with an arbitrary type which could be unrelated to 'undefined'. ==== task.ts (0 errors) ==== export class Task extends Promise { } -==== test.ts (1 errors) ==== +==== test.ts (2 errors) ==== import { Task } from "./task"; class Test { async example(): Task { return; } ~~~~~~~ !!! error TS1064: The return type of an async function or method must be the global Promise type. Did you mean to write 'Promise'? + ~~~~~~ +!!! error TS2322: Type 'undefined' is not assignable to type 'T'. +!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'undefined'. } \ No newline at end of file diff --git a/tests/baselines/reference/asyncImportedPromise_es5(target=es5).errors.txt b/tests/baselines/reference/asyncImportedPromise_es5(target=es5).errors.txt index 1c173ab403cf9..025cb49682658 100644 --- a/tests/baselines/reference/asyncImportedPromise_es5(target=es5).errors.txt +++ b/tests/baselines/reference/asyncImportedPromise_es5(target=es5).errors.txt @@ -1,12 +1,17 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +test.ts(3,35): error TS2322: Type 'undefined' is not assignable to type 'T'. + 'T' could be instantiated with an arbitrary type which could be unrelated to 'undefined'. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ==== task.ts (0 errors) ==== export class Task extends Promise { } -==== test.ts (0 errors) ==== +==== test.ts (1 errors) ==== import { Task } from "./task"; class Test { async example(): Task { return; } + ~~~~~~ +!!! error TS2322: Type 'undefined' is not assignable to type 'T'. +!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'undefined'. } \ No newline at end of file diff --git a/tests/baselines/reference/asyncImportedPromise_es6.errors.txt b/tests/baselines/reference/asyncImportedPromise_es6.errors.txt index e26e60423e201..74db2ebc32c9f 100644 --- a/tests/baselines/reference/asyncImportedPromise_es6.errors.txt +++ b/tests/baselines/reference/asyncImportedPromise_es6.errors.txt @@ -1,13 +1,18 @@ test.ts(3,25): error TS1064: The return type of an async function or method must be the global Promise type. Did you mean to write 'Promise'? +test.ts(3,35): error TS2322: Type 'undefined' is not assignable to type 'T'. + 'T' could be instantiated with an arbitrary type which could be unrelated to 'undefined'. ==== task.ts (0 errors) ==== export class Task extends Promise { } -==== test.ts (1 errors) ==== +==== test.ts (2 errors) ==== import { Task } from "./task"; class Test { async example(): Task { return; } ~~~~~~~ !!! error TS1064: The return type of an async function or method must be the global Promise type. Did you mean to write 'Promise'? + ~~~~~~ +!!! error TS2322: Type 'undefined' is not assignable to type 'T'. +!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'undefined'. } \ No newline at end of file diff --git a/tests/baselines/reference/asyncInterface_es5(target=es2015).js b/tests/baselines/reference/asyncInterface_es5(target=es2015).js index 5931d9bb76a39..a5806bce7f952 100644 --- a/tests/baselines/reference/asyncInterface_es5(target=es2015).js +++ b/tests/baselines/reference/asyncInterface_es5(target=es2015).js @@ -5,3 +5,4 @@ async interface I { } //// [asyncInterface_es5.js] +"use strict"; diff --git a/tests/baselines/reference/asyncInterface_es5(target=es5).js b/tests/baselines/reference/asyncInterface_es5(target=es5).js index 5931d9bb76a39..a5806bce7f952 100644 --- a/tests/baselines/reference/asyncInterface_es5(target=es5).js +++ b/tests/baselines/reference/asyncInterface_es5(target=es5).js @@ -5,3 +5,4 @@ async interface I { } //// [asyncInterface_es5.js] +"use strict"; diff --git a/tests/baselines/reference/asyncInterface_es6.js b/tests/baselines/reference/asyncInterface_es6.js index a27c90897b3f6..ac39c93f2368d 100644 --- a/tests/baselines/reference/asyncInterface_es6.js +++ b/tests/baselines/reference/asyncInterface_es6.js @@ -5,3 +5,4 @@ async interface I { } //// [asyncInterface_es6.js] +"use strict"; diff --git a/tests/baselines/reference/asyncMethodWithSuperConflict_es6.js b/tests/baselines/reference/asyncMethodWithSuperConflict_es6.js index bdf1f507d4cd6..6f461525e3377 100644 --- a/tests/baselines/reference/asyncMethodWithSuperConflict_es6.js +++ b/tests/baselines/reference/asyncMethodWithSuperConflict_es6.js @@ -62,6 +62,7 @@ class B extends A { //// [asyncMethodWithSuperConflict_es6.js] +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { diff --git a/tests/baselines/reference/asyncMethodWithSuper_es2017.js b/tests/baselines/reference/asyncMethodWithSuper_es2017.js index 9db78311dca93..8de35871da20b 100644 --- a/tests/baselines/reference/asyncMethodWithSuper_es2017.js +++ b/tests/baselines/reference/asyncMethodWithSuper_es2017.js @@ -58,6 +58,7 @@ class B extends A { //// [asyncMethodWithSuper_es2017.js] +"use strict"; class A { x() { } diff --git a/tests/baselines/reference/asyncMethodWithSuper_es5(target=es2015).js b/tests/baselines/reference/asyncMethodWithSuper_es5(target=es2015).js index 973a66e85459e..afe791a19d9d5 100644 --- a/tests/baselines/reference/asyncMethodWithSuper_es5(target=es2015).js +++ b/tests/baselines/reference/asyncMethodWithSuper_es5(target=es2015).js @@ -58,6 +58,7 @@ class B extends A { //// [asyncMethodWithSuper_es5.js] +"use strict"; class A { x() { } diff --git a/tests/baselines/reference/asyncMethodWithSuper_es5(target=es5).js b/tests/baselines/reference/asyncMethodWithSuper_es5(target=es5).js index d58d7f2f0a8f8..efd86929730f1 100644 --- a/tests/baselines/reference/asyncMethodWithSuper_es5(target=es5).js +++ b/tests/baselines/reference/asyncMethodWithSuper_es5(target=es5).js @@ -58,6 +58,7 @@ class B extends A { //// [asyncMethodWithSuper_es5.js] +"use strict"; var A = /** @class */ (function () { function A() { } diff --git a/tests/baselines/reference/asyncMethodWithSuper_es6.js b/tests/baselines/reference/asyncMethodWithSuper_es6.js index f011f488a83df..e354cad7acdcc 100644 --- a/tests/baselines/reference/asyncMethodWithSuper_es6.js +++ b/tests/baselines/reference/asyncMethodWithSuper_es6.js @@ -216,6 +216,7 @@ class Derived extends Base { //// [asyncMethodWithSuper_es6.js] +"use strict"; class A { x() { } diff --git a/tests/baselines/reference/asyncModule_es5(target=es2015).js b/tests/baselines/reference/asyncModule_es5(target=es2015).js index 2fdf36581c62b..82b0ff8f6527e 100644 --- a/tests/baselines/reference/asyncModule_es5(target=es2015).js +++ b/tests/baselines/reference/asyncModule_es5(target=es2015).js @@ -5,3 +5,4 @@ async namespace M { } //// [asyncModule_es5.js] +"use strict"; diff --git a/tests/baselines/reference/asyncModule_es5(target=es5).js b/tests/baselines/reference/asyncModule_es5(target=es5).js index 2fdf36581c62b..82b0ff8f6527e 100644 --- a/tests/baselines/reference/asyncModule_es5(target=es5).js +++ b/tests/baselines/reference/asyncModule_es5(target=es5).js @@ -5,3 +5,4 @@ async namespace M { } //// [asyncModule_es5.js] +"use strict"; diff --git a/tests/baselines/reference/asyncModule_es6.js b/tests/baselines/reference/asyncModule_es6.js index f89a892e9aa69..b02b1bae46747 100644 --- a/tests/baselines/reference/asyncModule_es6.js +++ b/tests/baselines/reference/asyncModule_es6.js @@ -5,3 +5,4 @@ async namespace M { } //// [asyncModule_es6.js] +"use strict"; diff --git a/tests/baselines/reference/asyncMultiFile_es5(target=es2015).js b/tests/baselines/reference/asyncMultiFile_es5(target=es2015).js index fa46f1cdbd7f0..eb5fa2e304d91 100644 --- a/tests/baselines/reference/asyncMultiFile_es5(target=es2015).js +++ b/tests/baselines/reference/asyncMultiFile_es5(target=es2015).js @@ -6,6 +6,7 @@ async function f() {} function g() { } //// [a.js] +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { @@ -19,4 +20,5 @@ function f() { return __awaiter(this, void 0, void 0, function* () { }); } //// [b.js] +"use strict"; function g() { } diff --git a/tests/baselines/reference/asyncMultiFile_es5(target=es5).js b/tests/baselines/reference/asyncMultiFile_es5(target=es5).js index e022b1e864a6b..3068938535652 100644 --- a/tests/baselines/reference/asyncMultiFile_es5(target=es5).js +++ b/tests/baselines/reference/asyncMultiFile_es5(target=es5).js @@ -6,6 +6,7 @@ async function f() {} function g() { } //// [a.js] +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { @@ -48,4 +49,5 @@ function f() { }); }); } //// [b.js] +"use strict"; function g() { } diff --git a/tests/baselines/reference/asyncMultiFile_es6.js b/tests/baselines/reference/asyncMultiFile_es6.js index 7fbb00063c7aa..5621e21feb0ef 100644 --- a/tests/baselines/reference/asyncMultiFile_es6.js +++ b/tests/baselines/reference/asyncMultiFile_es6.js @@ -6,6 +6,7 @@ async function f() {} function g() { } //// [a.js] +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { @@ -19,4 +20,5 @@ function f() { return __awaiter(this, void 0, void 0, function* () { }); } //// [b.js] +"use strict"; function g() { } diff --git a/tests/baselines/reference/asyncOrYieldAsBindingIdentifier1.errors.txt b/tests/baselines/reference/asyncOrYieldAsBindingIdentifier1.errors.txt index 2f031b8577301..b45795634ffc4 100644 --- a/tests/baselines/reference/asyncOrYieldAsBindingIdentifier1.errors.txt +++ b/tests/baselines/reference/asyncOrYieldAsBindingIdentifier1.errors.txt @@ -1,12 +1,15 @@ asyncOrYieldAsBindingIdentifier1.ts(14,9): error TS1359: Identifier expected. 'await' is a reserved word that cannot be used here. asyncOrYieldAsBindingIdentifier1.ts(18,9): error TS1359: Identifier expected. 'await' is a reserved word that cannot be used here. asyncOrYieldAsBindingIdentifier1.ts(22,11): error TS1359: Identifier expected. 'await' is a reserved word that cannot be used here. -asyncOrYieldAsBindingIdentifier1.ts(38,9): error TS1359: Identifier expected. 'yield' is a reserved word that cannot be used here. -asyncOrYieldAsBindingIdentifier1.ts(42,9): error TS1359: Identifier expected. 'yield' is a reserved word that cannot be used here. -asyncOrYieldAsBindingIdentifier1.ts(46,11): error TS1359: Identifier expected. 'yield' is a reserved word that cannot be used here. +asyncOrYieldAsBindingIdentifier1.ts(26,9): error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. +asyncOrYieldAsBindingIdentifier1.ts(30,9): error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. +asyncOrYieldAsBindingIdentifier1.ts(34,11): error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. +asyncOrYieldAsBindingIdentifier1.ts(38,9): error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. +asyncOrYieldAsBindingIdentifier1.ts(42,9): error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. +asyncOrYieldAsBindingIdentifier1.ts(46,11): error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. -==== asyncOrYieldAsBindingIdentifier1.ts (6 errors) ==== +==== asyncOrYieldAsBindingIdentifier1.ts (9 errors) ==== function f_let () { let await = 1 } @@ -39,30 +42,36 @@ asyncOrYieldAsBindingIdentifier1.ts(46,11): error TS1359: Identifier expected. ' function f3_let () { let yield = 2 + ~~~~~ +!!! error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. } function f3_var () { var yield = 2 + ~~~~~ +!!! error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. } function f3_const () { const yield = 2 + ~~~~~ +!!! error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. } function * f4_let () { let yield = 2; ~~~~~ -!!! error TS1359: Identifier expected. 'yield' is a reserved word that cannot be used here. +!!! error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. } function * f4_var () { var yield = 2; ~~~~~ -!!! error TS1359: Identifier expected. 'yield' is a reserved word that cannot be used here. +!!! error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. } function * f4_const () { const yield = 2; ~~~~~ -!!! error TS1359: Identifier expected. 'yield' is a reserved word that cannot be used here. +!!! error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. } \ No newline at end of file diff --git a/tests/baselines/reference/asyncOrYieldAsBindingIdentifier1.js b/tests/baselines/reference/asyncOrYieldAsBindingIdentifier1.js index 5b00ae26ea9d4..d349cd0bbec08 100644 --- a/tests/baselines/reference/asyncOrYieldAsBindingIdentifier1.js +++ b/tests/baselines/reference/asyncOrYieldAsBindingIdentifier1.js @@ -50,6 +50,7 @@ function * f4_const () { } //// [asyncOrYieldAsBindingIdentifier1.js] +"use strict"; function f_let() { let await = 1; } diff --git a/tests/baselines/reference/asyncQualifiedReturnType_es5(target=es2015).js b/tests/baselines/reference/asyncQualifiedReturnType_es5(target=es2015).js index 381b121316173..eea0f46804bdb 100644 --- a/tests/baselines/reference/asyncQualifiedReturnType_es5(target=es2015).js +++ b/tests/baselines/reference/asyncQualifiedReturnType_es5(target=es2015).js @@ -10,6 +10,7 @@ async function f(): X.MyPromise { } //// [asyncQualifiedReturnType_es5.js] +"use strict"; var X; (function (X) { class MyPromise extends Promise { diff --git a/tests/baselines/reference/asyncQualifiedReturnType_es5(target=es5).js b/tests/baselines/reference/asyncQualifiedReturnType_es5(target=es5).js index d6414fb7967ea..12bf329a11a56 100644 --- a/tests/baselines/reference/asyncQualifiedReturnType_es5(target=es5).js +++ b/tests/baselines/reference/asyncQualifiedReturnType_es5(target=es5).js @@ -10,6 +10,7 @@ async function f(): X.MyPromise { } //// [asyncQualifiedReturnType_es5.js] +"use strict"; var X; (function (X) { var MyPromise = /** @class */ (function (_super) { diff --git a/tests/baselines/reference/asyncQualifiedReturnType_es6.js b/tests/baselines/reference/asyncQualifiedReturnType_es6.js index f75dca441f049..38be11eede657 100644 --- a/tests/baselines/reference/asyncQualifiedReturnType_es6.js +++ b/tests/baselines/reference/asyncQualifiedReturnType_es6.js @@ -10,6 +10,7 @@ async function f(): X.MyPromise { } //// [asyncQualifiedReturnType_es6.js] +"use strict"; var X; (function (X) { class MyPromise extends Promise { diff --git a/tests/baselines/reference/asyncSetter_es5(target=es2015).js b/tests/baselines/reference/asyncSetter_es5(target=es2015).js index 33922c0ac729e..09de5855ac0fb 100644 --- a/tests/baselines/reference/asyncSetter_es5(target=es2015).js +++ b/tests/baselines/reference/asyncSetter_es5(target=es2015).js @@ -7,6 +7,7 @@ class C { } //// [asyncSetter_es5.js] +"use strict"; class C { set foo(value) { } diff --git a/tests/baselines/reference/asyncSetter_es5(target=es5).js b/tests/baselines/reference/asyncSetter_es5(target=es5).js index 78ab925022a50..c5357e34ee04f 100644 --- a/tests/baselines/reference/asyncSetter_es5(target=es5).js +++ b/tests/baselines/reference/asyncSetter_es5(target=es5).js @@ -7,6 +7,7 @@ class C { } //// [asyncSetter_es5.js] +"use strict"; var C = /** @class */ (function () { function C() { } diff --git a/tests/baselines/reference/asyncSetter_es6.js b/tests/baselines/reference/asyncSetter_es6.js index be7393244047e..72faf0879645b 100644 --- a/tests/baselines/reference/asyncSetter_es6.js +++ b/tests/baselines/reference/asyncSetter_es6.js @@ -7,6 +7,7 @@ class C { } //// [asyncSetter_es6.js] +"use strict"; class C { set foo(value) { } diff --git a/tests/baselines/reference/asyncUnParenthesizedArrowFunction_es2017.js b/tests/baselines/reference/asyncUnParenthesizedArrowFunction_es2017.js index 42e28b3ced2c9..90aa398908257 100644 --- a/tests/baselines/reference/asyncUnParenthesizedArrowFunction_es2017.js +++ b/tests/baselines/reference/asyncUnParenthesizedArrowFunction_es2017.js @@ -6,5 +6,6 @@ const x = async i => await someOtherFunction(i) const x1 = async (i) => await someOtherFunction(i); //// [asyncUnParenthesizedArrowFunction_es2017.js] +"use strict"; const x = async (i) => await someOtherFunction(i); const x1 = async (i) => await someOtherFunction(i); diff --git a/tests/baselines/reference/asyncUnParenthesizedArrowFunction_es5(target=es2015).js b/tests/baselines/reference/asyncUnParenthesizedArrowFunction_es5(target=es2015).js index 391660eab9804..1b2469d1b9f80 100644 --- a/tests/baselines/reference/asyncUnParenthesizedArrowFunction_es5(target=es2015).js +++ b/tests/baselines/reference/asyncUnParenthesizedArrowFunction_es5(target=es2015).js @@ -6,5 +6,6 @@ const x = async i => await someOtherFunction(i) const x1 = async (i) => await someOtherFunction(i); //// [asyncUnParenthesizedArrowFunction_es5.js] -const x = (i) => __awaiter(this, void 0, void 0, function* () { return yield someOtherFunction(i); }); -const x1 = (i) => __awaiter(this, void 0, void 0, function* () { return yield someOtherFunction(i); }); +"use strict"; +const x = (i) => __awaiter(void 0, void 0, void 0, function* () { return yield someOtherFunction(i); }); +const x1 = (i) => __awaiter(void 0, void 0, void 0, function* () { return yield someOtherFunction(i); }); diff --git a/tests/baselines/reference/asyncUnParenthesizedArrowFunction_es5(target=es5).js b/tests/baselines/reference/asyncUnParenthesizedArrowFunction_es5(target=es5).js index c614bd2aa4889..554801da30de7 100644 --- a/tests/baselines/reference/asyncUnParenthesizedArrowFunction_es5(target=es5).js +++ b/tests/baselines/reference/asyncUnParenthesizedArrowFunction_es5(target=es5).js @@ -6,14 +6,14 @@ const x = async i => await someOtherFunction(i) const x1 = async (i) => await someOtherFunction(i); //// [asyncUnParenthesizedArrowFunction_es5.js] -var _this = this; -var x = function (i) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { +"use strict"; +var x = function (i) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) { switch (_a.label) { case 0: return [4 /*yield*/, someOtherFunction(i)]; case 1: return [2 /*return*/, _a.sent()]; } }); }); }; -var x1 = function (i) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { +var x1 = function (i) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) { switch (_a.label) { case 0: return [4 /*yield*/, someOtherFunction(i)]; case 1: return [2 /*return*/, _a.sent()]; diff --git a/tests/baselines/reference/asyncUnParenthesizedArrowFunction_es6.js b/tests/baselines/reference/asyncUnParenthesizedArrowFunction_es6.js index 676472b0adc74..798f01bac1781 100644 --- a/tests/baselines/reference/asyncUnParenthesizedArrowFunction_es6.js +++ b/tests/baselines/reference/asyncUnParenthesizedArrowFunction_es6.js @@ -6,5 +6,6 @@ const x = async i => await someOtherFunction(i) const x1 = async (i) => await someOtherFunction(i); //// [asyncUnParenthesizedArrowFunction_es6.js] -const x = (i) => __awaiter(this, void 0, void 0, function* () { return yield someOtherFunction(i); }); -const x1 = (i) => __awaiter(this, void 0, void 0, function* () { return yield someOtherFunction(i); }); +"use strict"; +const x = (i) => __awaiter(void 0, void 0, void 0, function* () { return yield someOtherFunction(i); }); +const x1 = (i) => __awaiter(void 0, void 0, void 0, function* () { return yield someOtherFunction(i); }); diff --git a/tests/baselines/reference/asyncUseStrict_es2017.js b/tests/baselines/reference/asyncUseStrict_es2017.js index 3dd25e9365d17..b52b5550224ff 100644 --- a/tests/baselines/reference/asyncUseStrict_es2017.js +++ b/tests/baselines/reference/asyncUseStrict_es2017.js @@ -9,6 +9,7 @@ async function func(): Promise { } //// [asyncUseStrict_es2017.js] +"use strict"; async function func() { "use strict"; var b = await p || a; diff --git a/tests/baselines/reference/asyncUseStrict_es5(target=es2015).js b/tests/baselines/reference/asyncUseStrict_es5(target=es2015).js index 20c7eb1546119..22c8980059671 100644 --- a/tests/baselines/reference/asyncUseStrict_es5(target=es2015).js +++ b/tests/baselines/reference/asyncUseStrict_es5(target=es2015).js @@ -9,6 +9,7 @@ async function func(): Promise { } //// [asyncUseStrict_es5.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function* () { "use strict"; diff --git a/tests/baselines/reference/asyncUseStrict_es5(target=es5).js b/tests/baselines/reference/asyncUseStrict_es5(target=es5).js index 52b21660678df..a1cc77221069c 100644 --- a/tests/baselines/reference/asyncUseStrict_es5(target=es5).js +++ b/tests/baselines/reference/asyncUseStrict_es5(target=es5).js @@ -9,6 +9,7 @@ async function func(): Promise { } //// [asyncUseStrict_es5.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function () { "use strict"; diff --git a/tests/baselines/reference/asyncUseStrict_es6.js b/tests/baselines/reference/asyncUseStrict_es6.js index 013cd747f0293..712e1b488fee9 100644 --- a/tests/baselines/reference/asyncUseStrict_es6.js +++ b/tests/baselines/reference/asyncUseStrict_es6.js @@ -9,6 +9,7 @@ async function func(): Promise { } //// [asyncUseStrict_es6.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function* () { "use strict"; diff --git a/tests/baselines/reference/asyncWithVarShadowing_es6.js b/tests/baselines/reference/asyncWithVarShadowing_es6.js index b9ba6480b99bf..2c230d0880efa 100644 --- a/tests/baselines/reference/asyncWithVarShadowing_es6.js +++ b/tests/baselines/reference/asyncWithVarShadowing_es6.js @@ -225,6 +225,7 @@ async function fn40(x) { //// [asyncWithVarShadowing_es6.js] +"use strict"; function fn1(x) { return __awaiter(this, void 0, void 0, function* () { var x; diff --git a/tests/baselines/reference/asyncYieldStarContextualType.types b/tests/baselines/reference/asyncYieldStarContextualType.types index fa37a8b0c9b11..bd7d3bf541662 100644 --- a/tests/baselines/reference/asyncYieldStarContextualType.types +++ b/tests/baselines/reference/asyncYieldStarContextualType.types @@ -69,12 +69,12 @@ async function* f(): AsyncGenerator<"NOT_FOUND_AUTHOR" | "NOT_FOUND_BOOK", BookW > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >authorPromise.then(mapper) : Promise> > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->authorPromise.then : , TResult2 = never>(onfulfilled?: (value: Result) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>authorPromise.then : , TResult2 = never>(onfulfilled?: ((value: Result) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >authorPromise : Promise> > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->then : , TResult2 = never>(onfulfilled?: (value: Result) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>then : , TResult2 = never>(onfulfilled?: ((value: Result) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >mapper : (result: Result) => Result > : ^ ^^ ^^ ^^^^^ @@ -90,12 +90,12 @@ async function* f(): AsyncGenerator<"NOT_FOUND_AUTHOR" | "NOT_FOUND_BOOK", BookW > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >authorPromise.then(mapper) : Promise> > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->authorPromise.then : , TResult2 = never>(onfulfilled?: (value: Result) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>authorPromise.then : , TResult2 = never>(onfulfilled?: ((value: Result) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >authorPromise : Promise> > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->then : , TResult2 = never>(onfulfilled?: (value: Result) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>then : , TResult2 = never>(onfulfilled?: ((value: Result) => TResult1 | PromiseLike) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike) | null | undefined) => Promise +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >mapper : (result: Result) => Result > : ^ ^^ ^^ ^^^^^ @@ -122,6 +122,6 @@ async function* f(): AsyncGenerator<"NOT_FOUND_AUTHOR" | "NOT_FOUND_BOOK", BookW return null! as BookWithAuthor; >null! as BookWithAuthor : BookWithAuthor > : ^^^^^^^^^^^^^^ ->null! : null -> : ^^^^ +>null! : never +> : ^^^^^ } diff --git a/tests/baselines/reference/augmentArray.js b/tests/baselines/reference/augmentArray.js index 91c071d93ec32..f743a8b4a504b 100644 --- a/tests/baselines/reference/augmentArray.js +++ b/tests/baselines/reference/augmentArray.js @@ -6,3 +6,4 @@ interface Array { } //// [augmentArray.js] +"use strict"; diff --git a/tests/baselines/reference/augmentExportEquals5.errors.txt b/tests/baselines/reference/augmentExportEquals5.errors.txt new file mode 100644 index 0000000000000..54e57e9a128fa --- /dev/null +++ b/tests/baselines/reference/augmentExportEquals5.errors.txt @@ -0,0 +1,84 @@ +consumer.ts(4,11): error TS2454: Variable 'x' is used before being assigned. + + +==== express.d.ts (0 errors) ==== + declare namespace Express { + export interface Request { } + export interface Response { } + export interface Application { } + } + + declare module "express" { + function e(): e.Express; + namespace e { + interface IRoute { + all(...handler: RequestHandler[]): IRoute; + } + + interface IRouterMatcher { + (name: string|RegExp, ...handlers: RequestHandler[]): T; + } + + interface IRouter extends RequestHandler { + route(path: string): IRoute; + } + + export function Router(options?: any): Router; + + export interface Router extends IRouter {} + + interface Errback { (err: Error): void; } + + interface Request extends Express.Request { + + get (name: string): string; + } + + interface Response extends Express.Response { + charset: string; + } + + interface ErrorRequestHandler { + (err: any, req: Request, res: Response, next: Function): any; + } + + interface RequestHandler { + (req: Request, res: Response, next: Function): any; + } + + interface Handler extends RequestHandler {} + + interface RequestParamHandler { + (req: Request, res: Response, next: Function, param: any): any; + } + + interface Application extends IRouter, Express.Application { + routes: any; + } + + interface Express extends Application { + createApplication(): Application; + } + + var static: any; + } + + export = e; + } + +==== augmentation.ts (0 errors) ==== + /// + import * as e from "express"; + declare module "express" { + interface Request { + id: number; + } + } + +==== consumer.ts (1 errors) ==== + import { Request } from "express"; + import "./augmentation"; + let x: Request; + const y = x.id; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/augmentExportEquals5.types b/tests/baselines/reference/augmentExportEquals5.types index bccab4f9d160e..254f7fe708c19 100644 --- a/tests/baselines/reference/augmentExportEquals5.types +++ b/tests/baselines/reference/augmentExportEquals5.types @@ -49,6 +49,7 @@ declare module "express" { >Router : (options?: any) => Router > : ^ ^^^ ^^^^^ >options : any +> : ^^^ export interface Router extends IRouter {} @@ -79,6 +80,7 @@ declare module "express" { interface ErrorRequestHandler { (err: any, req: Request, res: Response, next: Function): any; >err : any +> : ^^^ >req : Request > : ^^^^^^^ >res : Response @@ -108,6 +110,7 @@ declare module "express" { >next : Function > : ^^^^^^^^ >param : any +> : ^^^ } interface Application extends IRouter, Express.Application { @@ -116,6 +119,7 @@ declare module "express" { routes: any; >routes : any +> : ^^^ } interface Express extends Application { @@ -126,6 +130,7 @@ declare module "express" { var static: any; >static : any +> : ^^^ } export = e; diff --git a/tests/baselines/reference/augmentedClassWithPrototypePropertyOnModule.js b/tests/baselines/reference/augmentedClassWithPrototypePropertyOnModule.js index b9db7b5030505..aa1c7a2ad8b37 100644 --- a/tests/baselines/reference/augmentedClassWithPrototypePropertyOnModule.js +++ b/tests/baselines/reference/augmentedClassWithPrototypePropertyOnModule.js @@ -9,3 +9,4 @@ declare class m { } //// [augmentedClassWithPrototypePropertyOnModule.js] +"use strict"; diff --git a/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.js b/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.js index ff2f989ff79cf..c0f4f52887e37 100644 --- a/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.js +++ b/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.js @@ -24,6 +24,7 @@ var v2: { } = f; // Should be allowed //// [augmentedTypeAssignmentCompatIndexSignature.js] +"use strict"; var o = {}; var f = () => { }; var v1 = o; // Should be allowed diff --git a/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.js b/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.js index 144065f73e53a..61090ee1c7cce 100644 --- a/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.js +++ b/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.js @@ -16,5 +16,6 @@ var a = {}[0]; // Should be Foo var b = (() => { })[0]; // Should be Bar //// [augmentedTypeBracketAccessIndexSignature.js] +"use strict"; var a = {}[0]; // Should be Foo var b = (() => { })[0]; // Should be Bar diff --git a/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.js b/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.js index 77f4a07a7ae4d..b6f538f97d554 100644 --- a/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.js +++ b/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.js @@ -16,6 +16,7 @@ var r3 = f['functionData']; // Should be string var r4 = f['data']; // Should be number //// [augmentedTypeBracketNamedPropertyAccess.js] +"use strict"; var o = {}; var f = function () { }; var r1 = o['data']; // Should be number diff --git a/tests/baselines/reference/augmentedTypesClass.js b/tests/baselines/reference/augmentedTypesClass.js index e1c7e35bf53cc..bd0212bf72cc3 100644 --- a/tests/baselines/reference/augmentedTypesClass.js +++ b/tests/baselines/reference/augmentedTypesClass.js @@ -10,6 +10,7 @@ class c4 { public foo() { } } enum c4 { One } // error //// [augmentedTypesClass.js] +"use strict"; //// class then var class c1 { foo() { } diff --git a/tests/baselines/reference/augmentedTypesClass2.js b/tests/baselines/reference/augmentedTypesClass2.js index e90cc001fab2b..d83f8f59acee3 100644 --- a/tests/baselines/reference/augmentedTypesClass2.js +++ b/tests/baselines/reference/augmentedTypesClass2.js @@ -33,6 +33,7 @@ class c44 { //// [augmentedTypesClass2.js] +"use strict"; // Checking class with other things in type space not value space // class then interface class c11 { diff --git a/tests/baselines/reference/augmentedTypesClass2a.js b/tests/baselines/reference/augmentedTypesClass2a.js index 79d5f848912cd..12938192eba66 100644 --- a/tests/baselines/reference/augmentedTypesClass2a.js +++ b/tests/baselines/reference/augmentedTypesClass2a.js @@ -7,6 +7,7 @@ function c2() { } // error var c2 = () => { } //// [augmentedTypesClass2a.js] +"use strict"; //// class then function class c2 { foo() { } diff --git a/tests/baselines/reference/augmentedTypesClass3.js b/tests/baselines/reference/augmentedTypesClass3.js index 262b861001567..6e9d0cf51eb87 100644 --- a/tests/baselines/reference/augmentedTypesClass3.js +++ b/tests/baselines/reference/augmentedTypesClass3.js @@ -16,6 +16,7 @@ class c5c { public foo() { } } //import c5c = require(''); //// [augmentedTypesClass3.js] +"use strict"; // class then module class c5 { foo() { } diff --git a/tests/baselines/reference/augmentedTypesClass4.js b/tests/baselines/reference/augmentedTypesClass4.js index 5ed89197d80e4..2a67f7e4453bd 100644 --- a/tests/baselines/reference/augmentedTypesClass4.js +++ b/tests/baselines/reference/augmentedTypesClass4.js @@ -7,6 +7,7 @@ class c3 { public bar() { } } // error //// [augmentedTypesClass4.js] +"use strict"; //// class then class class c3 { foo() { } diff --git a/tests/baselines/reference/augmentedTypesEnum.js b/tests/baselines/reference/augmentedTypesEnum.js index 53aca02cd2eed..e4e55b7effbab 100644 --- a/tests/baselines/reference/augmentedTypesEnum.js +++ b/tests/baselines/reference/augmentedTypesEnum.js @@ -38,6 +38,7 @@ namespace e6b { export var y = 2; } // should be error //import e7 = require(''); // should be error //// [augmentedTypesEnum.js] +"use strict"; // enum then var var e1111; (function (e1111) { diff --git a/tests/baselines/reference/augmentedTypesEnum2.js b/tests/baselines/reference/augmentedTypesEnum2.js index 94e29b5afe1e5..7742c524cd5f7 100644 --- a/tests/baselines/reference/augmentedTypesEnum2.js +++ b/tests/baselines/reference/augmentedTypesEnum2.js @@ -22,6 +22,7 @@ class e2 { // error //enum then import - covered //// [augmentedTypesEnum2.js] +"use strict"; // enum then interface var e1; (function (e1) { diff --git a/tests/baselines/reference/augmentedTypesEnum3.js b/tests/baselines/reference/augmentedTypesEnum3.js index 8973e765299d1..e4a2d645c2927 100644 --- a/tests/baselines/reference/augmentedTypesEnum3.js +++ b/tests/baselines/reference/augmentedTypesEnum3.js @@ -23,6 +23,7 @@ namespace A { } //// [augmentedTypesEnum3.js] +"use strict"; var E; (function (E) { var t; diff --git a/tests/baselines/reference/augmentedTypesFunction.js b/tests/baselines/reference/augmentedTypesFunction.js index 4da5627a3e481..5d2f33d6de47a 100644 --- a/tests/baselines/reference/augmentedTypesFunction.js +++ b/tests/baselines/reference/augmentedTypesFunction.js @@ -41,6 +41,7 @@ namespace y5c { export interface I { foo(): void } } // should be an error //import y6 = require(''); //// [augmentedTypesFunction.js] +"use strict"; // function then var function y1() { } // error var y1 = 1; // error diff --git a/tests/baselines/reference/augmentedTypesInterface.js b/tests/baselines/reference/augmentedTypesInterface.js index 0d3698bb3908f..524ef59984bff 100644 --- a/tests/baselines/reference/augmentedTypesInterface.js +++ b/tests/baselines/reference/augmentedTypesInterface.js @@ -36,6 +36,7 @@ interface i4 { //import i4 = require(''); // error //// [augmentedTypesInterface.js] +"use strict"; // interface then interface class i2 { bar() { diff --git a/tests/baselines/reference/augmentedTypesModules.js b/tests/baselines/reference/augmentedTypesModules.js index 1ec3070df5228..68cd72389bb5c 100644 --- a/tests/baselines/reference/augmentedTypesModules.js +++ b/tests/baselines/reference/augmentedTypesModules.js @@ -100,6 +100,7 @@ namespace m6 { export var y = 2; } //// [augmentedTypesModules.js] +"use strict"; var m1 = 1; // Should be allowed var m1a; (function (m1a) { diff --git a/tests/baselines/reference/augmentedTypesModules2.js b/tests/baselines/reference/augmentedTypesModules2.js index b1ec007ab8bce..5bdc07c785432 100644 --- a/tests/baselines/reference/augmentedTypesModules2.js +++ b/tests/baselines/reference/augmentedTypesModules2.js @@ -31,6 +31,7 @@ namespace m2g { export class C { foo() { } } } //// [augmentedTypesModules2.js] +"use strict"; function m2() { } ; // ok since the module is not instantiated var m2a; diff --git a/tests/baselines/reference/augmentedTypesModules3.js b/tests/baselines/reference/augmentedTypesModules3.js index 5fff2254b4848..0e3388f50cee0 100644 --- a/tests/baselines/reference/augmentedTypesModules3.js +++ b/tests/baselines/reference/augmentedTypesModules3.js @@ -9,6 +9,7 @@ namespace m3a { var y = 2; } class m3a { foo() { } } // error, class isn't ambient or declared before the module //// [augmentedTypesModules3.js] +"use strict"; class m3 { } // ok since the module is not instantiated var m3a; diff --git a/tests/baselines/reference/augmentedTypesModules3b.js b/tests/baselines/reference/augmentedTypesModules3b.js index b5029a3aae155..aa25be12afe83 100644 --- a/tests/baselines/reference/augmentedTypesModules3b.js +++ b/tests/baselines/reference/augmentedTypesModules3b.js @@ -21,6 +21,7 @@ namespace m3g { export class C { foo() { } } } //// [augmentedTypesModules3b.js] +"use strict"; class m3b { foo() { } } diff --git a/tests/baselines/reference/augmentedTypesModules4.js b/tests/baselines/reference/augmentedTypesModules4.js index 5fb8bedfec4f1..9887a7c92aaaf 100644 --- a/tests/baselines/reference/augmentedTypesModules4.js +++ b/tests/baselines/reference/augmentedTypesModules4.js @@ -25,6 +25,7 @@ namespace m5 { export interface I { foo(): void } } // should already be reasona //// [augmentedTypesModules4.js] +"use strict"; var m4; (function (m4) { })(m4 || (m4 = {})); diff --git a/tests/baselines/reference/augmentedTypesVar.js b/tests/baselines/reference/augmentedTypesVar.js index 2817c4255a424..83f3b3a862816 100644 --- a/tests/baselines/reference/augmentedTypesVar.js +++ b/tests/baselines/reference/augmentedTypesVar.js @@ -39,6 +39,7 @@ namespace x6b { export var y = 2; } // error //// [augmentedTypesVar.js] +"use strict"; // var then var var x1 = 1; var x1 = 2; diff --git a/tests/baselines/reference/autoAccessor1(target=es2015).js b/tests/baselines/reference/autoAccessor1(target=es2015).js index e05e19fa51df5..ceec50f660f7e 100644 --- a/tests/baselines/reference/autoAccessor1(target=es2015).js +++ b/tests/baselines/reference/autoAccessor1(target=es2015).js @@ -10,6 +10,7 @@ class C1 { //// [autoAccessor1.js] +"use strict"; var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); diff --git a/tests/baselines/reference/autoAccessor1(target=es2022).js b/tests/baselines/reference/autoAccessor1(target=es2022).js index 639219b1deb97..cc42afbe943aa 100644 --- a/tests/baselines/reference/autoAccessor1(target=es2022).js +++ b/tests/baselines/reference/autoAccessor1(target=es2022).js @@ -10,6 +10,7 @@ class C1 { //// [autoAccessor1.js] +"use strict"; class C1 { #a_accessor_storage; get a() { return this.#a_accessor_storage; } diff --git a/tests/baselines/reference/autoAccessor1(target=esnext).js b/tests/baselines/reference/autoAccessor1(target=esnext).js index 7be10ab1fe84c..5773958b092fd 100644 --- a/tests/baselines/reference/autoAccessor1(target=esnext).js +++ b/tests/baselines/reference/autoAccessor1(target=esnext).js @@ -10,6 +10,7 @@ class C1 { //// [autoAccessor1.js] +"use strict"; class C1 { accessor a; accessor b = 1; diff --git a/tests/baselines/reference/autoAccessor10.js b/tests/baselines/reference/autoAccessor10.js index 77170c8e85b72..ee4c42e3a6aae 100644 --- a/tests/baselines/reference/autoAccessor10.js +++ b/tests/baselines/reference/autoAccessor10.js @@ -31,6 +31,7 @@ class C4_2 { } //// [autoAccessor10.js] +"use strict"; class C1 { #a0_accessor_storage = 1; get a0() { return this.#a0_accessor_storage; } diff --git a/tests/baselines/reference/autoAccessor11.js b/tests/baselines/reference/autoAccessor11.js index 30097d652c87e..8165331830af1 100644 --- a/tests/baselines/reference/autoAccessor11.js +++ b/tests/baselines/reference/autoAccessor11.js @@ -18,6 +18,7 @@ class C { //// [autoAccessor11.js] +"use strict"; class C { accessor; a; diff --git a/tests/baselines/reference/autoAccessor2(target=es2015).js b/tests/baselines/reference/autoAccessor2(target=es2015).js index 7f5a806a58777..835afb13389d2 100644 --- a/tests/baselines/reference/autoAccessor2(target=es2015).js +++ b/tests/baselines/reference/autoAccessor2(target=es2015).js @@ -20,6 +20,7 @@ class C1 { //// [autoAccessor2.js] +"use strict"; var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); diff --git a/tests/baselines/reference/autoAccessor2(target=es2022).js b/tests/baselines/reference/autoAccessor2(target=es2022).js index 7efd7c0b5c957..873a3e0e990d8 100644 --- a/tests/baselines/reference/autoAccessor2(target=es2022).js +++ b/tests/baselines/reference/autoAccessor2(target=es2022).js @@ -20,6 +20,7 @@ class C1 { //// [autoAccessor2.js] +"use strict"; class C1 { #a_accessor_storage; get #a() { return this.#a_accessor_storage; } diff --git a/tests/baselines/reference/autoAccessor2(target=esnext).js b/tests/baselines/reference/autoAccessor2(target=esnext).js index 6840304ca67f9..6d5fb00004578 100644 --- a/tests/baselines/reference/autoAccessor2(target=esnext).js +++ b/tests/baselines/reference/autoAccessor2(target=esnext).js @@ -20,6 +20,7 @@ class C1 { //// [autoAccessor2.js] +"use strict"; class C1 { accessor #a; accessor #b = 1; diff --git a/tests/baselines/reference/autoAccessor3(target=es2015).js b/tests/baselines/reference/autoAccessor3(target=es2015).js index 4e664b01eff63..eea8d3a184403 100644 --- a/tests/baselines/reference/autoAccessor3(target=es2015).js +++ b/tests/baselines/reference/autoAccessor3(target=es2015).js @@ -10,6 +10,7 @@ class C1 { //// [autoAccessor3.js] +"use strict"; var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); diff --git a/tests/baselines/reference/autoAccessor3(target=es2022).js b/tests/baselines/reference/autoAccessor3(target=es2022).js index 142a66e96781a..f9ee4c99ca293 100644 --- a/tests/baselines/reference/autoAccessor3(target=es2022).js +++ b/tests/baselines/reference/autoAccessor3(target=es2022).js @@ -10,6 +10,7 @@ class C1 { //// [autoAccessor3.js] +"use strict"; class C1 { #_a_accessor_storage; get "w"() { return this.#_a_accessor_storage; } diff --git a/tests/baselines/reference/autoAccessor3(target=esnext).js b/tests/baselines/reference/autoAccessor3(target=esnext).js index cb2e729e0df15..256041c2f8d93 100644 --- a/tests/baselines/reference/autoAccessor3(target=esnext).js +++ b/tests/baselines/reference/autoAccessor3(target=esnext).js @@ -10,6 +10,7 @@ class C1 { //// [autoAccessor3.js] +"use strict"; class C1 { accessor "w"; accessor "x" = 1; diff --git a/tests/baselines/reference/autoAccessor4(target=es2015).js b/tests/baselines/reference/autoAccessor4(target=es2015).js index 3c774d990f336..314427fd44392 100644 --- a/tests/baselines/reference/autoAccessor4(target=es2015).js +++ b/tests/baselines/reference/autoAccessor4(target=es2015).js @@ -10,6 +10,7 @@ class C1 { //// [autoAccessor4.js] +"use strict"; var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); diff --git a/tests/baselines/reference/autoAccessor4(target=es2022).js b/tests/baselines/reference/autoAccessor4(target=es2022).js index 96a732d592d4b..21a93235a6347 100644 --- a/tests/baselines/reference/autoAccessor4(target=es2022).js +++ b/tests/baselines/reference/autoAccessor4(target=es2022).js @@ -10,6 +10,7 @@ class C1 { //// [autoAccessor4.js] +"use strict"; class C1 { #_a_accessor_storage; get 0() { return this.#_a_accessor_storage; } diff --git a/tests/baselines/reference/autoAccessor4(target=esnext).js b/tests/baselines/reference/autoAccessor4(target=esnext).js index 1e0ae8b496e3e..2457ce2fa712f 100644 --- a/tests/baselines/reference/autoAccessor4(target=esnext).js +++ b/tests/baselines/reference/autoAccessor4(target=esnext).js @@ -10,6 +10,7 @@ class C1 { //// [autoAccessor4.js] +"use strict"; class C1 { accessor 0; accessor 1 = 1; diff --git a/tests/baselines/reference/autoAccessor5(target=es2015).js b/tests/baselines/reference/autoAccessor5(target=es2015).js index edafc0c9da1d2..4cc738208c4ad 100644 --- a/tests/baselines/reference/autoAccessor5(target=es2015).js +++ b/tests/baselines/reference/autoAccessor5(target=es2015).js @@ -14,6 +14,7 @@ class C2 { } //// [autoAccessor5.js] +"use strict"; var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); diff --git a/tests/baselines/reference/autoAccessor5(target=es2022).js b/tests/baselines/reference/autoAccessor5(target=es2022).js index ffee7eeaf6a93..afc469b4a6d5b 100644 --- a/tests/baselines/reference/autoAccessor5(target=es2022).js +++ b/tests/baselines/reference/autoAccessor5(target=es2022).js @@ -14,6 +14,7 @@ class C2 { } //// [autoAccessor5.js] +"use strict"; var _a; class C1 { #_a_accessor_storage; diff --git a/tests/baselines/reference/autoAccessor5(target=es5).js b/tests/baselines/reference/autoAccessor5(target=es5).js index 208bcefb2636e..e3fffe341efbf 100644 --- a/tests/baselines/reference/autoAccessor5(target=es5).js +++ b/tests/baselines/reference/autoAccessor5(target=es5).js @@ -14,6 +14,7 @@ class C2 { } //// [autoAccessor5.js] +"use strict"; var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); diff --git a/tests/baselines/reference/autoAccessor5(target=esnext).js b/tests/baselines/reference/autoAccessor5(target=esnext).js index 96847a123eb4e..1a68f13aa9098 100644 --- a/tests/baselines/reference/autoAccessor5(target=esnext).js +++ b/tests/baselines/reference/autoAccessor5(target=esnext).js @@ -14,6 +14,7 @@ class C2 { } //// [autoAccessor5.js] +"use strict"; class C1 { accessor ["w"]; accessor ["x"] = 1; diff --git a/tests/baselines/reference/autoAccessor6(target=es2015,usedefineforclassfields=false).js b/tests/baselines/reference/autoAccessor6(target=es2015,usedefineforclassfields=false).js index 3b8c4ecd41d52..7401b69beecdd 100644 --- a/tests/baselines/reference/autoAccessor6(target=es2015,usedefineforclassfields=false).js +++ b/tests/baselines/reference/autoAccessor6(target=es2015,usedefineforclassfields=false).js @@ -15,6 +15,7 @@ class C3 extends C1 { //// [autoAccessor6.js] +"use strict"; var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); diff --git a/tests/baselines/reference/autoAccessor6(target=es2015,usedefineforclassfields=true).js b/tests/baselines/reference/autoAccessor6(target=es2015,usedefineforclassfields=true).js index 4cee63158d1a5..ae7f920b01385 100644 --- a/tests/baselines/reference/autoAccessor6(target=es2015,usedefineforclassfields=true).js +++ b/tests/baselines/reference/autoAccessor6(target=es2015,usedefineforclassfields=true).js @@ -15,6 +15,7 @@ class C3 extends C1 { //// [autoAccessor6.js] +"use strict"; var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); diff --git a/tests/baselines/reference/autoAccessor6(target=es2022,usedefineforclassfields=false).js b/tests/baselines/reference/autoAccessor6(target=es2022,usedefineforclassfields=false).js index a8a2db5f108db..6c4577b6007d2 100644 --- a/tests/baselines/reference/autoAccessor6(target=es2022,usedefineforclassfields=false).js +++ b/tests/baselines/reference/autoAccessor6(target=es2022,usedefineforclassfields=false).js @@ -15,6 +15,7 @@ class C3 extends C1 { //// [autoAccessor6.js] +"use strict"; class C1 { #a_accessor_storage; get a() { return this.#a_accessor_storage; } diff --git a/tests/baselines/reference/autoAccessor6(target=es2022,usedefineforclassfields=true).js b/tests/baselines/reference/autoAccessor6(target=es2022,usedefineforclassfields=true).js index 00a43f638f6d4..9ef12fffd37cf 100644 --- a/tests/baselines/reference/autoAccessor6(target=es2022,usedefineforclassfields=true).js +++ b/tests/baselines/reference/autoAccessor6(target=es2022,usedefineforclassfields=true).js @@ -15,6 +15,7 @@ class C3 extends C1 { //// [autoAccessor6.js] +"use strict"; class C1 { #a_accessor_storage; get a() { return this.#a_accessor_storage; } diff --git a/tests/baselines/reference/autoAccessor6(target=esnext,usedefineforclassfields=false).js b/tests/baselines/reference/autoAccessor6(target=esnext,usedefineforclassfields=false).js index a1ee3e21c40e8..cf00ea392ebec 100644 --- a/tests/baselines/reference/autoAccessor6(target=esnext,usedefineforclassfields=false).js +++ b/tests/baselines/reference/autoAccessor6(target=esnext,usedefineforclassfields=false).js @@ -15,6 +15,7 @@ class C3 extends C1 { //// [autoAccessor6.js] +"use strict"; class C1 { accessor a; } diff --git a/tests/baselines/reference/autoAccessor6(target=esnext,usedefineforclassfields=true).js b/tests/baselines/reference/autoAccessor6(target=esnext,usedefineforclassfields=true).js index 36724c5f20183..12becbe0dfbc0 100644 --- a/tests/baselines/reference/autoAccessor6(target=esnext,usedefineforclassfields=true).js +++ b/tests/baselines/reference/autoAccessor6(target=esnext,usedefineforclassfields=true).js @@ -15,6 +15,7 @@ class C3 extends C1 { //// [autoAccessor6.js] +"use strict"; class C1 { accessor a; } diff --git a/tests/baselines/reference/autoAccessor7(target=es2015,usedefineforclassfields=false).js b/tests/baselines/reference/autoAccessor7(target=es2015,usedefineforclassfields=false).js index 0d7a38e94bb49..034c4cc15dc77 100644 --- a/tests/baselines/reference/autoAccessor7(target=es2015,usedefineforclassfields=false).js +++ b/tests/baselines/reference/autoAccessor7(target=es2015,usedefineforclassfields=false).js @@ -15,6 +15,7 @@ class C3 extends C1 { //// [autoAccessor7.js] +"use strict"; var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); diff --git a/tests/baselines/reference/autoAccessor7(target=es2015,usedefineforclassfields=true).js b/tests/baselines/reference/autoAccessor7(target=es2015,usedefineforclassfields=true).js index 0d7a38e94bb49..034c4cc15dc77 100644 --- a/tests/baselines/reference/autoAccessor7(target=es2015,usedefineforclassfields=true).js +++ b/tests/baselines/reference/autoAccessor7(target=es2015,usedefineforclassfields=true).js @@ -15,6 +15,7 @@ class C3 extends C1 { //// [autoAccessor7.js] +"use strict"; var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); diff --git a/tests/baselines/reference/autoAccessor7(target=es2022,usedefineforclassfields=false).js b/tests/baselines/reference/autoAccessor7(target=es2022,usedefineforclassfields=false).js index 161887407b527..d8007026aacf7 100644 --- a/tests/baselines/reference/autoAccessor7(target=es2022,usedefineforclassfields=false).js +++ b/tests/baselines/reference/autoAccessor7(target=es2022,usedefineforclassfields=false).js @@ -15,6 +15,7 @@ class C3 extends C1 { //// [autoAccessor7.js] +"use strict"; class C1 { } class C2 extends C1 { diff --git a/tests/baselines/reference/autoAccessor7(target=es2022,usedefineforclassfields=true).js b/tests/baselines/reference/autoAccessor7(target=es2022,usedefineforclassfields=true).js index 161887407b527..d8007026aacf7 100644 --- a/tests/baselines/reference/autoAccessor7(target=es2022,usedefineforclassfields=true).js +++ b/tests/baselines/reference/autoAccessor7(target=es2022,usedefineforclassfields=true).js @@ -15,6 +15,7 @@ class C3 extends C1 { //// [autoAccessor7.js] +"use strict"; class C1 { } class C2 extends C1 { diff --git a/tests/baselines/reference/autoAccessor7(target=esnext,usedefineforclassfields=false).js b/tests/baselines/reference/autoAccessor7(target=esnext,usedefineforclassfields=false).js index 4c3fccb2dc7f6..8367029f7cb27 100644 --- a/tests/baselines/reference/autoAccessor7(target=esnext,usedefineforclassfields=false).js +++ b/tests/baselines/reference/autoAccessor7(target=esnext,usedefineforclassfields=false).js @@ -15,6 +15,7 @@ class C3 extends C1 { //// [autoAccessor7.js] +"use strict"; class C1 { } class C2 extends C1 { diff --git a/tests/baselines/reference/autoAccessor7(target=esnext,usedefineforclassfields=true).js b/tests/baselines/reference/autoAccessor7(target=esnext,usedefineforclassfields=true).js index 4c3fccb2dc7f6..8367029f7cb27 100644 --- a/tests/baselines/reference/autoAccessor7(target=esnext,usedefineforclassfields=true).js +++ b/tests/baselines/reference/autoAccessor7(target=esnext,usedefineforclassfields=true).js @@ -15,6 +15,7 @@ class C3 extends C1 { //// [autoAccessor7.js] +"use strict"; class C1 { } class C2 extends C1 { diff --git a/tests/baselines/reference/autoAccessor8.js b/tests/baselines/reference/autoAccessor8.js index 3203876cec0ac..89add2d6a8958 100644 --- a/tests/baselines/reference/autoAccessor8.js +++ b/tests/baselines/reference/autoAccessor8.js @@ -21,6 +21,7 @@ function f() { //// [autoAccessor8.js] +"use strict"; class C1 { accessor a; static accessor b; diff --git a/tests/baselines/reference/autoAccessor9.js b/tests/baselines/reference/autoAccessor9.js index 5a0552f0e3432..fd90283ba07e0 100644 --- a/tests/baselines/reference/autoAccessor9.js +++ b/tests/baselines/reference/autoAccessor9.js @@ -49,6 +49,7 @@ class C7 { //// [autoAccessor9.js] +"use strict"; // Auto-accessors do not use Set semantics themselves, so do not need to be transformed if there are no other // initializers that need to be transformed: class C1 { diff --git a/tests/baselines/reference/autoAccessorAllowedModifiers.js b/tests/baselines/reference/autoAccessorAllowedModifiers.js index 204bdf2b5d55b..55b771845ca9c 100644 --- a/tests/baselines/reference/autoAccessorAllowedModifiers.js +++ b/tests/baselines/reference/autoAccessorAllowedModifiers.js @@ -30,6 +30,7 @@ declare class C3 { //// [autoAccessorAllowedModifiers.js] +"use strict"; class C1 { accessor a; accessor b; diff --git a/tests/baselines/reference/autoAccessorExperimentalDecorators(target=es2015).js b/tests/baselines/reference/autoAccessorExperimentalDecorators(target=es2015).js index e2d1b03a64fa8..647f58932abfd 100644 --- a/tests/baselines/reference/autoAccessorExperimentalDecorators(target=es2015).js +++ b/tests/baselines/reference/autoAccessorExperimentalDecorators(target=es2015).js @@ -21,6 +21,7 @@ class C2 { //// [autoAccessorExperimentalDecorators.js] +"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); diff --git a/tests/baselines/reference/autoAccessorExperimentalDecorators(target=es2022).js b/tests/baselines/reference/autoAccessorExperimentalDecorators(target=es2022).js index 9c65115067bbd..88eb3570b5abc 100644 --- a/tests/baselines/reference/autoAccessorExperimentalDecorators(target=es2022).js +++ b/tests/baselines/reference/autoAccessorExperimentalDecorators(target=es2022).js @@ -21,6 +21,7 @@ class C2 { //// [autoAccessorExperimentalDecorators.js] +"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); diff --git a/tests/baselines/reference/autoAccessorExperimentalDecorators(target=esnext).js b/tests/baselines/reference/autoAccessorExperimentalDecorators(target=esnext).js index c3f5fdcc2267a..87968b3bfa1c1 100644 --- a/tests/baselines/reference/autoAccessorExperimentalDecorators(target=esnext).js +++ b/tests/baselines/reference/autoAccessorExperimentalDecorators(target=esnext).js @@ -21,6 +21,7 @@ class C2 { //// [autoAccessorExperimentalDecorators.js] +"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); diff --git a/tests/baselines/reference/autoAccessorNoUseDefineForClassFields.js b/tests/baselines/reference/autoAccessorNoUseDefineForClassFields.js index 7409d2130cf40..040cfda506cad 100644 --- a/tests/baselines/reference/autoAccessorNoUseDefineForClassFields.js +++ b/tests/baselines/reference/autoAccessorNoUseDefineForClassFields.js @@ -41,23 +41,28 @@ class C6 { //// [file1.js] +"use strict"; // https://github.com/microsoft/TypeScript/issues/51528 class C1 { static accessor x = 0; } //// [file2.js] +"use strict"; class C2 { static accessor #x = 0; } //// [file3.js] +"use strict"; class C3 { accessor x = 0; } //// [file4.js] +"use strict"; class C4 { accessor #x = 0; } //// [file5.js] +"use strict"; class C5 { constructor() { this.x = 0; @@ -68,6 +73,7 @@ class C5 { set #x(value) { this.#x_accessor_storage = value; } } //// [file6.js] +"use strict"; class C6 { constructor() { this.#x_accessor_storage = 0; diff --git a/tests/baselines/reference/autoAsiForStaticsInClassDeclaration.js b/tests/baselines/reference/autoAsiForStaticsInClassDeclaration.js index 584e598d15964..b26466d80a91b 100644 --- a/tests/baselines/reference/autoAsiForStaticsInClassDeclaration.js +++ b/tests/baselines/reference/autoAsiForStaticsInClassDeclaration.js @@ -7,5 +7,6 @@ class C { } //// [autoAsiForStaticsInClassDeclaration.js] +"use strict"; class C { } diff --git a/tests/baselines/reference/autoLift2.js b/tests/baselines/reference/autoLift2.js index bf8f1ef831e6a..84f6d60aae660 100644 --- a/tests/baselines/reference/autoLift2.js +++ b/tests/baselines/reference/autoLift2.js @@ -34,6 +34,7 @@ a.baz(); //// [autoLift2.js] +"use strict"; class A { constructor() { this.foo; diff --git a/tests/baselines/reference/autolift3.js b/tests/baselines/reference/autolift3.js index 0170bd0938ebe..c7343eb51ffe1 100644 --- a/tests/baselines/reference/autolift3.js +++ b/tests/baselines/reference/autolift3.js @@ -33,6 +33,7 @@ b.foo(); //// [autolift3.js] +"use strict"; class B { constructor() { function foo() { } diff --git a/tests/baselines/reference/autolift4.js b/tests/baselines/reference/autolift4.js index f515ab0fa3951..b3fcb31106b6f 100644 --- a/tests/baselines/reference/autolift4.js +++ b/tests/baselines/reference/autolift4.js @@ -26,6 +26,7 @@ class Point3D extends Point { //// [autolift4.js] +"use strict"; class Point { constructor(x, y) { this.x = x; diff --git a/tests/baselines/reference/autonumberingInEnums.js b/tests/baselines/reference/autonumberingInEnums.js index 244e77a96a8c9..0b9703e437c60 100644 --- a/tests/baselines/reference/autonumberingInEnums.js +++ b/tests/baselines/reference/autonumberingInEnums.js @@ -10,6 +10,7 @@ enum Foo { } //// [autonumberingInEnums.js] +"use strict"; var Foo; (function (Foo) { Foo[Foo["a"] = 1] = "a"; diff --git a/tests/baselines/reference/avoid.js b/tests/baselines/reference/avoid.js index e6ec91c9374d3..38caba957adc7 100644 --- a/tests/baselines/reference/avoid.js +++ b/tests/baselines/reference/avoid.js @@ -22,6 +22,7 @@ var N=new f(); // ok with void fn //// [avoid.js] +"use strict"; function f() { var x = 1; } diff --git a/tests/baselines/reference/awaitAndYield.js b/tests/baselines/reference/awaitAndYield.js index 09606a3e8aba5..1ce395f64c2f3 100644 --- a/tests/baselines/reference/awaitAndYield.js +++ b/tests/baselines/reference/awaitAndYield.js @@ -9,6 +9,7 @@ async function* test(x: Promise) { } //// [awaitAndYield.js] +"use strict"; async function* test(x) { let E; (function (E) { diff --git a/tests/baselines/reference/awaitAndYieldInProperty.js b/tests/baselines/reference/awaitAndYieldInProperty.js index f310dc83331f8..7bd1063cf9dbc 100644 --- a/tests/baselines/reference/awaitAndYieldInProperty.js +++ b/tests/baselines/reference/awaitAndYieldInProperty.js @@ -20,6 +20,7 @@ async function* test(x: Promise) { } //// [awaitAndYieldInProperty.js] +"use strict"; async function* test(x) { var _a, _b, _c, _d, _e, _f, _g, _h, _j; class C { diff --git a/tests/baselines/reference/awaitBinaryExpression1_es2017.js b/tests/baselines/reference/awaitBinaryExpression1_es2017.js index 33d27b5348929..cdb6c529c3caa 100644 --- a/tests/baselines/reference/awaitBinaryExpression1_es2017.js +++ b/tests/baselines/reference/awaitBinaryExpression1_es2017.js @@ -12,6 +12,7 @@ async function func(): Promise { } //// [awaitBinaryExpression1_es2017.js] +"use strict"; async function func() { before(); var b = await p || a; diff --git a/tests/baselines/reference/awaitBinaryExpression1_es5(target=es2015).js b/tests/baselines/reference/awaitBinaryExpression1_es5(target=es2015).js index 8056734e3d6bc..e18fa34308cf7 100644 --- a/tests/baselines/reference/awaitBinaryExpression1_es5(target=es2015).js +++ b/tests/baselines/reference/awaitBinaryExpression1_es5(target=es2015).js @@ -12,6 +12,7 @@ async function func(): Promise { } //// [awaitBinaryExpression1_es5.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function* () { before(); diff --git a/tests/baselines/reference/awaitBinaryExpression1_es5(target=es5).js b/tests/baselines/reference/awaitBinaryExpression1_es5(target=es5).js index 45bc1bc2b81cf..f38f2d8aeb9e5 100644 --- a/tests/baselines/reference/awaitBinaryExpression1_es5(target=es5).js +++ b/tests/baselines/reference/awaitBinaryExpression1_es5(target=es5).js @@ -12,6 +12,7 @@ async function func(): Promise { } //// [awaitBinaryExpression1_es5.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function () { var b; diff --git a/tests/baselines/reference/awaitBinaryExpression1_es6.js b/tests/baselines/reference/awaitBinaryExpression1_es6.js index bb1f31174f325..96f158e52b905 100644 --- a/tests/baselines/reference/awaitBinaryExpression1_es6.js +++ b/tests/baselines/reference/awaitBinaryExpression1_es6.js @@ -12,6 +12,7 @@ async function func(): Promise { } //// [awaitBinaryExpression1_es6.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function* () { before(); diff --git a/tests/baselines/reference/awaitBinaryExpression2_es2017.js b/tests/baselines/reference/awaitBinaryExpression2_es2017.js index 68dd53ad85f6e..6cf054cdee86d 100644 --- a/tests/baselines/reference/awaitBinaryExpression2_es2017.js +++ b/tests/baselines/reference/awaitBinaryExpression2_es2017.js @@ -12,6 +12,7 @@ async function func(): Promise { } //// [awaitBinaryExpression2_es2017.js] +"use strict"; async function func() { before(); var b = await p && a; diff --git a/tests/baselines/reference/awaitBinaryExpression2_es5(target=es2015).js b/tests/baselines/reference/awaitBinaryExpression2_es5(target=es2015).js index f4ac728692c3f..6dbbfef99e461 100644 --- a/tests/baselines/reference/awaitBinaryExpression2_es5(target=es2015).js +++ b/tests/baselines/reference/awaitBinaryExpression2_es5(target=es2015).js @@ -12,6 +12,7 @@ async function func(): Promise { } //// [awaitBinaryExpression2_es5.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function* () { before(); diff --git a/tests/baselines/reference/awaitBinaryExpression2_es5(target=es5).js b/tests/baselines/reference/awaitBinaryExpression2_es5(target=es5).js index 0ee30666df4da..8b0d33133c9f9 100644 --- a/tests/baselines/reference/awaitBinaryExpression2_es5(target=es5).js +++ b/tests/baselines/reference/awaitBinaryExpression2_es5(target=es5).js @@ -12,6 +12,7 @@ async function func(): Promise { } //// [awaitBinaryExpression2_es5.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function () { var b; diff --git a/tests/baselines/reference/awaitBinaryExpression2_es6.js b/tests/baselines/reference/awaitBinaryExpression2_es6.js index 7d28a411cdf6f..2b4b61eaeab55 100644 --- a/tests/baselines/reference/awaitBinaryExpression2_es6.js +++ b/tests/baselines/reference/awaitBinaryExpression2_es6.js @@ -12,6 +12,7 @@ async function func(): Promise { } //// [awaitBinaryExpression2_es6.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function* () { before(); diff --git a/tests/baselines/reference/awaitBinaryExpression3_es2017.js b/tests/baselines/reference/awaitBinaryExpression3_es2017.js index 46eecdd1e9c66..334870242e26b 100644 --- a/tests/baselines/reference/awaitBinaryExpression3_es2017.js +++ b/tests/baselines/reference/awaitBinaryExpression3_es2017.js @@ -12,6 +12,7 @@ async function func(): Promise { } //// [awaitBinaryExpression3_es2017.js] +"use strict"; async function func() { before(); var b = await p + a; diff --git a/tests/baselines/reference/awaitBinaryExpression3_es5(target=es2015).js b/tests/baselines/reference/awaitBinaryExpression3_es5(target=es2015).js index 0684fdb640e8e..aefdcc5753df3 100644 --- a/tests/baselines/reference/awaitBinaryExpression3_es5(target=es2015).js +++ b/tests/baselines/reference/awaitBinaryExpression3_es5(target=es2015).js @@ -12,6 +12,7 @@ async function func(): Promise { } //// [awaitBinaryExpression3_es5.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function* () { before(); diff --git a/tests/baselines/reference/awaitBinaryExpression3_es5(target=es5).js b/tests/baselines/reference/awaitBinaryExpression3_es5(target=es5).js index 7993f92d10ec7..64d5521ec5806 100644 --- a/tests/baselines/reference/awaitBinaryExpression3_es5(target=es5).js +++ b/tests/baselines/reference/awaitBinaryExpression3_es5(target=es5).js @@ -12,6 +12,7 @@ async function func(): Promise { } //// [awaitBinaryExpression3_es5.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function () { var b; diff --git a/tests/baselines/reference/awaitBinaryExpression3_es6.js b/tests/baselines/reference/awaitBinaryExpression3_es6.js index 1d22fc27cbf38..2e2b8809c5fa3 100644 --- a/tests/baselines/reference/awaitBinaryExpression3_es6.js +++ b/tests/baselines/reference/awaitBinaryExpression3_es6.js @@ -12,6 +12,7 @@ async function func(): Promise { } //// [awaitBinaryExpression3_es6.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function* () { before(); diff --git a/tests/baselines/reference/awaitBinaryExpression4_es2017.js b/tests/baselines/reference/awaitBinaryExpression4_es2017.js index 2151cbf68e8a3..1b847bf30c2d0 100644 --- a/tests/baselines/reference/awaitBinaryExpression4_es2017.js +++ b/tests/baselines/reference/awaitBinaryExpression4_es2017.js @@ -12,6 +12,7 @@ async function func(): Promise { } //// [awaitBinaryExpression4_es2017.js] +"use strict"; async function func() { before(); var b = (await p, a); diff --git a/tests/baselines/reference/awaitBinaryExpression4_es5(target=es2015).js b/tests/baselines/reference/awaitBinaryExpression4_es5(target=es2015).js index 92209799e5dba..8425799338cc1 100644 --- a/tests/baselines/reference/awaitBinaryExpression4_es5(target=es2015).js +++ b/tests/baselines/reference/awaitBinaryExpression4_es5(target=es2015).js @@ -12,6 +12,7 @@ async function func(): Promise { } //// [awaitBinaryExpression4_es5.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function* () { before(); diff --git a/tests/baselines/reference/awaitBinaryExpression4_es5(target=es5).js b/tests/baselines/reference/awaitBinaryExpression4_es5(target=es5).js index b2bf508740e16..b6d8e6cbdd0d5 100644 --- a/tests/baselines/reference/awaitBinaryExpression4_es5(target=es5).js +++ b/tests/baselines/reference/awaitBinaryExpression4_es5(target=es5).js @@ -12,6 +12,7 @@ async function func(): Promise { } //// [awaitBinaryExpression4_es5.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function () { var b; diff --git a/tests/baselines/reference/awaitBinaryExpression4_es6.js b/tests/baselines/reference/awaitBinaryExpression4_es6.js index 9fa78e1fe1bec..9ad737ba027b1 100644 --- a/tests/baselines/reference/awaitBinaryExpression4_es6.js +++ b/tests/baselines/reference/awaitBinaryExpression4_es6.js @@ -12,6 +12,7 @@ async function func(): Promise { } //// [awaitBinaryExpression4_es6.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function* () { before(); diff --git a/tests/baselines/reference/awaitBinaryExpression5_es2017.errors.txt b/tests/baselines/reference/awaitBinaryExpression5_es2017.errors.txt new file mode 100644 index 0000000000000..3d992fc8a6611 --- /dev/null +++ b/tests/baselines/reference/awaitBinaryExpression5_es2017.errors.txt @@ -0,0 +1,16 @@ +awaitBinaryExpression5_es2017.ts(8,5): error TS2454: Variable 'o' is used before being assigned. + + +==== awaitBinaryExpression5_es2017.ts (1 errors) ==== + declare var a: boolean; + declare var p: Promise; + declare function before(): void; + declare function after(): void; + async function func(): Promise { + before(); + var o: { a: boolean; }; + o.a = await p; + ~ +!!! error TS2454: Variable 'o' is used before being assigned. + after(); + } \ No newline at end of file diff --git a/tests/baselines/reference/awaitBinaryExpression5_es2017.js b/tests/baselines/reference/awaitBinaryExpression5_es2017.js index 5ae9c21e79298..961e434c87295 100644 --- a/tests/baselines/reference/awaitBinaryExpression5_es2017.js +++ b/tests/baselines/reference/awaitBinaryExpression5_es2017.js @@ -13,6 +13,7 @@ async function func(): Promise { } //// [awaitBinaryExpression5_es2017.js] +"use strict"; async function func() { before(); var o; diff --git a/tests/baselines/reference/awaitBinaryExpression5_es5(target=es2015).errors.txt b/tests/baselines/reference/awaitBinaryExpression5_es5(target=es2015).errors.txt new file mode 100644 index 0000000000000..959cd86d809a9 --- /dev/null +++ b/tests/baselines/reference/awaitBinaryExpression5_es5(target=es2015).errors.txt @@ -0,0 +1,16 @@ +awaitBinaryExpression5_es5.ts(8,5): error TS2454: Variable 'o' is used before being assigned. + + +==== awaitBinaryExpression5_es5.ts (1 errors) ==== + declare var a: boolean; + declare var p: Promise; + declare function before(): void; + declare function after(): void; + async function func(): Promise { + before(); + var o: { a: boolean; }; + o.a = await p; + ~ +!!! error TS2454: Variable 'o' is used before being assigned. + after(); + } \ No newline at end of file diff --git a/tests/baselines/reference/awaitBinaryExpression5_es5(target=es2015).js b/tests/baselines/reference/awaitBinaryExpression5_es5(target=es2015).js index 5af7304de2066..9b5b3aa997b73 100644 --- a/tests/baselines/reference/awaitBinaryExpression5_es5(target=es2015).js +++ b/tests/baselines/reference/awaitBinaryExpression5_es5(target=es2015).js @@ -13,6 +13,7 @@ async function func(): Promise { } //// [awaitBinaryExpression5_es5.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function* () { before(); diff --git a/tests/baselines/reference/awaitBinaryExpression5_es5(target=es5).errors.txt b/tests/baselines/reference/awaitBinaryExpression5_es5(target=es5).errors.txt index 6537b9ffaf5cb..03eb78bea0dc1 100644 --- a/tests/baselines/reference/awaitBinaryExpression5_es5(target=es5).errors.txt +++ b/tests/baselines/reference/awaitBinaryExpression5_es5(target=es5).errors.txt @@ -1,8 +1,9 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +awaitBinaryExpression5_es5.ts(8,5): error TS2454: Variable 'o' is used before being assigned. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== awaitBinaryExpression5_es5.ts (0 errors) ==== +==== awaitBinaryExpression5_es5.ts (1 errors) ==== declare var a: boolean; declare var p: Promise; declare function before(): void; @@ -11,5 +12,7 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in Typ before(); var o: { a: boolean; }; o.a = await p; + ~ +!!! error TS2454: Variable 'o' is used before being assigned. after(); } \ No newline at end of file diff --git a/tests/baselines/reference/awaitBinaryExpression5_es5(target=es5).js b/tests/baselines/reference/awaitBinaryExpression5_es5(target=es5).js index 0444d8c2facb2..b727f0ebb5e5d 100644 --- a/tests/baselines/reference/awaitBinaryExpression5_es5(target=es5).js +++ b/tests/baselines/reference/awaitBinaryExpression5_es5(target=es5).js @@ -13,6 +13,7 @@ async function func(): Promise { } //// [awaitBinaryExpression5_es5.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function () { var o, _a; diff --git a/tests/baselines/reference/awaitBinaryExpression5_es6.errors.txt b/tests/baselines/reference/awaitBinaryExpression5_es6.errors.txt new file mode 100644 index 0000000000000..feb3c974f959e --- /dev/null +++ b/tests/baselines/reference/awaitBinaryExpression5_es6.errors.txt @@ -0,0 +1,16 @@ +awaitBinaryExpression5_es6.ts(8,5): error TS2454: Variable 'o' is used before being assigned. + + +==== awaitBinaryExpression5_es6.ts (1 errors) ==== + declare var a: boolean; + declare var p: Promise; + declare function before(): void; + declare function after(): void; + async function func(): Promise { + before(); + var o: { a: boolean; }; + o.a = await p; + ~ +!!! error TS2454: Variable 'o' is used before being assigned. + after(); + } \ No newline at end of file diff --git a/tests/baselines/reference/awaitBinaryExpression5_es6.js b/tests/baselines/reference/awaitBinaryExpression5_es6.js index 52c236a5c79b8..e34b60a90ed43 100644 --- a/tests/baselines/reference/awaitBinaryExpression5_es6.js +++ b/tests/baselines/reference/awaitBinaryExpression5_es6.js @@ -13,6 +13,7 @@ async function func(): Promise { } //// [awaitBinaryExpression5_es6.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function* () { before(); diff --git a/tests/baselines/reference/awaitCallExpression1_es2017.js b/tests/baselines/reference/awaitCallExpression1_es2017.js index a90317da20826..5c2b17e9b751c 100644 --- a/tests/baselines/reference/awaitCallExpression1_es2017.js +++ b/tests/baselines/reference/awaitCallExpression1_es2017.js @@ -16,6 +16,7 @@ async function func(): Promise { } //// [awaitCallExpression1_es2017.js] +"use strict"; async function func() { before(); var b = fn(a, a, a); diff --git a/tests/baselines/reference/awaitCallExpression1_es5(target=es2015).js b/tests/baselines/reference/awaitCallExpression1_es5(target=es2015).js index a0f1fd390756b..3f356dc6203ad 100644 --- a/tests/baselines/reference/awaitCallExpression1_es5(target=es2015).js +++ b/tests/baselines/reference/awaitCallExpression1_es5(target=es2015).js @@ -16,6 +16,7 @@ async function func(): Promise { } //// [awaitCallExpression1_es5.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function* () { before(); diff --git a/tests/baselines/reference/awaitCallExpression1_es5(target=es5).js b/tests/baselines/reference/awaitCallExpression1_es5(target=es5).js index c190a216ae514..ef5b1ae2c2edd 100644 --- a/tests/baselines/reference/awaitCallExpression1_es5(target=es5).js +++ b/tests/baselines/reference/awaitCallExpression1_es5(target=es5).js @@ -16,6 +16,7 @@ async function func(): Promise { } //// [awaitCallExpression1_es5.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function () { var b; diff --git a/tests/baselines/reference/awaitCallExpression1_es6.js b/tests/baselines/reference/awaitCallExpression1_es6.js index 124f72e021271..a52a186479c05 100644 --- a/tests/baselines/reference/awaitCallExpression1_es6.js +++ b/tests/baselines/reference/awaitCallExpression1_es6.js @@ -16,6 +16,7 @@ async function func(): Promise { } //// [awaitCallExpression1_es6.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function* () { before(); diff --git a/tests/baselines/reference/awaitCallExpression2_es2017.js b/tests/baselines/reference/awaitCallExpression2_es2017.js index ab83926fd675a..9d417f6c3ffc1 100644 --- a/tests/baselines/reference/awaitCallExpression2_es2017.js +++ b/tests/baselines/reference/awaitCallExpression2_es2017.js @@ -16,6 +16,7 @@ async function func(): Promise { } //// [awaitCallExpression2_es2017.js] +"use strict"; async function func() { before(); var b = fn(await p, a, a); diff --git a/tests/baselines/reference/awaitCallExpression2_es5(target=es2015).js b/tests/baselines/reference/awaitCallExpression2_es5(target=es2015).js index 9f6ac9a5033eb..bd817508eceed 100644 --- a/tests/baselines/reference/awaitCallExpression2_es5(target=es2015).js +++ b/tests/baselines/reference/awaitCallExpression2_es5(target=es2015).js @@ -16,6 +16,7 @@ async function func(): Promise { } //// [awaitCallExpression2_es5.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function* () { before(); diff --git a/tests/baselines/reference/awaitCallExpression2_es5(target=es5).js b/tests/baselines/reference/awaitCallExpression2_es5(target=es5).js index 353e76241f417..1b2317c1ff2ed 100644 --- a/tests/baselines/reference/awaitCallExpression2_es5(target=es5).js +++ b/tests/baselines/reference/awaitCallExpression2_es5(target=es5).js @@ -16,6 +16,7 @@ async function func(): Promise { } //// [awaitCallExpression2_es5.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function () { var b, _a; diff --git a/tests/baselines/reference/awaitCallExpression2_es6.js b/tests/baselines/reference/awaitCallExpression2_es6.js index 6931c3ad0db3d..b7c5da8f9ad9b 100644 --- a/tests/baselines/reference/awaitCallExpression2_es6.js +++ b/tests/baselines/reference/awaitCallExpression2_es6.js @@ -16,6 +16,7 @@ async function func(): Promise { } //// [awaitCallExpression2_es6.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function* () { before(); diff --git a/tests/baselines/reference/awaitCallExpression3_es2017.js b/tests/baselines/reference/awaitCallExpression3_es2017.js index f1cabaaa45592..8cbb2fb72597a 100644 --- a/tests/baselines/reference/awaitCallExpression3_es2017.js +++ b/tests/baselines/reference/awaitCallExpression3_es2017.js @@ -16,6 +16,7 @@ async function func(): Promise { } //// [awaitCallExpression3_es2017.js] +"use strict"; async function func() { before(); var b = fn(a, await p, a); diff --git a/tests/baselines/reference/awaitCallExpression3_es5(target=es2015).js b/tests/baselines/reference/awaitCallExpression3_es5(target=es2015).js index 29559e01282ca..9528514875c29 100644 --- a/tests/baselines/reference/awaitCallExpression3_es5(target=es2015).js +++ b/tests/baselines/reference/awaitCallExpression3_es5(target=es2015).js @@ -16,6 +16,7 @@ async function func(): Promise { } //// [awaitCallExpression3_es5.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function* () { before(); diff --git a/tests/baselines/reference/awaitCallExpression3_es5(target=es5).js b/tests/baselines/reference/awaitCallExpression3_es5(target=es5).js index 0bac1918e7bf1..7c6c476b5697e 100644 --- a/tests/baselines/reference/awaitCallExpression3_es5(target=es5).js +++ b/tests/baselines/reference/awaitCallExpression3_es5(target=es5).js @@ -16,6 +16,7 @@ async function func(): Promise { } //// [awaitCallExpression3_es5.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function () { var b, _a, _b; diff --git a/tests/baselines/reference/awaitCallExpression3_es6.js b/tests/baselines/reference/awaitCallExpression3_es6.js index 0818f2fc0c513..a4ff7a0c152e3 100644 --- a/tests/baselines/reference/awaitCallExpression3_es6.js +++ b/tests/baselines/reference/awaitCallExpression3_es6.js @@ -16,6 +16,7 @@ async function func(): Promise { } //// [awaitCallExpression3_es6.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function* () { before(); diff --git a/tests/baselines/reference/awaitCallExpression4_es2017.js b/tests/baselines/reference/awaitCallExpression4_es2017.js index 639061aff622e..98d7cb324c46e 100644 --- a/tests/baselines/reference/awaitCallExpression4_es2017.js +++ b/tests/baselines/reference/awaitCallExpression4_es2017.js @@ -16,6 +16,7 @@ async function func(): Promise { } //// [awaitCallExpression4_es2017.js] +"use strict"; async function func() { before(); var b = (await pfn)(a, a, a); diff --git a/tests/baselines/reference/awaitCallExpression4_es5(target=es2015).js b/tests/baselines/reference/awaitCallExpression4_es5(target=es2015).js index 7eb335f8bf597..e95b05693d11b 100644 --- a/tests/baselines/reference/awaitCallExpression4_es5(target=es2015).js +++ b/tests/baselines/reference/awaitCallExpression4_es5(target=es2015).js @@ -16,6 +16,7 @@ async function func(): Promise { } //// [awaitCallExpression4_es5.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function* () { before(); diff --git a/tests/baselines/reference/awaitCallExpression4_es5(target=es5).js b/tests/baselines/reference/awaitCallExpression4_es5(target=es5).js index b3994d9309ef2..82a8e54038f18 100644 --- a/tests/baselines/reference/awaitCallExpression4_es5(target=es5).js +++ b/tests/baselines/reference/awaitCallExpression4_es5(target=es5).js @@ -16,6 +16,7 @@ async function func(): Promise { } //// [awaitCallExpression4_es5.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function () { var b; diff --git a/tests/baselines/reference/awaitCallExpression4_es6.js b/tests/baselines/reference/awaitCallExpression4_es6.js index 43458f2c97f49..6b8110e1b6abf 100644 --- a/tests/baselines/reference/awaitCallExpression4_es6.js +++ b/tests/baselines/reference/awaitCallExpression4_es6.js @@ -16,6 +16,7 @@ async function func(): Promise { } //// [awaitCallExpression4_es6.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function* () { before(); diff --git a/tests/baselines/reference/awaitCallExpression5_es2017.js b/tests/baselines/reference/awaitCallExpression5_es2017.js index a9d593b78f817..3373a23792ab0 100644 --- a/tests/baselines/reference/awaitCallExpression5_es2017.js +++ b/tests/baselines/reference/awaitCallExpression5_es2017.js @@ -16,6 +16,7 @@ async function func(): Promise { } //// [awaitCallExpression5_es2017.js] +"use strict"; async function func() { before(); var b = o.fn(a, a, a); diff --git a/tests/baselines/reference/awaitCallExpression5_es5(target=es2015).js b/tests/baselines/reference/awaitCallExpression5_es5(target=es2015).js index bdd3e092eba12..84073dcd6fd2e 100644 --- a/tests/baselines/reference/awaitCallExpression5_es5(target=es2015).js +++ b/tests/baselines/reference/awaitCallExpression5_es5(target=es2015).js @@ -16,6 +16,7 @@ async function func(): Promise { } //// [awaitCallExpression5_es5.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function* () { before(); diff --git a/tests/baselines/reference/awaitCallExpression5_es5(target=es5).js b/tests/baselines/reference/awaitCallExpression5_es5(target=es5).js index 284434e553937..8722dfed02580 100644 --- a/tests/baselines/reference/awaitCallExpression5_es5(target=es5).js +++ b/tests/baselines/reference/awaitCallExpression5_es5(target=es5).js @@ -16,6 +16,7 @@ async function func(): Promise { } //// [awaitCallExpression5_es5.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function () { var b; diff --git a/tests/baselines/reference/awaitCallExpression5_es6.js b/tests/baselines/reference/awaitCallExpression5_es6.js index 73bb7a30e09b7..dcc1577b26819 100644 --- a/tests/baselines/reference/awaitCallExpression5_es6.js +++ b/tests/baselines/reference/awaitCallExpression5_es6.js @@ -16,6 +16,7 @@ async function func(): Promise { } //// [awaitCallExpression5_es6.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function* () { before(); diff --git a/tests/baselines/reference/awaitCallExpression6_es2017.js b/tests/baselines/reference/awaitCallExpression6_es2017.js index 335ba9b533773..75815f9a72e3b 100644 --- a/tests/baselines/reference/awaitCallExpression6_es2017.js +++ b/tests/baselines/reference/awaitCallExpression6_es2017.js @@ -16,6 +16,7 @@ async function func(): Promise { } //// [awaitCallExpression6_es2017.js] +"use strict"; async function func() { before(); var b = o.fn(await p, a, a); diff --git a/tests/baselines/reference/awaitCallExpression6_es5(target=es2015).js b/tests/baselines/reference/awaitCallExpression6_es5(target=es2015).js index 2100541098075..8178600d5a098 100644 --- a/tests/baselines/reference/awaitCallExpression6_es5(target=es2015).js +++ b/tests/baselines/reference/awaitCallExpression6_es5(target=es2015).js @@ -16,6 +16,7 @@ async function func(): Promise { } //// [awaitCallExpression6_es5.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function* () { before(); diff --git a/tests/baselines/reference/awaitCallExpression6_es5(target=es5).js b/tests/baselines/reference/awaitCallExpression6_es5(target=es5).js index be9b5ed244d97..40517a1532b5e 100644 --- a/tests/baselines/reference/awaitCallExpression6_es5(target=es5).js +++ b/tests/baselines/reference/awaitCallExpression6_es5(target=es5).js @@ -16,6 +16,7 @@ async function func(): Promise { } //// [awaitCallExpression6_es5.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function () { var b, _a, _b; diff --git a/tests/baselines/reference/awaitCallExpression6_es6.js b/tests/baselines/reference/awaitCallExpression6_es6.js index 08f5aed3bae1b..bd2b28411b4a8 100644 --- a/tests/baselines/reference/awaitCallExpression6_es6.js +++ b/tests/baselines/reference/awaitCallExpression6_es6.js @@ -16,6 +16,7 @@ async function func(): Promise { } //// [awaitCallExpression6_es6.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function* () { before(); diff --git a/tests/baselines/reference/awaitCallExpression7_es2017.js b/tests/baselines/reference/awaitCallExpression7_es2017.js index 297de57f614a3..c743bda9d213d 100644 --- a/tests/baselines/reference/awaitCallExpression7_es2017.js +++ b/tests/baselines/reference/awaitCallExpression7_es2017.js @@ -16,6 +16,7 @@ async function func(): Promise { } //// [awaitCallExpression7_es2017.js] +"use strict"; async function func() { before(); var b = o.fn(a, await p, a); diff --git a/tests/baselines/reference/awaitCallExpression7_es5(target=es2015).js b/tests/baselines/reference/awaitCallExpression7_es5(target=es2015).js index 64f2fca441a45..cf1038f1c4b93 100644 --- a/tests/baselines/reference/awaitCallExpression7_es5(target=es2015).js +++ b/tests/baselines/reference/awaitCallExpression7_es5(target=es2015).js @@ -16,6 +16,7 @@ async function func(): Promise { } //// [awaitCallExpression7_es5.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function* () { before(); diff --git a/tests/baselines/reference/awaitCallExpression7_es5(target=es5).js b/tests/baselines/reference/awaitCallExpression7_es5(target=es5).js index b6e6ac95d28b5..f591e050daaa9 100644 --- a/tests/baselines/reference/awaitCallExpression7_es5(target=es5).js +++ b/tests/baselines/reference/awaitCallExpression7_es5(target=es5).js @@ -16,6 +16,7 @@ async function func(): Promise { } //// [awaitCallExpression7_es5.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function () { var b, _a, _b, _c; diff --git a/tests/baselines/reference/awaitCallExpression7_es6.js b/tests/baselines/reference/awaitCallExpression7_es6.js index b661dc26d320f..da957dc26b1a2 100644 --- a/tests/baselines/reference/awaitCallExpression7_es6.js +++ b/tests/baselines/reference/awaitCallExpression7_es6.js @@ -16,6 +16,7 @@ async function func(): Promise { } //// [awaitCallExpression7_es6.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function* () { before(); diff --git a/tests/baselines/reference/awaitCallExpression8_es2017.js b/tests/baselines/reference/awaitCallExpression8_es2017.js index b790da7663c09..156906f8b0635 100644 --- a/tests/baselines/reference/awaitCallExpression8_es2017.js +++ b/tests/baselines/reference/awaitCallExpression8_es2017.js @@ -16,6 +16,7 @@ async function func(): Promise { } //// [awaitCallExpression8_es2017.js] +"use strict"; async function func() { before(); var b = (await po).fn(a, a, a); diff --git a/tests/baselines/reference/awaitCallExpression8_es5(target=es2015).js b/tests/baselines/reference/awaitCallExpression8_es5(target=es2015).js index 8a98db54084e0..bec71cc12cabc 100644 --- a/tests/baselines/reference/awaitCallExpression8_es5(target=es2015).js +++ b/tests/baselines/reference/awaitCallExpression8_es5(target=es2015).js @@ -16,6 +16,7 @@ async function func(): Promise { } //// [awaitCallExpression8_es5.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function* () { before(); diff --git a/tests/baselines/reference/awaitCallExpression8_es5(target=es5).js b/tests/baselines/reference/awaitCallExpression8_es5(target=es5).js index 5fcadfb65d87b..494488ee62b3d 100644 --- a/tests/baselines/reference/awaitCallExpression8_es5(target=es5).js +++ b/tests/baselines/reference/awaitCallExpression8_es5(target=es5).js @@ -16,6 +16,7 @@ async function func(): Promise { } //// [awaitCallExpression8_es5.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function () { var b; diff --git a/tests/baselines/reference/awaitCallExpression8_es6.js b/tests/baselines/reference/awaitCallExpression8_es6.js index aabb7a2d1764f..162987cc84139 100644 --- a/tests/baselines/reference/awaitCallExpression8_es6.js +++ b/tests/baselines/reference/awaitCallExpression8_es6.js @@ -16,6 +16,7 @@ async function func(): Promise { } //// [awaitCallExpression8_es6.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function* () { before(); diff --git a/tests/baselines/reference/awaitCallExpressionInSyncFunction.js b/tests/baselines/reference/awaitCallExpressionInSyncFunction.js index 1982c1a6b0dfa..e9c6b61a56377 100644 --- a/tests/baselines/reference/awaitCallExpressionInSyncFunction.js +++ b/tests/baselines/reference/awaitCallExpressionInSyncFunction.js @@ -8,6 +8,7 @@ function foo() { //// [awaitCallExpressionInSyncFunction.js] +"use strict"; function foo() { const foo = await(Promise.resolve(1)); return foo; diff --git a/tests/baselines/reference/awaitClassExpression_es2017.js b/tests/baselines/reference/awaitClassExpression_es2017.js index c063d02c8e60f..577cd436abe35 100644 --- a/tests/baselines/reference/awaitClassExpression_es2017.js +++ b/tests/baselines/reference/awaitClassExpression_es2017.js @@ -10,6 +10,7 @@ async function func(): Promise { } //// [awaitClassExpression_es2017.js] +"use strict"; async function func() { class D extends (await p) { } diff --git a/tests/baselines/reference/awaitClassExpression_es5(target=es2015).js b/tests/baselines/reference/awaitClassExpression_es5(target=es2015).js index 92cba5b02ed81..510395d63bf6a 100644 --- a/tests/baselines/reference/awaitClassExpression_es5(target=es2015).js +++ b/tests/baselines/reference/awaitClassExpression_es5(target=es2015).js @@ -10,6 +10,7 @@ async function func(): Promise { } //// [awaitClassExpression_es5.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function* () { class D extends (yield p) { diff --git a/tests/baselines/reference/awaitClassExpression_es5(target=es5).js b/tests/baselines/reference/awaitClassExpression_es5(target=es5).js index 0ca60ff15829c..8d3f3966997c2 100644 --- a/tests/baselines/reference/awaitClassExpression_es5(target=es5).js +++ b/tests/baselines/reference/awaitClassExpression_es5(target=es5).js @@ -10,6 +10,7 @@ async function func(): Promise { } //// [awaitClassExpression_es5.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function () { var D, _a; diff --git a/tests/baselines/reference/awaitClassExpression_es6.js b/tests/baselines/reference/awaitClassExpression_es6.js index e8c6b88e4a3e3..2457fd6e1f483 100644 --- a/tests/baselines/reference/awaitClassExpression_es6.js +++ b/tests/baselines/reference/awaitClassExpression_es6.js @@ -10,6 +10,7 @@ async function func(): Promise { } //// [awaitClassExpression_es6.js] +"use strict"; function func() { return __awaiter(this, void 0, void 0, function* () { class D extends (yield p) { diff --git a/tests/baselines/reference/awaitExpressionInnerCommentEmit.js b/tests/baselines/reference/awaitExpressionInnerCommentEmit.js index a2a475643cb0c..2b60754ed9444 100644 --- a/tests/baselines/reference/awaitExpressionInnerCommentEmit.js +++ b/tests/baselines/reference/awaitExpressionInnerCommentEmit.js @@ -8,6 +8,7 @@ async function foo() { } //// [awaitExpressionInnerCommentEmit.js] +"use strict"; async function foo() { /*comment1*/ await 1; await /*comment2*/ 2; diff --git a/tests/baselines/reference/awaitInClassInAsyncFunction.js b/tests/baselines/reference/awaitInClassInAsyncFunction.js index 0fe81a619f8fa..2b816ea04262c 100644 --- a/tests/baselines/reference/awaitInClassInAsyncFunction.js +++ b/tests/baselines/reference/awaitInClassInAsyncFunction.js @@ -15,6 +15,7 @@ async function foo() { //// [awaitInClassInAsyncFunction.js] +"use strict"; // https://github.com/microsoft/TypeScript/issues/34887 async function bar() { return 2; diff --git a/tests/baselines/reference/awaitInheritedPromise_es2017.js b/tests/baselines/reference/awaitInheritedPromise_es2017.js index 4845410cd892b..4acf252095f9d 100644 --- a/tests/baselines/reference/awaitInheritedPromise_es2017.js +++ b/tests/baselines/reference/awaitInheritedPromise_es2017.js @@ -8,6 +8,7 @@ async function f() { } //// [awaitInheritedPromise_es2017.js] +"use strict"; async function f() { await a; } diff --git a/tests/baselines/reference/awaitLiteralValues.js b/tests/baselines/reference/awaitLiteralValues.js index 1d8959ea6d3f4..8d4308e2df74b 100644 --- a/tests/baselines/reference/awaitLiteralValues.js +++ b/tests/baselines/reference/awaitLiteralValues.js @@ -27,6 +27,7 @@ function awaitUndefined() { //// [awaitLiteralValues.js] +"use strict"; function awaitString() { yield 'literal'; } diff --git a/tests/baselines/reference/awaitUnionPromise.errors.txt b/tests/baselines/reference/awaitUnionPromise.errors.txt new file mode 100644 index 0000000000000..dccd2ec59496b --- /dev/null +++ b/tests/baselines/reference/awaitUnionPromise.errors.txt @@ -0,0 +1,25 @@ +awaitUnionPromise.ts(13,11): error TS2322: Type 'null' is not assignable to type 'IAsyncEnumerator'. + + +==== awaitUnionPromise.ts (1 errors) ==== + // https://github.com/Microsoft/TypeScript/issues/18186 + + class AsyncEnumeratorDone { }; + + interface IAsyncEnumerator { + next1(): Promise; + next2(): Promise | Promise; + next3(): Promise; + next4(): Promise; + } + + async function main() { + const x: IAsyncEnumerator = null; + ~ +!!! error TS2322: Type 'null' is not assignable to type 'IAsyncEnumerator'. + let a = await x.next1(); + let b = await x.next2(); + let c = await x.next3(); + let d = await x.next4(); + } + \ No newline at end of file diff --git a/tests/baselines/reference/awaitUnionPromise.js b/tests/baselines/reference/awaitUnionPromise.js index 934de1582e59f..75eee5d1b5537 100644 --- a/tests/baselines/reference/awaitUnionPromise.js +++ b/tests/baselines/reference/awaitUnionPromise.js @@ -22,6 +22,7 @@ async function main() { //// [awaitUnionPromise.js] +"use strict"; // https://github.com/Microsoft/TypeScript/issues/18186 var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } diff --git a/tests/baselines/reference/awaitUnion_es5(target=es2015).js b/tests/baselines/reference/awaitUnion_es5(target=es2015).js index 6cd45129e480e..661ae183dd92d 100644 --- a/tests/baselines/reference/awaitUnion_es5(target=es2015).js +++ b/tests/baselines/reference/awaitUnion_es5(target=es2015).js @@ -15,6 +15,7 @@ async function f() { } //// [awaitUnion_es5.js] +"use strict"; function f() { return __awaiter(this, void 0, void 0, function* () { let await_a = yield a; diff --git a/tests/baselines/reference/awaitUnion_es5(target=es5).js b/tests/baselines/reference/awaitUnion_es5(target=es5).js index 110a56b0d46f6..c114c8d750523 100644 --- a/tests/baselines/reference/awaitUnion_es5(target=es5).js +++ b/tests/baselines/reference/awaitUnion_es5(target=es5).js @@ -15,6 +15,7 @@ async function f() { } //// [awaitUnion_es5.js] +"use strict"; function f() { return __awaiter(this, void 0, void 0, function () { var await_a, await_b, await_c, await_d, await_e; diff --git a/tests/baselines/reference/awaitUnion_es6.js b/tests/baselines/reference/awaitUnion_es6.js index 1402cf2bb3590..38dc9549848cf 100644 --- a/tests/baselines/reference/awaitUnion_es6.js +++ b/tests/baselines/reference/awaitUnion_es6.js @@ -15,6 +15,7 @@ async function f() { } //// [awaitUnion_es6.js] +"use strict"; function f() { return __awaiter(this, void 0, void 0, function* () { let await_a = yield a; diff --git a/tests/baselines/reference/awaitUsingDeclarations.12.js b/tests/baselines/reference/awaitUsingDeclarations.12.js index 32de989383c3c..7b30c19e5e2bd 100644 --- a/tests/baselines/reference/awaitUsingDeclarations.12.js +++ b/tests/baselines/reference/awaitUsingDeclarations.12.js @@ -6,6 +6,7 @@ async function f() { } //// [awaitUsingDeclarations.12.js] +"use strict"; async function f() { await using x = {}; } diff --git a/tests/baselines/reference/awaitUsingDeclarations.13.js b/tests/baselines/reference/awaitUsingDeclarations.13.js index f8a1d89e9f2ee..720f20fc27e10 100644 --- a/tests/baselines/reference/awaitUsingDeclarations.13.js +++ b/tests/baselines/reference/awaitUsingDeclarations.13.js @@ -8,6 +8,7 @@ function f() { } //// [awaitUsingDeclarations.13.js] +"use strict"; await using x = null; function f() { await using x = null; diff --git a/tests/baselines/reference/awaitUsingDeclarations.14.js b/tests/baselines/reference/awaitUsingDeclarations.14.js index 223c913e74869..59f37e14172b7 100644 --- a/tests/baselines/reference/awaitUsingDeclarations.14.js +++ b/tests/baselines/reference/awaitUsingDeclarations.14.js @@ -12,6 +12,7 @@ class C { //// [awaitUsingDeclarations.14.js] +"use strict"; class C { static { await using x = null; diff --git a/tests/baselines/reference/awaitUsingDeclarations.15.js b/tests/baselines/reference/awaitUsingDeclarations.15.js index af20512995cc6..b11fad9e5b2b9 100644 --- a/tests/baselines/reference/awaitUsingDeclarations.15.js +++ b/tests/baselines/reference/awaitUsingDeclarations.15.js @@ -6,6 +6,7 @@ async function f() { } //// [awaitUsingDeclarations.15.js] +"use strict"; async function f() { await using _ = { async [Symbol.asyncDispose]() { } }; } diff --git a/tests/baselines/reference/awaitUsingDeclarations.16.js b/tests/baselines/reference/awaitUsingDeclarations.16.js index 4f9c01e8e2895..a84941f0338d7 100644 --- a/tests/baselines/reference/awaitUsingDeclarations.16.js +++ b/tests/baselines/reference/awaitUsingDeclarations.16.js @@ -12,3 +12,4 @@ declare module 'M' { //// [awaitUsingDeclarations.16.js] +"use strict"; diff --git a/tests/baselines/reference/awaitUsingDeclarations.7.js b/tests/baselines/reference/awaitUsingDeclarations.7.js index c409558f39f9e..e27a9c7b090a3 100644 --- a/tests/baselines/reference/awaitUsingDeclarations.7.js +++ b/tests/baselines/reference/awaitUsingDeclarations.7.js @@ -8,6 +8,7 @@ } //// [awaitUsingDeclarations.7.js] +"use strict"; { await using a = null, { b } = null, c = null; } diff --git a/tests/baselines/reference/awaitUsingDeclarationsInFor(target=es2015).js b/tests/baselines/reference/awaitUsingDeclarationsInFor(target=es2015).js index f1c9be674ccf5..ca7169b2821f2 100644 --- a/tests/baselines/reference/awaitUsingDeclarationsInFor(target=es2015).js +++ b/tests/baselines/reference/awaitUsingDeclarationsInFor(target=es2015).js @@ -10,6 +10,7 @@ async function main() { } //// [awaitUsingDeclarationsInFor.js] +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { diff --git a/tests/baselines/reference/awaitUsingDeclarationsInFor(target=es2017).js b/tests/baselines/reference/awaitUsingDeclarationsInFor(target=es2017).js index b430e2684b316..ca5d9c15102f7 100644 --- a/tests/baselines/reference/awaitUsingDeclarationsInFor(target=es2017).js +++ b/tests/baselines/reference/awaitUsingDeclarationsInFor(target=es2017).js @@ -10,6 +10,7 @@ async function main() { } //// [awaitUsingDeclarationsInFor.js] +"use strict"; var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) { if (value !== null && value !== void 0) { if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); diff --git a/tests/baselines/reference/awaitUsingDeclarationsInFor(target=es2022).js b/tests/baselines/reference/awaitUsingDeclarationsInFor(target=es2022).js index b430e2684b316..ca5d9c15102f7 100644 --- a/tests/baselines/reference/awaitUsingDeclarationsInFor(target=es2022).js +++ b/tests/baselines/reference/awaitUsingDeclarationsInFor(target=es2022).js @@ -10,6 +10,7 @@ async function main() { } //// [awaitUsingDeclarationsInFor.js] +"use strict"; var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) { if (value !== null && value !== void 0) { if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); diff --git a/tests/baselines/reference/awaitUsingDeclarationsInFor(target=es5).js b/tests/baselines/reference/awaitUsingDeclarationsInFor(target=es5).js index d8226409a5dac..dc7e5ad84cc20 100644 --- a/tests/baselines/reference/awaitUsingDeclarationsInFor(target=es5).js +++ b/tests/baselines/reference/awaitUsingDeclarationsInFor(target=es5).js @@ -10,6 +10,7 @@ async function main() { } //// [awaitUsingDeclarationsInFor.js] +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { diff --git a/tests/baselines/reference/awaitUsingDeclarationsInFor(target=esnext).js b/tests/baselines/reference/awaitUsingDeclarationsInFor(target=esnext).js index d7e96493ed8a3..53723ed304570 100644 --- a/tests/baselines/reference/awaitUsingDeclarationsInFor(target=esnext).js +++ b/tests/baselines/reference/awaitUsingDeclarationsInFor(target=esnext).js @@ -10,6 +10,7 @@ async function main() { } //// [awaitUsingDeclarationsInFor.js] +"use strict"; async function main() { for (await using d1 = { [Symbol.dispose]() { } }, d2 = { async [Symbol.asyncDispose]() { } }, d3 = null, d4 = undefined;;) { } diff --git a/tests/baselines/reference/awaitUsingDeclarationsInForAwaitOf(target=es2015).js b/tests/baselines/reference/awaitUsingDeclarationsInForAwaitOf(target=es2015).js index aa6dd826bd543..cf078e423db72 100644 --- a/tests/baselines/reference/awaitUsingDeclarationsInForAwaitOf(target=es2015).js +++ b/tests/baselines/reference/awaitUsingDeclarationsInForAwaitOf(target=es2015).js @@ -7,6 +7,7 @@ async function main() { } //// [awaitUsingDeclarationsInForAwaitOf.js] +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { diff --git a/tests/baselines/reference/awaitUsingDeclarationsInForAwaitOf(target=es2017).js b/tests/baselines/reference/awaitUsingDeclarationsInForAwaitOf(target=es2017).js index 18c95ea8e4fca..a1fbca94a7033 100644 --- a/tests/baselines/reference/awaitUsingDeclarationsInForAwaitOf(target=es2017).js +++ b/tests/baselines/reference/awaitUsingDeclarationsInForAwaitOf(target=es2017).js @@ -7,6 +7,7 @@ async function main() { } //// [awaitUsingDeclarationsInForAwaitOf.js] +"use strict"; var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) { if (value !== null && value !== void 0) { if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); diff --git a/tests/baselines/reference/awaitUsingDeclarationsInForAwaitOf(target=es2022).js b/tests/baselines/reference/awaitUsingDeclarationsInForAwaitOf(target=es2022).js index ac74f897e702a..960ea670ef0bd 100644 --- a/tests/baselines/reference/awaitUsingDeclarationsInForAwaitOf(target=es2022).js +++ b/tests/baselines/reference/awaitUsingDeclarationsInForAwaitOf(target=es2022).js @@ -7,6 +7,7 @@ async function main() { } //// [awaitUsingDeclarationsInForAwaitOf.js] +"use strict"; var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) { if (value !== null && value !== void 0) { if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); diff --git a/tests/baselines/reference/awaitUsingDeclarationsInForAwaitOf(target=es5).js b/tests/baselines/reference/awaitUsingDeclarationsInForAwaitOf(target=es5).js index 4deda344151fc..ae21ea63dce7d 100644 --- a/tests/baselines/reference/awaitUsingDeclarationsInForAwaitOf(target=es5).js +++ b/tests/baselines/reference/awaitUsingDeclarationsInForAwaitOf(target=es5).js @@ -7,6 +7,7 @@ async function main() { } //// [awaitUsingDeclarationsInForAwaitOf.js] +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { diff --git a/tests/baselines/reference/awaitUsingDeclarationsInForAwaitOf(target=esnext).js b/tests/baselines/reference/awaitUsingDeclarationsInForAwaitOf(target=esnext).js index 454e995313d07..034537fc8dbfa 100644 --- a/tests/baselines/reference/awaitUsingDeclarationsInForAwaitOf(target=esnext).js +++ b/tests/baselines/reference/awaitUsingDeclarationsInForAwaitOf(target=esnext).js @@ -7,6 +7,7 @@ async function main() { } //// [awaitUsingDeclarationsInForAwaitOf.js] +"use strict"; async function main() { for await (await using d1 of [{ async [Symbol.asyncDispose]() { } }, { [Symbol.dispose]() { } }, null, undefined]) { } diff --git a/tests/baselines/reference/awaitUsingDeclarationsInForAwaitOf.2.js b/tests/baselines/reference/awaitUsingDeclarationsInForAwaitOf.2.js index 2c1883eb8b22a..b664bf2bd2719 100644 --- a/tests/baselines/reference/awaitUsingDeclarationsInForAwaitOf.2.js +++ b/tests/baselines/reference/awaitUsingDeclarationsInForAwaitOf.2.js @@ -9,6 +9,7 @@ async function test() { //// [awaitUsingDeclarationsInForAwaitOf.2.js] +"use strict"; // https://github.com/microsoft/TypeScript/issues/55555 async function test() { for await (await using of of of) { } diff --git a/tests/baselines/reference/awaitUsingDeclarationsInForIn.js b/tests/baselines/reference/awaitUsingDeclarationsInForIn.js index 60b8eecfdcdac..a896801194c4d 100644 --- a/tests/baselines/reference/awaitUsingDeclarationsInForIn.js +++ b/tests/baselines/reference/awaitUsingDeclarationsInForIn.js @@ -8,6 +8,7 @@ async function main() { //// [awaitUsingDeclarationsInForIn.js] +"use strict"; async function main() { for (await using x in {}) { } diff --git a/tests/baselines/reference/awaitUsingDeclarationsInForOf.1(target=es2015).js b/tests/baselines/reference/awaitUsingDeclarationsInForOf.1(target=es2015).js index 9ea879d8b742e..ba2af9ca2aed8 100644 --- a/tests/baselines/reference/awaitUsingDeclarationsInForOf.1(target=es2015).js +++ b/tests/baselines/reference/awaitUsingDeclarationsInForOf.1(target=es2015).js @@ -8,6 +8,7 @@ async function main() { //// [awaitUsingDeclarationsInForOf.1.js] +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { diff --git a/tests/baselines/reference/awaitUsingDeclarationsInForOf.1(target=es2017).js b/tests/baselines/reference/awaitUsingDeclarationsInForOf.1(target=es2017).js index 4d81c8b1f5f5f..763fd7cb7dd12 100644 --- a/tests/baselines/reference/awaitUsingDeclarationsInForOf.1(target=es2017).js +++ b/tests/baselines/reference/awaitUsingDeclarationsInForOf.1(target=es2017).js @@ -8,6 +8,7 @@ async function main() { //// [awaitUsingDeclarationsInForOf.1.js] +"use strict"; var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) { if (value !== null && value !== void 0) { if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); diff --git a/tests/baselines/reference/awaitUsingDeclarationsInForOf.1(target=es2022).js b/tests/baselines/reference/awaitUsingDeclarationsInForOf.1(target=es2022).js index 4d81c8b1f5f5f..763fd7cb7dd12 100644 --- a/tests/baselines/reference/awaitUsingDeclarationsInForOf.1(target=es2022).js +++ b/tests/baselines/reference/awaitUsingDeclarationsInForOf.1(target=es2022).js @@ -8,6 +8,7 @@ async function main() { //// [awaitUsingDeclarationsInForOf.1.js] +"use strict"; var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) { if (value !== null && value !== void 0) { if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); diff --git a/tests/baselines/reference/awaitUsingDeclarationsInForOf.1(target=es5).js b/tests/baselines/reference/awaitUsingDeclarationsInForOf.1(target=es5).js index b48951bbe6d5e..de4af47d79d03 100644 --- a/tests/baselines/reference/awaitUsingDeclarationsInForOf.1(target=es5).js +++ b/tests/baselines/reference/awaitUsingDeclarationsInForOf.1(target=es5).js @@ -8,6 +8,7 @@ async function main() { //// [awaitUsingDeclarationsInForOf.1.js] +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { diff --git a/tests/baselines/reference/awaitUsingDeclarationsInForOf.1(target=esnext).js b/tests/baselines/reference/awaitUsingDeclarationsInForOf.1(target=esnext).js index 28c6d451bf2ae..c732454b4bd2c 100644 --- a/tests/baselines/reference/awaitUsingDeclarationsInForOf.1(target=esnext).js +++ b/tests/baselines/reference/awaitUsingDeclarationsInForOf.1(target=esnext).js @@ -8,6 +8,7 @@ async function main() { //// [awaitUsingDeclarationsInForOf.1.js] +"use strict"; async function main() { for (await using d1 of [{ async [Symbol.asyncDispose]() { } }, { [Symbol.dispose]() { } }, null, undefined]) { } diff --git a/tests/baselines/reference/awaitUsingDeclarationsInForOf.2.js b/tests/baselines/reference/awaitUsingDeclarationsInForOf.2.js index be904e59dc1f7..611e025a4d951 100644 --- a/tests/baselines/reference/awaitUsingDeclarationsInForOf.2.js +++ b/tests/baselines/reference/awaitUsingDeclarationsInForOf.2.js @@ -8,6 +8,7 @@ async function main() { //// [awaitUsingDeclarationsInForOf.2.js] +"use strict"; async function main() { for (await using of of []) { } diff --git a/tests/baselines/reference/awaitUsingDeclarationsInForOf.3.js b/tests/baselines/reference/awaitUsingDeclarationsInForOf.3.js index 0b25f1b2cb39e..b052e6c915b93 100644 --- a/tests/baselines/reference/awaitUsingDeclarationsInForOf.3.js +++ b/tests/baselines/reference/awaitUsingDeclarationsInForOf.3.js @@ -8,6 +8,7 @@ async function main() { //// [awaitUsingDeclarationsInForOf.3.js] +"use strict"; async function main() { for (await using {} of []) { } diff --git a/tests/baselines/reference/awaitUsingDeclarationsInForOf.4.js b/tests/baselines/reference/awaitUsingDeclarationsInForOf.4.js index 5541669060c52..5344057daa0e5 100644 --- a/tests/baselines/reference/awaitUsingDeclarationsInForOf.4.js +++ b/tests/baselines/reference/awaitUsingDeclarationsInForOf.4.js @@ -9,6 +9,7 @@ //// [awaitUsingDeclarationsInForOf.4.js] +"use strict"; // https://github.com/microsoft/TypeScript/issues/55555 { for (await using of of of) { } diff --git a/tests/baselines/reference/await_unaryExpression_es2017.js b/tests/baselines/reference/await_unaryExpression_es2017.js index 320795458eaaa..97e1aa0dbfdbd 100644 --- a/tests/baselines/reference/await_unaryExpression_es2017.js +++ b/tests/baselines/reference/await_unaryExpression_es2017.js @@ -18,6 +18,7 @@ async function bar4() { } //// [await_unaryExpression_es2017.js] +"use strict"; async function bar() { !await 42; // OK } diff --git a/tests/baselines/reference/await_unaryExpression_es2017.types b/tests/baselines/reference/await_unaryExpression_es2017.types index 39f324b176b44..bbe731c83fb8c 100644 --- a/tests/baselines/reference/await_unaryExpression_es2017.types +++ b/tests/baselines/reference/await_unaryExpression_es2017.types @@ -6,8 +6,8 @@ async function bar() { > : ^^^^^^^^^^^^^^^^^^^ !await 42; // OK ->!await 42 : boolean -> : ^^^^^^^ +>!await 42 : false +> : ^^^^^ >await 42 : 42 > : ^^ >42 : 42 diff --git a/tests/baselines/reference/await_unaryExpression_es2017_1.js b/tests/baselines/reference/await_unaryExpression_es2017_1.js index 5d6dc238e16af..fdef411b847e9 100644 --- a/tests/baselines/reference/await_unaryExpression_es2017_1.js +++ b/tests/baselines/reference/await_unaryExpression_es2017_1.js @@ -22,6 +22,7 @@ async function bar4() { } //// [await_unaryExpression_es2017_1.js] +"use strict"; async function bar() { !await 42; // OK } diff --git a/tests/baselines/reference/await_unaryExpression_es2017_1.types b/tests/baselines/reference/await_unaryExpression_es2017_1.types index f3874b6b34c33..be4ba23099785 100644 --- a/tests/baselines/reference/await_unaryExpression_es2017_1.types +++ b/tests/baselines/reference/await_unaryExpression_es2017_1.types @@ -6,8 +6,8 @@ async function bar() { > : ^^^^^^^^^^^^^^^^^^^ !await 42; // OK ->!await 42 : boolean -> : ^^^^^^^ +>!await 42 : false +> : ^^^^^ >await 42 : 42 > : ^^ >42 : 42 diff --git a/tests/baselines/reference/await_unaryExpression_es2017_2.js b/tests/baselines/reference/await_unaryExpression_es2017_2.js index 2b3aaf1d3af8c..06fbed9bb3ac0 100644 --- a/tests/baselines/reference/await_unaryExpression_es2017_2.js +++ b/tests/baselines/reference/await_unaryExpression_es2017_2.js @@ -14,6 +14,7 @@ async function bar3() { } //// [await_unaryExpression_es2017_2.js] +"use strict"; async function bar1() { delete await 42; } diff --git a/tests/baselines/reference/await_unaryExpression_es2017_3.js b/tests/baselines/reference/await_unaryExpression_es2017_3.js index f7e57dbda8159..1581f42c69171 100644 --- a/tests/baselines/reference/await_unaryExpression_es2017_3.js +++ b/tests/baselines/reference/await_unaryExpression_es2017_3.js @@ -20,6 +20,7 @@ async function bar4() { } //// [await_unaryExpression_es2017_3.js] +"use strict"; async function bar1() { ++; await 42; // Error diff --git a/tests/baselines/reference/await_unaryExpression_es6.js b/tests/baselines/reference/await_unaryExpression_es6.js index 7c202885a4187..66a8de7744e73 100644 --- a/tests/baselines/reference/await_unaryExpression_es6.js +++ b/tests/baselines/reference/await_unaryExpression_es6.js @@ -18,6 +18,7 @@ async function bar4() { } //// [await_unaryExpression_es6.js] +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { diff --git a/tests/baselines/reference/await_unaryExpression_es6.types b/tests/baselines/reference/await_unaryExpression_es6.types index a365f76e511d9..0edbb459ad528 100644 --- a/tests/baselines/reference/await_unaryExpression_es6.types +++ b/tests/baselines/reference/await_unaryExpression_es6.types @@ -6,8 +6,8 @@ async function bar() { > : ^^^^^^^^^^^^^^^^^^^ !await 42; // OK ->!await 42 : boolean -> : ^^^^^^^ +>!await 42 : false +> : ^^^^^ >await 42 : 42 > : ^^ >42 : 42 diff --git a/tests/baselines/reference/await_unaryExpression_es6_1.js b/tests/baselines/reference/await_unaryExpression_es6_1.js index 7c10722aa1990..da1456efe50d1 100644 --- a/tests/baselines/reference/await_unaryExpression_es6_1.js +++ b/tests/baselines/reference/await_unaryExpression_es6_1.js @@ -22,6 +22,7 @@ async function bar4() { } //// [await_unaryExpression_es6_1.js] +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { diff --git a/tests/baselines/reference/await_unaryExpression_es6_1.types b/tests/baselines/reference/await_unaryExpression_es6_1.types index 6622b75ea5d5e..66224e16b4257 100644 --- a/tests/baselines/reference/await_unaryExpression_es6_1.types +++ b/tests/baselines/reference/await_unaryExpression_es6_1.types @@ -6,8 +6,8 @@ async function bar() { > : ^^^^^^^^^^^^^^^^^^^ !await 42; // OK ->!await 42 : boolean -> : ^^^^^^^ +>!await 42 : false +> : ^^^^^ >await 42 : 42 > : ^^ >42 : 42 diff --git a/tests/baselines/reference/await_unaryExpression_es6_2.js b/tests/baselines/reference/await_unaryExpression_es6_2.js index 983fae901d339..f21bc2c9c7552 100644 --- a/tests/baselines/reference/await_unaryExpression_es6_2.js +++ b/tests/baselines/reference/await_unaryExpression_es6_2.js @@ -14,6 +14,7 @@ async function bar3() { } //// [await_unaryExpression_es6_2.js] +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { diff --git a/tests/baselines/reference/await_unaryExpression_es6_3.js b/tests/baselines/reference/await_unaryExpression_es6_3.js index d0c5145775e44..e2aa51a1f76b7 100644 --- a/tests/baselines/reference/await_unaryExpression_es6_3.js +++ b/tests/baselines/reference/await_unaryExpression_es6_3.js @@ -20,6 +20,7 @@ async function bar4() { } //// [await_unaryExpression_es6_3.js] +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { diff --git a/tests/baselines/reference/awaitedType.errors.txt b/tests/baselines/reference/awaitedType.errors.txt index ccbcba1b24342..6cde2f2a12865 100644 --- a/tests/baselines/reference/awaitedType.errors.txt +++ b/tests/baselines/reference/awaitedType.errors.txt @@ -1,9 +1,10 @@ awaitedType.ts(22,12): error TS2589: Type instantiation is excessively deep and possibly infinite. awaitedType.ts(26,12): error TS2589: Type instantiation is excessively deep and possibly infinite. +awaitedType.ts(29,22): error TS7010: 'then', which lacks return-type annotation, implicitly has an 'any' return type. awaitedType.ts(236,28): error TS2493: Tuple type '[number]' of length '1' has no element at index '1'. -==== awaitedType.ts (3 errors) ==== +==== awaitedType.ts (4 errors) ==== type T1 = Awaited; type T2 = Awaited>; type T3 = Awaited>; @@ -37,6 +38,8 @@ awaitedType.ts(236,28): error TS2493: Tuple type '[number]' of length '1' has no // https://github.com/microsoft/TypeScript/issues/46934 type T18 = Awaited<{ then(cb: (value: number, other: { }) => void)}>; // number + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS7010: 'then', which lacks return-type annotation, implicitly has an 'any' return type. // https://github.com/microsoft/TypeScript/issues/33562 type MaybePromise = T | Promise | PromiseLike diff --git a/tests/baselines/reference/awaitedType.js b/tests/baselines/reference/awaitedType.js index d0d5da213a9d6..c5be249f98cdb 100644 --- a/tests/baselines/reference/awaitedType.js +++ b/tests/baselines/reference/awaitedType.js @@ -255,6 +255,7 @@ async function test40330() { //// [awaitedType.js] +"use strict"; async function main() { let aaa; let bbb; diff --git a/tests/baselines/reference/awaitedTypeCrash.js b/tests/baselines/reference/awaitedTypeCrash.js index 5f662c946231a..987bdb080057b 100644 --- a/tests/baselines/reference/awaitedTypeCrash.js +++ b/tests/baselines/reference/awaitedTypeCrash.js @@ -5,5 +5,6 @@ async function* f>(): AsyncGenerator { } //// [awaitedTypeCrash.js] +"use strict"; // https://github.com/microsoft/TypeScript/issues/51984 async function* f() { } diff --git a/tests/baselines/reference/awaitedTypeJQuery.js b/tests/baselines/reference/awaitedTypeJQuery.js index fa1b0ac2e6268..17cd32a1692b8 100644 --- a/tests/baselines/reference/awaitedTypeJQuery.js +++ b/tests/baselines/reference/awaitedTypeJQuery.js @@ -128,4 +128,5 @@ interface Promise3>; // string //// [awaitedTypeJQuery.js] +"use strict"; /// diff --git a/tests/baselines/reference/awaitedTypeNoLib.errors.txt b/tests/baselines/reference/awaitedTypeNoLib.errors.txt index f19971eed35b7..40122e01775cd 100644 --- a/tests/baselines/reference/awaitedTypeNoLib.errors.txt +++ b/tests/baselines/reference/awaitedTypeNoLib.errors.txt @@ -1,8 +1,10 @@ error TS2318: Cannot find global type 'Array'. error TS2318: Cannot find global type 'Awaited'. error TS2318: Cannot find global type 'Boolean'. +error TS2318: Cannot find global type 'CallableFunction'. error TS2318: Cannot find global type 'Function'. error TS2318: Cannot find global type 'IArguments'. +error TS2318: Cannot find global type 'NewableFunction'. error TS2318: Cannot find global type 'Number'. error TS2318: Cannot find global type 'Object'. error TS2318: Cannot find global type 'RegExp'. @@ -19,8 +21,10 @@ awaitedTypeNoLib.ts(18,27): error TS2345: Argument of type 'NotPromise !!! error TS2318: Cannot find global type 'Array'. !!! error TS2318: Cannot find global type 'Awaited'. !!! error TS2318: Cannot find global type 'Boolean'. +!!! error TS2318: Cannot find global type 'CallableFunction'. !!! error TS2318: Cannot find global type 'Function'. !!! error TS2318: Cannot find global type 'IArguments'. +!!! error TS2318: Cannot find global type 'NewableFunction'. !!! error TS2318: Cannot find global type 'Number'. !!! error TS2318: Cannot find global type 'Object'. !!! error TS2318: Cannot find global type 'RegExp'. diff --git a/tests/baselines/reference/awaitedTypeNoLib.js b/tests/baselines/reference/awaitedTypeNoLib.js index 7dfda44e80b23..455c1d05f8ec4 100644 --- a/tests/baselines/reference/awaitedTypeNoLib.js +++ b/tests/baselines/reference/awaitedTypeNoLib.js @@ -29,6 +29,7 @@ class Thenable { } //// [awaitedTypeNoLib.js] +"use strict"; class Thenable { then(a) { } handleResolve(result, resolve) { diff --git a/tests/baselines/reference/awaitedTypeStrictNull.errors.txt b/tests/baselines/reference/awaitedTypeStrictNull.errors.txt index d3a78757ccfe9..7ba6defda35c1 100644 --- a/tests/baselines/reference/awaitedTypeStrictNull.errors.txt +++ b/tests/baselines/reference/awaitedTypeStrictNull.errors.txt @@ -1,8 +1,9 @@ awaitedTypeStrictNull.ts(22,12): error TS2589: Type instantiation is excessively deep and possibly infinite. awaitedTypeStrictNull.ts(26,12): error TS2589: Type instantiation is excessively deep and possibly infinite. +awaitedTypeStrictNull.ts(29,22): error TS7010: 'then', which lacks return-type annotation, implicitly has an 'any' return type. -==== awaitedTypeStrictNull.ts (2 errors) ==== +==== awaitedTypeStrictNull.ts (3 errors) ==== type T1 = Awaited; type T2 = Awaited>; type T3 = Awaited>; @@ -36,6 +37,8 @@ awaitedTypeStrictNull.ts(26,12): error TS2589: Type instantiation is excessively // https://github.com/microsoft/TypeScript/issues/46934 type T18 = Awaited<{ then(cb: (value: number, other: { }) => void)}>; // number + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS7010: 'then', which lacks return-type annotation, implicitly has an 'any' return type. // https://github.com/microsoft/TypeScript/issues/33562 type MaybePromise = T | Promise | PromiseLike diff --git a/tests/baselines/reference/awaitedTypeStrictNull.js b/tests/baselines/reference/awaitedTypeStrictNull.js index 09ca8d5b64302..5ed472199db4f 100644 --- a/tests/baselines/reference/awaitedTypeStrictNull.js +++ b/tests/baselines/reference/awaitedTypeStrictNull.js @@ -69,6 +69,7 @@ type _Expect = TActual; //// [awaitedTypeStrictNull.js] +"use strict"; async function main() { let aaa; let bbb; diff --git a/tests/baselines/reference/badArrayIndex.js b/tests/baselines/reference/badArrayIndex.js index 0f525d088e1c0..3aa9c41b2bf70 100644 --- a/tests/baselines/reference/badArrayIndex.js +++ b/tests/baselines/reference/badArrayIndex.js @@ -4,4 +4,5 @@ var results = number[]; //// [badArrayIndex.js] +"use strict"; var results = number[]; diff --git a/tests/baselines/reference/badArraySyntax.js b/tests/baselines/reference/badArraySyntax.js index ccc5b6cca0660..70fb0271fba3a 100644 --- a/tests/baselines/reference/badArraySyntax.js +++ b/tests/baselines/reference/badArraySyntax.js @@ -14,6 +14,7 @@ var a6: Z[][] = new Z [ ] [ ]; //// [badArraySyntax.js] +"use strict"; class Z { constructor() { this.x = ""; diff --git a/tests/baselines/reference/badInferenceLowerPriorityThanGoodInference.js b/tests/baselines/reference/badInferenceLowerPriorityThanGoodInference.js index ef3170d82af99..c26ed7ab70a81 100644 --- a/tests/baselines/reference/badInferenceLowerPriorityThanGoodInference.js +++ b/tests/baselines/reference/badInferenceLowerPriorityThanGoodInference.js @@ -26,6 +26,7 @@ goofus((a: string) => ({ dog: function() { return a; } })); //// [badInferenceLowerPriorityThanGoodInference.js] +"use strict"; // Repro from #13118 const result = canYouInferThis(() => ({ a: { BLAH: 33 }, diff --git a/tests/baselines/reference/badOverloadError.js b/tests/baselines/reference/badOverloadError.js index d57523ab7ffe7..4524a0ebe2bb3 100644 --- a/tests/baselines/reference/badOverloadError.js +++ b/tests/baselines/reference/badOverloadError.js @@ -7,6 +7,7 @@ function method() { //// [badOverloadError.js] +"use strict"; function method() { var dictionary = {}; } diff --git a/tests/baselines/reference/badThisBinding.js b/tests/baselines/reference/badThisBinding.js index f0beced472622..50dc1eb0cd99e 100644 --- a/tests/baselines/reference/badThisBinding.js +++ b/tests/baselines/reference/badThisBinding.js @@ -16,6 +16,7 @@ class Greeter { } //// [badThisBinding.js] +"use strict"; class Greeter { constructor() { foo(() => { diff --git a/tests/baselines/reference/baseCheck.js b/tests/baselines/reference/baseCheck.js index 0dd2617e636eb..092d179406c83 100644 --- a/tests/baselines/reference/baseCheck.js +++ b/tests/baselines/reference/baseCheck.js @@ -32,6 +32,7 @@ function f() { //// [baseCheck.js] +"use strict"; class C { constructor(x, y) { } } diff --git a/tests/baselines/reference/baseClassImprovedMismatchErrors.errors.txt b/tests/baselines/reference/baseClassImprovedMismatchErrors.errors.txt index 479bf14f1b10e..afdb3bd358295 100644 --- a/tests/baselines/reference/baseClassImprovedMismatchErrors.errors.txt +++ b/tests/baselines/reference/baseClassImprovedMismatchErrors.errors.txt @@ -1,3 +1,4 @@ +baseClassImprovedMismatchErrors.ts(2,5): error TS2564: Property 'n' has no initializer and is not definitely assigned in the constructor. baseClassImprovedMismatchErrors.ts(8,5): error TS2416: Property 'n' in type 'Derived' is not assignable to the same property in base type 'Base'. Type 'string | Derived' is not assignable to type 'string | Base'. Type 'Derived' is not assignable to type 'string | Base'. @@ -5,6 +6,7 @@ baseClassImprovedMismatchErrors.ts(8,5): error TS2416: Property 'n' in type 'Der The types returned by 'fn()' are incompatible between these types. Type 'string | number' is not assignable to type 'number'. Type 'string' is not assignable to type 'number'. +baseClassImprovedMismatchErrors.ts(8,5): error TS2564: Property 'n' has no initializer and is not definitely assigned in the constructor. baseClassImprovedMismatchErrors.ts(9,5): error TS2416: Property 'fn' in type 'Derived' is not assignable to the same property in base type 'Base'. Type '() => number | string' is not assignable to type '() => number'. Type 'string | number' is not assignable to type 'number'. @@ -16,15 +18,18 @@ baseClassImprovedMismatchErrors.ts(14,5): error TS2416: Property 'n' in type 'De The types returned by 'fn()' are incompatible between these types. Type 'string | number' is not assignable to type 'number'. Type 'string' is not assignable to type 'number'. +baseClassImprovedMismatchErrors.ts(14,5): error TS2564: Property 'n' has no initializer and is not definitely assigned in the constructor. baseClassImprovedMismatchErrors.ts(15,5): error TS2416: Property 'fn' in type 'DerivedInterface' is not assignable to the same property in base type 'Base'. Type '() => number | string' is not assignable to type '() => number'. Type 'string | number' is not assignable to type 'number'. Type 'string' is not assignable to type 'number'. -==== baseClassImprovedMismatchErrors.ts (4 errors) ==== +==== baseClassImprovedMismatchErrors.ts (7 errors) ==== class Base { n: Base | string; + ~ +!!! error TS2564: Property 'n' has no initializer and is not definitely assigned in the constructor. fn() { return 10; } @@ -39,6 +44,8 @@ baseClassImprovedMismatchErrors.ts(15,5): error TS2416: Property 'fn' in type 'D !!! error TS2416: The types returned by 'fn()' are incompatible between these types. !!! error TS2416: Type 'string | number' is not assignable to type 'number'. !!! error TS2416: Type 'string' is not assignable to type 'number'. + ~ +!!! error TS2564: Property 'n' has no initializer and is not definitely assigned in the constructor. fn() { ~~ !!! error TS2416: Property 'fn' in type 'Derived' is not assignable to the same property in base type 'Base'. @@ -58,6 +65,8 @@ baseClassImprovedMismatchErrors.ts(15,5): error TS2416: Property 'fn' in type 'D !!! error TS2416: The types returned by 'fn()' are incompatible between these types. !!! error TS2416: Type 'string | number' is not assignable to type 'number'. !!! error TS2416: Type 'string' is not assignable to type 'number'. + ~ +!!! error TS2564: Property 'n' has no initializer and is not definitely assigned in the constructor. fn() { ~~ !!! error TS2416: Property 'fn' in type 'DerivedInterface' is not assignable to the same property in base type 'Base'. diff --git a/tests/baselines/reference/baseClassImprovedMismatchErrors.js b/tests/baselines/reference/baseClassImprovedMismatchErrors.js index 1515b02488de4..e73cbf77c818e 100644 --- a/tests/baselines/reference/baseClassImprovedMismatchErrors.js +++ b/tests/baselines/reference/baseClassImprovedMismatchErrors.js @@ -21,6 +21,7 @@ class DerivedInterface implements Base { } //// [baseClassImprovedMismatchErrors.js] +"use strict"; class Base { fn() { return 10; diff --git a/tests/baselines/reference/baseExpressionTypeParameters.js b/tests/baselines/reference/baseExpressionTypeParameters.js index 8fd5a020125f0..f109ac3a518a5 100644 --- a/tests/baselines/reference/baseExpressionTypeParameters.js +++ b/tests/baselines/reference/baseExpressionTypeParameters.js @@ -16,6 +16,7 @@ class Spec extends Gen {} Spec.prop; //// [baseExpressionTypeParameters.js] +"use strict"; // Repro from #17829 function base() { class Base { diff --git a/tests/baselines/reference/baseIndexSignatureResolution.errors.txt b/tests/baselines/reference/baseIndexSignatureResolution.errors.txt new file mode 100644 index 0000000000000..15c537d66f2d8 --- /dev/null +++ b/tests/baselines/reference/baseIndexSignatureResolution.errors.txt @@ -0,0 +1,36 @@ +baseIndexSignatureResolution.ts(1,22): error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. +baseIndexSignatureResolution.ts(2,38): error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. +baseIndexSignatureResolution.ts(11,5): error TS2322: Type 'null' is not assignable to type 'FooOf'. + + +==== baseIndexSignatureResolution.ts (3 errors) ==== + class Base { private a: string; } + ~ +!!! error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. + class Derived extends Base { private b: string; } + ~ +!!! error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. + + // Note - commmenting "extends Foo" prevents the error + interface Foo { + [i: number]: Base; + } + interface FooOf extends Foo { + [i: number]: TBase; + } + var x: FooOf = null; + ~ +!!! error TS2322: Type 'null' is not assignable to type 'FooOf'. + var y: Derived = x[0]; + + /* + // 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(); + */ \ No newline at end of file diff --git a/tests/baselines/reference/baseIndexSignatureResolution.js b/tests/baselines/reference/baseIndexSignatureResolution.js index 998c578d75e39..ce42439846750 100644 --- a/tests/baselines/reference/baseIndexSignatureResolution.js +++ b/tests/baselines/reference/baseIndexSignatureResolution.js @@ -27,6 +27,7 @@ var z: Derived = b.foo(); */ //// [baseIndexSignatureResolution.js] +"use strict"; class Base { } class Derived extends Base { diff --git a/tests/baselines/reference/baseTypeAfterDerivedType.js b/tests/baselines/reference/baseTypeAfterDerivedType.js index 90af33747af66..ce546e3404d73 100644 --- a/tests/baselines/reference/baseTypeAfterDerivedType.js +++ b/tests/baselines/reference/baseTypeAfterDerivedType.js @@ -19,6 +19,7 @@ interface Base2 { //// [baseTypeAfterDerivedType.js] +"use strict"; class Derived2 { method(...args) { } } diff --git a/tests/baselines/reference/baseTypeOrderChecking.errors.txt b/tests/baselines/reference/baseTypeOrderChecking.errors.txt new file mode 100644 index 0000000000000..4bba35c3625ab --- /dev/null +++ b/tests/baselines/reference/baseTypeOrderChecking.errors.txt @@ -0,0 +1,42 @@ +baseTypeOrderChecking.ts(25,23): error TS2564: Property 'memberVariable' has no initializer and is not definitely assigned in the constructor. + + +==== baseTypeOrderChecking.ts (1 errors) ==== + var someVariable: Class4; + + + + class Class1 + + { + + } + + + + class Class2 extends Class1 + + { + + } + + + + class Class3 + + { + + public memberVariable: Class2; + ~~~~~~~~~~~~~~ +!!! error TS2564: Property 'memberVariable' has no initializer and is not definitely assigned in the constructor. + + } + + + + class Class4 extends Class3 + + { + + } + \ No newline at end of file diff --git a/tests/baselines/reference/baseTypeOrderChecking.js b/tests/baselines/reference/baseTypeOrderChecking.js index b70e156b434b0..3cad16328cad6 100644 --- a/tests/baselines/reference/baseTypeOrderChecking.js +++ b/tests/baselines/reference/baseTypeOrderChecking.js @@ -39,6 +39,7 @@ class Class4 extends Class3 //// [baseTypeOrderChecking.js] +"use strict"; var someVariable; class Class1 { } diff --git a/tests/baselines/reference/baseTypePrivateMemberClash.errors.txt b/tests/baselines/reference/baseTypePrivateMemberClash.errors.txt index c4252e8a8ec99..bb0f191c09cfb 100644 --- a/tests/baselines/reference/baseTypePrivateMemberClash.errors.txt +++ b/tests/baselines/reference/baseTypePrivateMemberClash.errors.txt @@ -1,13 +1,19 @@ +baseTypePrivateMemberClash.ts(2,13): error TS2564: Property 'm' has no initializer and is not definitely assigned in the constructor. +baseTypePrivateMemberClash.ts(5,13): error TS2564: Property 'm' has no initializer and is not definitely assigned in the constructor. baseTypePrivateMemberClash.ts(8,11): error TS2320: Interface 'Z' cannot simultaneously extend types 'X' and 'Y'. Named property 'm' of types 'X' and 'Y' are not identical. -==== baseTypePrivateMemberClash.ts (1 errors) ==== +==== baseTypePrivateMemberClash.ts (3 errors) ==== class X { private m: number; + ~ +!!! error TS2564: Property 'm' has no initializer and is not definitely assigned in the constructor. } class Y { private m: string; + ~ +!!! error TS2564: Property 'm' has no initializer and is not definitely assigned in the constructor. } interface Z extends X, Y { } diff --git a/tests/baselines/reference/baseTypePrivateMemberClash.js b/tests/baselines/reference/baseTypePrivateMemberClash.js index a0b86f1ee94fd..72ccad655c7c9 100644 --- a/tests/baselines/reference/baseTypePrivateMemberClash.js +++ b/tests/baselines/reference/baseTypePrivateMemberClash.js @@ -11,6 +11,7 @@ class Y { interface Z extends X, Y { } //// [baseTypePrivateMemberClash.js] +"use strict"; class X { } class Y { diff --git a/tests/baselines/reference/baseTypeWrappingInstantiationChain.errors.txt b/tests/baselines/reference/baseTypeWrappingInstantiationChain.errors.txt new file mode 100644 index 0000000000000..f56653a356842 --- /dev/null +++ b/tests/baselines/reference/baseTypeWrappingInstantiationChain.errors.txt @@ -0,0 +1,33 @@ +baseTypeWrappingInstantiationChain.ts(14,5): error TS2564: Property 'property' has no initializer and is not definitely assigned in the constructor. + + +==== baseTypeWrappingInstantiationChain.ts (1 errors) ==== + class CBaseBase { + constructor(x: Parameter) { } + } + + class CBase extends CBaseBase> { + + } + + class Parameter { + method(t: T4) { } + } + + class Wrapper { + property: T5; + ~~~~~~~~ +!!! error TS2564: Property 'property' has no initializer and is not definitely assigned in the constructor. + } + + class C extends CBase { + public works() { + new CBaseBase>(this); + } + public alsoWorks() { + new CBase(this); // Should not error, parameter is of type Parameter> + } + + public method(t: Wrapper) { } + } + \ No newline at end of file diff --git a/tests/baselines/reference/baseTypeWrappingInstantiationChain.js b/tests/baselines/reference/baseTypeWrappingInstantiationChain.js index 6dfb6b7bba3bb..4e9ad5d5840da 100644 --- a/tests/baselines/reference/baseTypeWrappingInstantiationChain.js +++ b/tests/baselines/reference/baseTypeWrappingInstantiationChain.js @@ -30,6 +30,7 @@ class C extends CBase { //// [baseTypeWrappingInstantiationChain.js] +"use strict"; class CBaseBase { constructor(x) { } } diff --git a/tests/baselines/reference/bases.js b/tests/baselines/reference/bases.js index d3719591b70df..392f0e60eb327 100644 --- a/tests/baselines/reference/bases.js +++ b/tests/baselines/reference/bases.js @@ -23,6 +23,7 @@ new C().y; //// [bases.js] +"use strict"; class B { constructor() { this.y; diff --git a/tests/baselines/reference/bestChoiceType.js b/tests/baselines/reference/bestChoiceType.js index 1547706c7d8ed..3fe5366551c59 100644 --- a/tests/baselines/reference/bestChoiceType.js +++ b/tests/baselines/reference/bestChoiceType.js @@ -21,6 +21,7 @@ function f2() { //// [bestChoiceType.js] +"use strict"; // Repro from #10041 (''.match(/ /) || []).map(s => s.toLowerCase()); // Similar cases diff --git a/tests/baselines/reference/bestChoiceType.symbols b/tests/baselines/reference/bestChoiceType.symbols index 6c5ba9f0d1805..e17d85433a00d 100644 --- a/tests/baselines/reference/bestChoiceType.symbols +++ b/tests/baselines/reference/bestChoiceType.symbols @@ -9,7 +9,9 @@ >match : Symbol(String.match, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >s : Symbol(s, Decl(bestChoiceType.ts, 2, 26)) +>s.toLowerCase : Symbol(String.toLowerCase, Decl(lib.es5.d.ts, --, --)) >s : Symbol(s, Decl(bestChoiceType.ts, 2, 26)) +>toLowerCase : Symbol(String.toLowerCase, Decl(lib.es5.d.ts, --, --)) // Similar cases @@ -31,7 +33,9 @@ function f1() { >y : Symbol(y, Decl(bestChoiceType.ts, 8, 7)) >map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >s : Symbol(s, Decl(bestChoiceType.ts, 9, 18)) +>s.toLowerCase : Symbol(String.toLowerCase, Decl(lib.es5.d.ts, --, --)) >s : Symbol(s, Decl(bestChoiceType.ts, 9, 18)) +>toLowerCase : Symbol(String.toLowerCase, Decl(lib.es5.d.ts, --, --)) } function f2() { @@ -53,6 +57,8 @@ function f2() { >y : Symbol(y, Decl(bestChoiceType.ts, 14, 7)) >map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >s : Symbol(s, Decl(bestChoiceType.ts, 15, 18)) +>s.toLowerCase : Symbol(String.toLowerCase, Decl(lib.es5.d.ts, --, --)) >s : Symbol(s, Decl(bestChoiceType.ts, 15, 18)) +>toLowerCase : Symbol(String.toLowerCase, Decl(lib.es5.d.ts, --, --)) } diff --git a/tests/baselines/reference/bestChoiceType.types b/tests/baselines/reference/bestChoiceType.types index aedabb0df7ebd..fc366984fcd14 100644 --- a/tests/baselines/reference/bestChoiceType.types +++ b/tests/baselines/reference/bestChoiceType.types @@ -4,8 +4,8 @@ // Repro from #10041 (''.match(/ /) || []).map(s => s.toLowerCase()); ->(''.match(/ /) || []).map(s => s.toLowerCase()) : any[] -> : ^^^^^ +>(''.match(/ /) || []).map(s => s.toLowerCase()) : string[] +> : ^^^^^^^^ >(''.match(/ /) || []).map : ((callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[]) | ((callbackfn: (value: never, index: number, array: never[]) => U, thisArg?: any) => U[]) > : ^^ ^^ ^^^ ^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^ >(''.match(/ /) || []) : RegExpMatchArray | [] @@ -26,15 +26,18 @@ > : ^^ >map : ((callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[]) | ((callbackfn: (value: never, index: number, array: never[]) => U, thisArg?: any) => U[]) > : ^^ ^^ ^^^ ^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^ ->s => s.toLowerCase() : (s: any) => any -> : ^ ^^^^^^^^^^^^^ ->s : any ->s.toLowerCase() : any ->s.toLowerCase : any ->s : any -> : ^^^ ->toLowerCase : any -> : ^^^ +>s => s.toLowerCase() : (s: string) => string +> : ^ ^^^^^^^^^^^^^^^^^^^ +>s : string +> : ^^^^^^ +>s.toLowerCase() : string +> : ^^^^^^ +>s.toLowerCase : () => string +> : ^^^^^^ +>s : string +> : ^^^^^^ +>toLowerCase : () => string +> : ^^^^^^ // Similar cases @@ -67,25 +70,28 @@ function f1() { > : ^^ let z = y.map(s => s.toLowerCase()); ->z : any[] -> : ^^^^^ ->y.map(s => s.toLowerCase()) : any[] -> : ^^^^^ +>z : string[] +> : ^^^^^^^^ +>y.map(s => s.toLowerCase()) : string[] +> : ^^^^^^^^ >y.map : ((callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[]) | ((callbackfn: (value: never, index: number, array: never[]) => U, thisArg?: any) => U[]) > : ^^ ^^ ^^^ ^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^ >y : RegExpMatchArray | [] > : ^^^^^^^^^^^^^^^^^^^^^ >map : ((callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[]) | ((callbackfn: (value: never, index: number, array: never[]) => U, thisArg?: any) => U[]) > : ^^ ^^ ^^^ ^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^ ->s => s.toLowerCase() : (s: any) => any -> : ^ ^^^^^^^^^^^^^ ->s : any ->s.toLowerCase() : any ->s.toLowerCase : any ->s : any -> : ^^^ ->toLowerCase : any -> : ^^^ +>s => s.toLowerCase() : (s: string) => string +> : ^ ^^^^^^^^^^^^^^^^^^^ +>s : string +> : ^^^^^^ +>s.toLowerCase() : string +> : ^^^^^^ +>s.toLowerCase : () => string +> : ^^^^^^ +>s : string +> : ^^^^^^ +>toLowerCase : () => string +> : ^^^^^^ } function f2() { @@ -119,24 +125,27 @@ function f2() { > : ^^^^^^^ let z = y.map(s => s.toLowerCase()); ->z : any[] -> : ^^^^^ ->y.map(s => s.toLowerCase()) : any[] -> : ^^^^^ +>z : string[] +> : ^^^^^^^^ +>y.map(s => s.toLowerCase()) : string[] +> : ^^^^^^^^ >y.map : ((callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[]) | ((callbackfn: (value: never, index: number, array: never[]) => U, thisArg?: any) => U[]) > : ^^ ^^ ^^^ ^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^ >y : RegExpMatchArray | never[] > : ^^^^^^^^^^^^^^^^^^^^^^^^^^ >map : ((callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[]) | ((callbackfn: (value: never, index: number, array: never[]) => U, thisArg?: any) => U[]) > : ^^ ^^ ^^^ ^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^ ->s => s.toLowerCase() : (s: any) => any -> : ^ ^^^^^^^^^^^^^ ->s : any ->s.toLowerCase() : any ->s.toLowerCase : any ->s : any -> : ^^^ ->toLowerCase : any -> : ^^^ +>s => s.toLowerCase() : (s: string) => string +> : ^ ^^^^^^^^^^^^^^^^^^^ +>s : string +> : ^^^^^^ +>s.toLowerCase() : string +> : ^^^^^^ +>s.toLowerCase : () => string +> : ^^^^^^ +>s : string +> : ^^^^^^ +>toLowerCase : () => string +> : ^^^^^^ } diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.errors.txt b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.errors.txt new file mode 100644 index 0000000000000..61ae3a037b0e1 --- /dev/null +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.errors.txt @@ -0,0 +1,67 @@ +bestCommonTypeOfConditionalExpressions.ts(7,14): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. +bestCommonTypeOfConditionalExpressions.ts(8,30): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. +bestCommonTypeOfConditionalExpressions.ts(9,31): error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. +bestCommonTypeOfConditionalExpressions.ts(16,17): error TS2454: Variable 'a' is used before being assigned. +bestCommonTypeOfConditionalExpressions.ts(17,17): error TS2454: Variable 'b' is used before being assigned. +bestCommonTypeOfConditionalExpressions.ts(19,5): error TS2322: Type '((x: number) => void) | ((x: Object) => void)' is not assignable to type '(x: Object) => void'. + Type '(x: number) => void' is not assignable to type '(x: Object) => void'. + Types of parameters 'x' and 'x' are incompatible. + Type 'Object' is not assignable to type 'number'. +bestCommonTypeOfConditionalExpressions.ts(21,24): error TS2454: Variable 'derived' is used before being assigned. +bestCommonTypeOfConditionalExpressions.ts(22,18): error TS2454: Variable 'base' is used before being assigned. +bestCommonTypeOfConditionalExpressions.ts(25,19): error TS2322: Type 'T' is not assignable to type 'Object'. +bestCommonTypeOfConditionalExpressions.ts(25,23): error TS2322: Type 'U' is not assignable to type 'Object'. + + +==== bestCommonTypeOfConditionalExpressions.ts (10 errors) ==== + // 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 }; + var b: { x: number; z?: number }; + + class Base { foo: string; } + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. + class Derived extends Base { bar: string; } + ~~~ +!!! error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. + class Derived2 extends Base { baz: string; } + ~~~ +!!! error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. + var base: Base; + var derived: Derived; + var derived2: Derived2; + + var r = true ? 1 : 2; + var r3 = true ? 1 : {}; + var r4 = true ? a : b; // typeof a + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var r5 = true ? b : a; // typeof b + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var r6 = true ? (x: number) => { } : (x: Object) => { }; // returns number => void + var r7: (x: Object) => void = true ? (x: number) => { } : (x: Object) => { }; + ~~ +!!! error TS2322: Type '((x: number) => void) | ((x: Object) => void)' is not assignable to type '(x: Object) => void'. +!!! error TS2322: Type '(x: number) => void' is not assignable to type '(x: Object) => void'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'Object' is not assignable to type 'number'. + var r8 = true ? (x: Object) => { } : (x: number) => { }; // returns Object => void + var r10: Base = true ? derived : derived2; // no error since we use the contextual type in BCT + ~~~~~~~ +!!! error TS2454: Variable 'derived' is used before being assigned. + var r11 = true ? base : derived2; + ~~~~ +!!! error TS2454: Variable 'base' is used before being assigned. + + function foo5(t: T, u: U): Object { + return true ? t : u; // BCT is Object + ~ +!!! error TS2322: Type 'T' is not assignable to type 'Object'. +!!! related TS2208 bestCommonTypeOfConditionalExpressions.ts:24:15: This type parameter might need an `extends Object` constraint. + ~ +!!! error TS2322: Type 'U' is not assignable to type 'Object'. +!!! related TS2208 bestCommonTypeOfConditionalExpressions.ts:24:18: This type parameter might need an `extends Object` constraint. + } \ No newline at end of file diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js index dc8466a6e93fa..133da5cc59d8b 100644 --- a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js @@ -29,6 +29,7 @@ function foo5(t: T, u: U): Object { } //// [bestCommonTypeOfConditionalExpressions.js] +"use strict"; // 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; diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types index 5ad7b098ee2ea..268325b95862d 100644 --- a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types @@ -9,16 +9,16 @@ var a: { x: number; y?: number }; > : ^^^^^ ^^^^^^ ^^^ >x : number > : ^^^^^^ ->y : number -> : ^^^^^^ +>y : number | undefined +> : ^^^^^^^^^^^^^^^^^^ var b: { x: number; z?: number }; >b : { x: number; z?: number; } > : ^^^^^ ^^^^^^ ^^^ >x : number > : ^^^^^^ ->z : number -> : ^^^^^^ +>z : number | undefined +> : ^^^^^^^^^^^^^^^^^^ class Base { foo: string; } >Base : Base diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.errors.txt b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.errors.txt new file mode 100644 index 0000000000000..5528d91d01b94 --- /dev/null +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.errors.txt @@ -0,0 +1,39 @@ +bestCommonTypeOfConditionalExpressions2.ts(4,14): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. +bestCommonTypeOfConditionalExpressions2.ts(5,30): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. +bestCommonTypeOfConditionalExpressions2.ts(6,31): error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. +bestCommonTypeOfConditionalExpressions2.ts(12,17): error TS2454: Variable 'derived' is used before being assigned. + + +==== bestCommonTypeOfConditionalExpressions2.ts (4 errors) ==== + // conditional expressions return the best common type of the branches plus contextual type (using the first candidate if multiple BCTs exist) + // these are errors + + class Base { foo: string; } + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. + class Derived extends Base { bar: string; } + ~~~ +!!! error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. + class Derived2 extends Base { baz: string; } + ~~~ +!!! error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. + var base: Base; + var derived: Derived; + var derived2: Derived2; + + var r2 = true ? 1 : ''; + var r9 = true ? derived : derived2; + ~~~~~~~ +!!! error TS2454: Variable 'derived' is used before being assigned. + + function foo(t: T, u: U) { + return true ? t : u; + } + + function foo2(t: T, u: U) { // Error for referencing own type parameter + return true ? t : u; // Ok because BCT(T, U) = U + } + + function foo3(t: T, u: U) { + return true ? t : u; + } \ No newline at end of file diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.js b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.js index b3e4c8f21fd4d..40d9fe2e6d164 100644 --- a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.js +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.js @@ -27,6 +27,7 @@ function foo3(t: T, u: U) { } //// [bestCommonTypeOfConditionalExpressions2.js] +"use strict"; // conditional expressions return the best common type of the branches plus contextual type (using the first candidate if multiple BCTs exist) // these are errors class Base { diff --git a/tests/baselines/reference/bestCommonTypeOfTuple.js b/tests/baselines/reference/bestCommonTypeOfTuple.js index 9a5db94da9f7e..3aa2bab4bb81f 100644 --- a/tests/baselines/reference/bestCommonTypeOfTuple.js +++ b/tests/baselines/reference/bestCommonTypeOfTuple.js @@ -28,6 +28,7 @@ var e3 = t3[2]; // any var e4 = t4[3]; // number //// [bestCommonTypeOfTuple.js] +"use strict"; function f1(x) { return "foo"; } function f2(x) { return 10; } function f3(x) { return true; } diff --git a/tests/baselines/reference/bestCommonTypeOfTuple2.errors.txt b/tests/baselines/reference/bestCommonTypeOfTuple2.errors.txt index c7615aea73486..846e1d4a93d84 100644 --- a/tests/baselines/reference/bestCommonTypeOfTuple2.errors.txt +++ b/tests/baselines/reference/bestCommonTypeOfTuple2.errors.txt @@ -1,3 +1,10 @@ +bestCommonTypeOfTuple2.ts(2,19): error TS7008: Member 'i' implicitly has an 'any' type. +bestCommonTypeOfTuple2.ts(3,27): error TS7008: Member 'c' implicitly has an 'any' type. +bestCommonTypeOfTuple2.ts(4,27): error TS7008: Member 'd' implicitly has an 'any' type. +bestCommonTypeOfTuple2.ts(5,27): error TS7008: Member 'e' implicitly has an 'any' type. +bestCommonTypeOfTuple2.ts(6,21): error TS7008: Member 'f' implicitly has an 'any' type. +bestCommonTypeOfTuple2.ts(8,40): error TS7008: Member 'c' implicitly has an 'any' type. +bestCommonTypeOfTuple2.ts(9,34): error TS7008: Member 'd' implicitly has an 'any' type. bestCommonTypeOfTuple2.ts(17,14): error TS2493: Tuple type '[C, base]' of length '2' has no element at index '4'. bestCommonTypeOfTuple2.ts(18,14): error TS2493: Tuple type '[C, D]' of length '2' has no element at index '4'. bestCommonTypeOfTuple2.ts(19,14): error TS2493: Tuple type '[C1, D1]' of length '2' has no element at index '4'. @@ -5,16 +12,30 @@ bestCommonTypeOfTuple2.ts(20,14): error TS2493: Tuple type '[base1, C1]' of leng bestCommonTypeOfTuple2.ts(21,14): error TS2493: Tuple type '[C1, F]' of length '2' has no element at index '2'. -==== bestCommonTypeOfTuple2.ts (5 errors) ==== +==== bestCommonTypeOfTuple2.ts (12 errors) ==== interface base { } interface base1 { i } + ~ +!!! error TS7008: Member 'i' implicitly has an 'any' type. class C implements base { c } + ~ +!!! error TS7008: Member 'c' implicitly has an 'any' type. class D implements base { d } + ~ +!!! error TS7008: Member 'd' implicitly has an 'any' type. class E implements base { e } + ~ +!!! error TS7008: Member 'e' implicitly has an 'any' type. class F extends C { f } + ~ +!!! error TS7008: Member 'f' implicitly has an 'any' type. class C1 implements base1 { i = "foo"; c } + ~ +!!! error TS7008: Member 'c' implicitly has an 'any' type. class D1 extends C1 { i = "bar"; d } + ~ +!!! error TS7008: Member 'd' implicitly has an 'any' type. declare var t1: [C, base]; declare var t2: [C, D]; diff --git a/tests/baselines/reference/bestCommonTypeOfTuple2.js b/tests/baselines/reference/bestCommonTypeOfTuple2.js index 754939a8aedd9..ab1cdb5a3d614 100644 --- a/tests/baselines/reference/bestCommonTypeOfTuple2.js +++ b/tests/baselines/reference/bestCommonTypeOfTuple2.js @@ -25,6 +25,7 @@ var e51 = t5[2]; // {} //// [bestCommonTypeOfTuple2.js] +"use strict"; class C { } class D { diff --git a/tests/baselines/reference/bestCommonTypeReturnStatement.errors.txt b/tests/baselines/reference/bestCommonTypeReturnStatement.errors.txt new file mode 100644 index 0000000000000..5d5a43e86a68c --- /dev/null +++ b/tests/baselines/reference/bestCommonTypeReturnStatement.errors.txt @@ -0,0 +1,21 @@ +bestCommonTypeReturnStatement.ts(11,32): error TS2322: Type 'null' is not assignable to type 'IPromise'. +bestCommonTypeReturnStatement.ts(12,31): error TS2322: Type 'null' is not assignable to type 'IPromise'. + + +==== bestCommonTypeReturnStatement.ts (2 errors) ==== + interface IPromise { + then(successCallback: (promiseValue: T) => any, errorCallback?: (reason: any) => any): IPromise; + } + + function f() { + if (true) return b(); + return d(); + } + + + function b(): IPromise { return null; } + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'IPromise'. + function d(): IPromise { return null; } + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'IPromise'. \ No newline at end of file diff --git a/tests/baselines/reference/bestCommonTypeReturnStatement.js b/tests/baselines/reference/bestCommonTypeReturnStatement.js index 15d0a79925bfc..038a200f9423c 100644 --- a/tests/baselines/reference/bestCommonTypeReturnStatement.js +++ b/tests/baselines/reference/bestCommonTypeReturnStatement.js @@ -15,6 +15,7 @@ function b(): IPromise { return null; } function d(): IPromise { return null; } //// [bestCommonTypeReturnStatement.js] +"use strict"; function f() { if (true) return b(); diff --git a/tests/baselines/reference/bestCommonTypeReturnStatement.types b/tests/baselines/reference/bestCommonTypeReturnStatement.types index 38afacec4b0a8..cffc7bd7577db 100644 --- a/tests/baselines/reference/bestCommonTypeReturnStatement.types +++ b/tests/baselines/reference/bestCommonTypeReturnStatement.types @@ -9,9 +9,10 @@ interface IPromise { > : ^ ^^ ^^^^^ >promiseValue : T > : ^ ->errorCallback : (reason: any) => any -> : ^ ^^ ^^^^^ +>errorCallback : ((reason: any) => any) | undefined +> : ^^ ^^ ^^^^^ ^^^^^^^^^^^^^ >reason : any +> : ^^^ } function f() { diff --git a/tests/baselines/reference/bestCommonTypeWithContextualTyping.js b/tests/baselines/reference/bestCommonTypeWithContextualTyping.js index 4ce6071619817..3eb18c5763db7 100644 --- a/tests/baselines/reference/bestCommonTypeWithContextualTyping.js +++ b/tests/baselines/reference/bestCommonTypeWithContextualTyping.js @@ -23,6 +23,7 @@ var conditional: Contextual = null ? e : e; // Ellement var contextualOr: Contextual = e || e; // Ellement //// [bestCommonTypeWithContextualTyping.js] +"use strict"; // 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. diff --git a/tests/baselines/reference/bestCommonTypeWithOptionalProperties.errors.txt b/tests/baselines/reference/bestCommonTypeWithOptionalProperties.errors.txt new file mode 100644 index 0000000000000..41994ef3362f5 --- /dev/null +++ b/tests/baselines/reference/bestCommonTypeWithOptionalProperties.errors.txt @@ -0,0 +1,72 @@ +bestCommonTypeWithOptionalProperties.ts(10,11): error TS2454: Variable 'x' is used before being assigned. +bestCommonTypeWithOptionalProperties.ts(10,14): error TS2454: Variable 'y' is used before being assigned. +bestCommonTypeWithOptionalProperties.ts(10,17): error TS2454: Variable 'z' is used before being assigned. +bestCommonTypeWithOptionalProperties.ts(11,11): error TS2454: Variable 'x' is used before being assigned. +bestCommonTypeWithOptionalProperties.ts(11,14): error TS2454: Variable 'z' is used before being assigned. +bestCommonTypeWithOptionalProperties.ts(11,17): error TS2454: Variable 'y' is used before being assigned. +bestCommonTypeWithOptionalProperties.ts(12,11): error TS2454: Variable 'y' is used before being assigned. +bestCommonTypeWithOptionalProperties.ts(12,14): error TS2454: Variable 'x' is used before being assigned. +bestCommonTypeWithOptionalProperties.ts(12,17): error TS2454: Variable 'z' is used before being assigned. +bestCommonTypeWithOptionalProperties.ts(13,11): error TS2454: Variable 'y' is used before being assigned. +bestCommonTypeWithOptionalProperties.ts(13,14): error TS2454: Variable 'z' is used before being assigned. +bestCommonTypeWithOptionalProperties.ts(13,17): error TS2454: Variable 'x' is used before being assigned. +bestCommonTypeWithOptionalProperties.ts(14,11): error TS2454: Variable 'z' is used before being assigned. +bestCommonTypeWithOptionalProperties.ts(14,14): error TS2454: Variable 'x' is used before being assigned. +bestCommonTypeWithOptionalProperties.ts(14,17): error TS2454: Variable 'y' is used before being assigned. +bestCommonTypeWithOptionalProperties.ts(15,11): error TS2454: Variable 'z' is used before being assigned. +bestCommonTypeWithOptionalProperties.ts(15,14): error TS2454: Variable 'y' is used before being assigned. +bestCommonTypeWithOptionalProperties.ts(15,17): error TS2454: Variable 'x' is used before being assigned. + + +==== bestCommonTypeWithOptionalProperties.ts (18 errors) ==== + interface X { foo: string } + interface Y extends X { bar?: number } + interface Z extends X { bar: string } + + var x: X; + var y: Y; + var z: Z; + + // All these arrays should be X[] + var b1 = [x, y, z]; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + ~ +!!! error TS2454: Variable 'y' is used before being assigned. + ~ +!!! error TS2454: Variable 'z' is used before being assigned. + var b2 = [x, z, y]; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + ~ +!!! error TS2454: Variable 'z' is used before being assigned. + ~ +!!! error TS2454: Variable 'y' is used before being assigned. + var b3 = [y, x, z]; + ~ +!!! error TS2454: Variable 'y' is used before being assigned. + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + ~ +!!! error TS2454: Variable 'z' is used before being assigned. + var b4 = [y, z, x]; + ~ +!!! error TS2454: Variable 'y' is used before being assigned. + ~ +!!! error TS2454: Variable 'z' is used before being assigned. + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + var b5 = [z, x, y]; + ~ +!!! error TS2454: Variable 'z' is used before being assigned. + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + ~ +!!! error TS2454: Variable 'y' is used before being assigned. + var b6 = [z, y, x]; + ~ +!!! error TS2454: Variable 'z' is used before being assigned. + ~ +!!! error TS2454: Variable 'y' is used before being assigned. + ~ +!!! error TS2454: Variable 'x' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/bestCommonTypeWithOptionalProperties.js b/tests/baselines/reference/bestCommonTypeWithOptionalProperties.js index ad717910dc9e2..9ecb6f383722f 100644 --- a/tests/baselines/reference/bestCommonTypeWithOptionalProperties.js +++ b/tests/baselines/reference/bestCommonTypeWithOptionalProperties.js @@ -18,6 +18,7 @@ var b5 = [z, x, y]; var b6 = [z, y, x]; //// [bestCommonTypeWithOptionalProperties.js] +"use strict"; var x; var y; var z; diff --git a/tests/baselines/reference/bestCommonTypeWithOptionalProperties.types b/tests/baselines/reference/bestCommonTypeWithOptionalProperties.types index 03e5a4976b381..f8be2b62be0ef 100644 --- a/tests/baselines/reference/bestCommonTypeWithOptionalProperties.types +++ b/tests/baselines/reference/bestCommonTypeWithOptionalProperties.types @@ -6,8 +6,8 @@ interface X { foo: string } > : ^^^^^^ interface Y extends X { bar?: number } ->bar : number -> : ^^^^^^ +>bar : number | undefined +> : ^^^^^^^^^^^^^^^^^^ interface Z extends X { bar: string } >bar : string diff --git a/tests/baselines/reference/betterErrorForAccidentalCall.js b/tests/baselines/reference/betterErrorForAccidentalCall.js index e22336056f36d..492580b95be5b 100644 --- a/tests/baselines/reference/betterErrorForAccidentalCall.js +++ b/tests/baselines/reference/betterErrorForAccidentalCall.js @@ -18,6 +18,7 @@ foo() //// [betterErrorForAccidentalCall.js] +"use strict"; foo()(1).toString(); foo()(1).toString(); foo()(1).toString(); diff --git a/tests/baselines/reference/betterErrorForUnionCall.js b/tests/baselines/reference/betterErrorForUnionCall.js index 18a0a18117a61..579c5854ea2ce 100644 --- a/tests/baselines/reference/betterErrorForUnionCall.js +++ b/tests/baselines/reference/betterErrorForUnionCall.js @@ -12,6 +12,7 @@ fnUnion2(""); //// [betterErrorForUnionCall.js] +"use strict"; union(""); fnUnion(""); fnUnion2(""); diff --git a/tests/baselines/reference/bigIntWithTargetES2016.js b/tests/baselines/reference/bigIntWithTargetES2016.js index 16de875074f1a..f3c43ab2809e7 100644 --- a/tests/baselines/reference/bigIntWithTargetES2016.js +++ b/tests/baselines/reference/bigIntWithTargetES2016.js @@ -8,6 +8,7 @@ num **= BigInt(2); // should not error //// [bigIntWithTargetES2016.js] +"use strict"; BigInt(1) ** BigInt(1); // should not error let num = BigInt(2); num **= BigInt(2); // should not error diff --git a/tests/baselines/reference/bigIntWithTargetLessThanES2016.js b/tests/baselines/reference/bigIntWithTargetLessThanES2016.js index f8266ae31f79c..5699346b8e0ff 100644 --- a/tests/baselines/reference/bigIntWithTargetLessThanES2016.js +++ b/tests/baselines/reference/bigIntWithTargetLessThanES2016.js @@ -8,6 +8,7 @@ foo **= BigInt(2); // should error //// [bigIntWithTargetLessThanES2016.js] +"use strict"; Math.pow(BigInt(1), BigInt(1)); // should error let foo = BigInt(2); foo = Math.pow(foo, BigInt(2)); // should error diff --git a/tests/baselines/reference/bigint64ArraySubarray.js b/tests/baselines/reference/bigint64ArraySubarray.js index 14b75c4cd9eaf..7b605405c9e27 100644 --- a/tests/baselines/reference/bigint64ArraySubarray.js +++ b/tests/baselines/reference/bigint64ArraySubarray.js @@ -10,6 +10,7 @@ function bigInt64ArraySubarray() { //// [bigint64ArraySubarray.js] +"use strict"; function bigInt64ArraySubarray() { var arr = new BigInt64Array(10); arr.subarray(); diff --git a/tests/baselines/reference/bigintAmbientMinimal(target=es2015).js b/tests/baselines/reference/bigintAmbientMinimal(target=es2015).js index a6d12b6f3c193..904c488e7dc00 100644 --- a/tests/baselines/reference/bigintAmbientMinimal(target=es2015).js +++ b/tests/baselines/reference/bigintAmbientMinimal(target=es2015).js @@ -14,5 +14,6 @@ declare const n = 123n; const regular = 456n; //// [main.js] +"use strict"; // Non-ambient for comparison const regular = 456n; diff --git a/tests/baselines/reference/bigintAmbientMinimal(target=es5).js b/tests/baselines/reference/bigintAmbientMinimal(target=es5).js index d2147fb7d30fb..ae3c3f282fbcd 100644 --- a/tests/baselines/reference/bigintAmbientMinimal(target=es5).js +++ b/tests/baselines/reference/bigintAmbientMinimal(target=es5).js @@ -14,5 +14,6 @@ declare const n = 123n; const regular = 456n; //// [main.js] +"use strict"; // Non-ambient for comparison var regular = 456n; diff --git a/tests/baselines/reference/bigintIndex.js b/tests/baselines/reference/bigintIndex.js index 0ee392380df41..0024d0456dda4 100644 --- a/tests/baselines/reference/bigintIndex.js +++ b/tests/baselines/reference/bigintIndex.js @@ -27,6 +27,7 @@ typedArray[2] = 0xCC; //// [a.js] +"use strict"; const arr = [1, 2, 3]; let num = arr[1]; num = arr["1"]; diff --git a/tests/baselines/reference/bigintMissingES2019.js b/tests/baselines/reference/bigintMissingES2019.js index b8faa1b7a8df5..42b258c404ec1 100644 --- a/tests/baselines/reference/bigintMissingES2019.js +++ b/tests/baselines/reference/bigintMissingES2019.js @@ -10,6 +10,7 @@ test<{t?: string}, bigint>(); //// [bigintMissingES2019.js] +"use strict"; test(); test(); // no error when bigint is used even when ES2020 lib is not present diff --git a/tests/baselines/reference/bigintMissingES2019.types b/tests/baselines/reference/bigintMissingES2019.types index 16dc015c249aa..27a339122bba3 100644 --- a/tests/baselines/reference/bigintMissingES2019.types +++ b/tests/baselines/reference/bigintMissingES2019.types @@ -10,16 +10,16 @@ test<{t?: string}, object>(); > : ^^^^ >test : () => void > : ^ ^^ ^^^^^^^^^ ^^^^^^^ ->t : string -> : ^^^^^^ +>t : string | undefined +> : ^^^^^^^^^^^^^^^^^^ test<{t?: string}, bigint>(); >test<{t?: string}, bigint>() : void > : ^^^^ >test : () => void > : ^ ^^ ^^^^^^^^^ ^^^^^^^ ->t : string -> : ^^^^^^ +>t : string | undefined +> : ^^^^^^^^^^^^^^^^^^ // no error when bigint is used even when ES2020 lib is not present diff --git a/tests/baselines/reference/bigintMissingES2020.js b/tests/baselines/reference/bigintMissingES2020.js index 593123c9694d0..586e6c9808cbd 100644 --- a/tests/baselines/reference/bigintMissingES2020.js +++ b/tests/baselines/reference/bigintMissingES2020.js @@ -10,6 +10,7 @@ test<{t?: string}, bigint>(); //// [bigintMissingES2020.js] +"use strict"; test(); test(); // no error when bigint is used even when ES2020 lib is not present diff --git a/tests/baselines/reference/bigintMissingES2020.types b/tests/baselines/reference/bigintMissingES2020.types index 0a9afb5924efc..16821ae66ea8d 100644 --- a/tests/baselines/reference/bigintMissingES2020.types +++ b/tests/baselines/reference/bigintMissingES2020.types @@ -10,16 +10,16 @@ test<{t?: string}, object>(); > : ^^^^ >test : () => void > : ^ ^^ ^^^^^^^^^ ^^^^^^^ ->t : string -> : ^^^^^^ +>t : string | undefined +> : ^^^^^^^^^^^^^^^^^^ test<{t?: string}, bigint>(); >test<{t?: string}, bigint>() : void > : ^^^^ >test : () => void > : ^ ^^ ^^^^^^^^^ ^^^^^^^ ->t : string -> : ^^^^^^ +>t : string | undefined +> : ^^^^^^^^^^^^^^^^^^ // no error when bigint is used even when ES2020 lib is not present diff --git a/tests/baselines/reference/bigintMissingESNext.js b/tests/baselines/reference/bigintMissingESNext.js index ee19515847b21..44420f62c4755 100644 --- a/tests/baselines/reference/bigintMissingESNext.js +++ b/tests/baselines/reference/bigintMissingESNext.js @@ -10,6 +10,7 @@ test<{t?: string}, bigint>(); //// [bigintMissingESNext.js] +"use strict"; test(); test(); // no error when bigint is used even when ES2020 lib is not present diff --git a/tests/baselines/reference/bigintMissingESNext.types b/tests/baselines/reference/bigintMissingESNext.types index bb0d340daa65a..fa6c12079003e 100644 --- a/tests/baselines/reference/bigintMissingESNext.types +++ b/tests/baselines/reference/bigintMissingESNext.types @@ -10,16 +10,16 @@ test<{t?: string}, object>(); > : ^^^^ >test : () => void > : ^ ^^ ^^^^^^^^^ ^^^^^^^ ->t : string -> : ^^^^^^ +>t : string | undefined +> : ^^^^^^^^^^^^^^^^^^ test<{t?: string}, bigint>(); >test<{t?: string}, bigint>() : void > : ^^^^ >test : () => void > : ^ ^^ ^^^^^^^^^ ^^^^^^^ ->t : string -> : ^^^^^^ +>t : string | undefined +> : ^^^^^^^^^^^^^^^^^^ // no error when bigint is used even when ES2020 lib is not present diff --git a/tests/baselines/reference/bigintPropertyName.js b/tests/baselines/reference/bigintPropertyName.js index baf37339f1b7d..460e81e39139e 100644 --- a/tests/baselines/reference/bigintPropertyName.js +++ b/tests/baselines/reference/bigintPropertyName.js @@ -60,6 +60,7 @@ type T = { [t in Q]: string }; //// [a.js] +"use strict"; // BigInt cannot be used as an object literal property { ({ 1n: 123 }); @@ -76,6 +77,7 @@ const { 0n: f } = arr; // bigint should give an index error // BigInt cannot be used as an property name const x = { 0n: 123 }; //// [g.js] +"use strict"; class K { 4n = 0; } @@ -101,3 +103,4 @@ l2[5n]; g; .2n; // not valid JS //// [q.js] +"use strict"; diff --git a/tests/baselines/reference/bigintWithLib.js b/tests/baselines/reference/bigintWithLib.js index 18d7e410ee900..8141e335c605e 100644 --- a/tests/baselines/reference/bigintWithLib.js +++ b/tests/baselines/reference/bigintWithLib.js @@ -64,6 +64,7 @@ new Intl.NumberFormat("fr").format(bigintVal); //// [bigintWithLib.js] +"use strict"; // Test BigInt functions let bigintVal = BigInt(123); bigintVal = BigInt("456"); diff --git a/tests/baselines/reference/bigintWithoutLib(target=es2015).js b/tests/baselines/reference/bigintWithoutLib(target=es2015).js index 26275b255769f..4161c83bf6c0d 100644 --- a/tests/baselines/reference/bigintWithoutLib(target=es2015).js +++ b/tests/baselines/reference/bigintWithoutLib(target=es2015).js @@ -60,6 +60,7 @@ new Intl.NumberFormat("fr").format(bigintVal); //// [bigintWithoutLib.js] +"use strict"; // Every line should error because these builtins are not declared // Test BigInt functions let bigintVal = BigInt(123); diff --git a/tests/baselines/reference/bigintWithoutLib(target=es5).js b/tests/baselines/reference/bigintWithoutLib(target=es5).js index de6a8f3d2e38d..81165f07c38eb 100644 --- a/tests/baselines/reference/bigintWithoutLib(target=es5).js +++ b/tests/baselines/reference/bigintWithoutLib(target=es5).js @@ -60,6 +60,7 @@ new Intl.NumberFormat("fr").format(bigintVal); //// [bigintWithoutLib.js] +"use strict"; // Every line should error because these builtins are not declared // Test BigInt functions var bigintVal = BigInt(123); diff --git a/tests/baselines/reference/binaryArithmatic1.js b/tests/baselines/reference/binaryArithmatic1.js index 7cfaa3d3f3be1..a716ada4cffa0 100644 --- a/tests/baselines/reference/binaryArithmatic1.js +++ b/tests/baselines/reference/binaryArithmatic1.js @@ -4,4 +4,5 @@ var v = 4 | null; //// [binaryArithmatic1.js] +"use strict"; var v = 4 | null; diff --git a/tests/baselines/reference/binaryArithmatic2.js b/tests/baselines/reference/binaryArithmatic2.js index 244fc6f91142b..4843afb20240c 100644 --- a/tests/baselines/reference/binaryArithmatic2.js +++ b/tests/baselines/reference/binaryArithmatic2.js @@ -4,4 +4,5 @@ var v = 4 | undefined; //// [binaryArithmatic2.js] +"use strict"; var v = 4 | undefined; diff --git a/tests/baselines/reference/binaryArithmatic3.js b/tests/baselines/reference/binaryArithmatic3.js index e2349b569f1f7..3d0f084b4679a 100644 --- a/tests/baselines/reference/binaryArithmatic3.js +++ b/tests/baselines/reference/binaryArithmatic3.js @@ -4,4 +4,5 @@ var v = undefined | undefined; //// [binaryArithmatic3.js] +"use strict"; var v = undefined | undefined; diff --git a/tests/baselines/reference/binaryArithmatic4.js b/tests/baselines/reference/binaryArithmatic4.js index 1bf696ddef33f..a3dc0cac94524 100644 --- a/tests/baselines/reference/binaryArithmatic4.js +++ b/tests/baselines/reference/binaryArithmatic4.js @@ -4,4 +4,5 @@ var v = null | null; //// [binaryArithmatic4.js] +"use strict"; var v = null | null; diff --git a/tests/baselines/reference/binaryIntegerLiteral(target=es2015).errors.txt b/tests/baselines/reference/binaryIntegerLiteral(target=es2015).errors.txt new file mode 100644 index 0000000000000..f6f60fbcd431e --- /dev/null +++ b/tests/baselines/reference/binaryIntegerLiteral(target=es2015).errors.txt @@ -0,0 +1,60 @@ +binaryIntegerLiteral.ts(25,1): error TS7053: Element implicitly has an 'any' type because expression of type '"0b11010"' can't be used to index type '{ 26: string; a: number; bin1: number; b: number; Infinity: boolean; }'. + Property '0b11010' does not exist on type '{ 26: string; a: number; bin1: number; b: number; Infinity: boolean; }'. +binaryIntegerLiteral.ts(34,1): error TS7053: Element implicitly has an 'any' type because expression of type '"0B11010"' can't be used to index type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'. + Property '0B11010' does not exist on type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'. +binaryIntegerLiteral.ts(40,1): error TS7053: Element implicitly has an 'any' type because expression of type '"Infinity"' can't be used to index type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'. + Property 'Infinity' does not exist on type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'. + + +==== binaryIntegerLiteral.ts (3 errors) ==== + var bin1 = 0b11010; + var bin2 = 0B11010; + var bin3 = 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111; + var bin4 = 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111; + + var obj1 = { + 0b11010: "Hello", + a: bin1, + bin1, + b: 0b11010, + 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true, + } + + var obj2 = { + 0B11010: "World", + a: bin2, + bin2, + b: 0B11010, + 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false, + } + + obj1[0b11010]; // string + obj1[26]; // string + obj1["26"]; // string + obj1["0b11010"]; // any + ~~~~~~~~~~~~~~~ +!!! error TS7053: Element implicitly has an 'any' type because expression of type '"0b11010"' can't be used to index type '{ 26: string; a: number; bin1: number; b: number; Infinity: boolean; }'. +!!! error TS7053: Property '0b11010' does not exist on type '{ 26: string; a: number; bin1: number; b: number; Infinity: boolean; }'. + obj1["a"]; // number + obj1["b"]; // number + obj1["bin1"]; // number + obj1["Infinity"]; // boolean + + obj2[0B11010]; // string + obj2[26]; // string + obj2["26"]; // string + obj2["0B11010"]; // any + ~~~~~~~~~~~~~~~ +!!! error TS7053: Element implicitly has an 'any' type because expression of type '"0B11010"' can't be used to index type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'. +!!! error TS7053: Property '0B11010' does not exist on type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'. + obj2["a"]; // number + obj2["b"]; // number + obj2["bin2"]; // number + obj2[9.671406556917009e+24]; // boolean + obj2["9.671406556917009e+24"]; // boolean + obj2["Infinity"]; // any + ~~~~~~~~~~~~~~~~ +!!! error TS7053: Element implicitly has an 'any' type because expression of type '"Infinity"' can't be used to index type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'. +!!! error TS7053: Property 'Infinity' does not exist on type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'. + + \ No newline at end of file diff --git a/tests/baselines/reference/binaryIntegerLiteral(target=es2015).js b/tests/baselines/reference/binaryIntegerLiteral(target=es2015).js index b94113e58af3a..259fe97f17179 100644 --- a/tests/baselines/reference/binaryIntegerLiteral(target=es2015).js +++ b/tests/baselines/reference/binaryIntegerLiteral(target=es2015).js @@ -45,6 +45,7 @@ obj2["Infinity"]; // any //// [binaryIntegerLiteral.js] +"use strict"; var bin1 = 0b11010; var bin2 = 0B11010; var bin3 = 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111; diff --git a/tests/baselines/reference/binaryIntegerLiteral(target=es2015).types b/tests/baselines/reference/binaryIntegerLiteral(target=es2015).types index 9bb5101b0e371..50471191dcec4 100644 --- a/tests/baselines/reference/binaryIntegerLiteral(target=es2015).types +++ b/tests/baselines/reference/binaryIntegerLiteral(target=es2015).types @@ -120,7 +120,8 @@ obj1["26"]; // string > : ^^^^ obj1["0b11010"]; // any ->obj1["0b11010"] : error +>obj1["0b11010"] : any +> : ^^^ >obj1 : { 26: string; a: number; bin1: number; b: number; Infinity: boolean; } > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >"0b11010" : "0b11010" @@ -183,7 +184,8 @@ obj2["26"]; // string > : ^^^^ obj2["0B11010"]; // any ->obj2["0B11010"] : error +>obj2["0B11010"] : any +> : ^^^ >obj2 : { 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; } > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >"0B11010" : "0B11010" @@ -230,7 +232,8 @@ obj2["9.671406556917009e+24"]; // boolean > : ^^^^^^^^^^^^^^^^^^^^^^^ obj2["Infinity"]; // any ->obj2["Infinity"] : error +>obj2["Infinity"] : any +> : ^^^ >obj2 : { 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; } > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >"Infinity" : "Infinity" diff --git a/tests/baselines/reference/binaryIntegerLiteral(target=es5).errors.txt b/tests/baselines/reference/binaryIntegerLiteral(target=es5).errors.txt index 63348f01a84e7..c83a57bfb695a 100644 --- a/tests/baselines/reference/binaryIntegerLiteral(target=es5).errors.txt +++ b/tests/baselines/reference/binaryIntegerLiteral(target=es5).errors.txt @@ -1,8 +1,14 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +binaryIntegerLiteral.ts(25,1): error TS7053: Element implicitly has an 'any' type because expression of type '"0b11010"' can't be used to index type '{ 26: string; a: number; bin1: number; b: number; Infinity: boolean; }'. + Property '0b11010' does not exist on type '{ 26: string; a: number; bin1: number; b: number; Infinity: boolean; }'. +binaryIntegerLiteral.ts(34,1): error TS7053: Element implicitly has an 'any' type because expression of type '"0B11010"' can't be used to index type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'. + Property '0B11010' does not exist on type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'. +binaryIntegerLiteral.ts(40,1): error TS7053: Element implicitly has an 'any' type because expression of type '"Infinity"' can't be used to index type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'. + Property 'Infinity' does not exist on type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== binaryIntegerLiteral.ts (0 errors) ==== +==== binaryIntegerLiteral.ts (3 errors) ==== var bin1 = 0b11010; var bin2 = 0B11010; var bin3 = 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111; @@ -28,6 +34,9 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in Typ obj1[26]; // string obj1["26"]; // string obj1["0b11010"]; // any + ~~~~~~~~~~~~~~~ +!!! error TS7053: Element implicitly has an 'any' type because expression of type '"0b11010"' can't be used to index type '{ 26: string; a: number; bin1: number; b: number; Infinity: boolean; }'. +!!! error TS7053: Property '0b11010' does not exist on type '{ 26: string; a: number; bin1: number; b: number; Infinity: boolean; }'. obj1["a"]; // number obj1["b"]; // number obj1["bin1"]; // number @@ -37,11 +46,17 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in Typ obj2[26]; // string obj2["26"]; // string obj2["0B11010"]; // any + ~~~~~~~~~~~~~~~ +!!! error TS7053: Element implicitly has an 'any' type because expression of type '"0B11010"' can't be used to index type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'. +!!! error TS7053: Property '0B11010' does not exist on type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'. obj2["a"]; // number obj2["b"]; // number obj2["bin2"]; // number obj2[9.671406556917009e+24]; // boolean obj2["9.671406556917009e+24"]; // boolean obj2["Infinity"]; // any + ~~~~~~~~~~~~~~~~ +!!! error TS7053: Element implicitly has an 'any' type because expression of type '"Infinity"' can't be used to index type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'. +!!! error TS7053: Property 'Infinity' does not exist on type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'. \ No newline at end of file diff --git a/tests/baselines/reference/binaryIntegerLiteral(target=es5).js b/tests/baselines/reference/binaryIntegerLiteral(target=es5).js index da55042b1a984..7ced848a14c05 100644 --- a/tests/baselines/reference/binaryIntegerLiteral(target=es5).js +++ b/tests/baselines/reference/binaryIntegerLiteral(target=es5).js @@ -45,6 +45,7 @@ obj2["Infinity"]; // any //// [binaryIntegerLiteral.js] +"use strict"; var bin1 = 26; var bin2 = 26; var bin3 = 9.671406556917009e+24; diff --git a/tests/baselines/reference/binaryIntegerLiteralES6.errors.txt b/tests/baselines/reference/binaryIntegerLiteralES6.errors.txt new file mode 100644 index 0000000000000..9e571c6de823f --- /dev/null +++ b/tests/baselines/reference/binaryIntegerLiteralES6.errors.txt @@ -0,0 +1,61 @@ +binaryIntegerLiteralES6.ts(25,1): error TS7053: Element implicitly has an 'any' type because expression of type '"0b11010"' can't be used to index type '{ 26: string; a: number; bin1: number; b: number; Infinity: boolean; }'. + Property '0b11010' does not exist on type '{ 26: string; a: number; bin1: number; b: number; Infinity: boolean; }'. +binaryIntegerLiteralES6.ts(34,1): error TS7053: Element implicitly has an 'any' type because expression of type '"0B11010"' can't be used to index type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'. + Property '0B11010' does not exist on type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'. +binaryIntegerLiteralES6.ts(40,1): error TS7053: Element implicitly has an 'any' type because expression of type '"Infinity"' can't be used to index type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'. + Property 'Infinity' does not exist on type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'. + + +==== binaryIntegerLiteralES6.ts (3 errors) ==== + var bin1 = 0b11010; + var bin2 = 0B11010; + var bin3 = 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111; + var bin4 = 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111; + + var obj1 = { + 0b11010: "Hello", + a: bin1, + bin1, + b: 0b11010, + 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true, + } + + var obj2 = { + 0B11010: "World", + a: bin2, + bin2, + b: 0B11010, + 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false, + } + + obj1[0b11010]; // string + obj1[26]; // string + obj1["26"]; // string + obj1["0b11010"]; // any + ~~~~~~~~~~~~~~~ +!!! error TS7053: Element implicitly has an 'any' type because expression of type '"0b11010"' can't be used to index type '{ 26: string; a: number; bin1: number; b: number; Infinity: boolean; }'. +!!! error TS7053: Property '0b11010' does not exist on type '{ 26: string; a: number; bin1: number; b: number; Infinity: boolean; }'. + obj1["a"]; // number + obj1["b"]; // number + obj1["bin1"]; // number + obj1["Infinity"]; // boolean + + obj2[0B11010]; // string + obj2[26]; // string + obj2["26"]; // string + obj2["0B11010"]; // any + ~~~~~~~~~~~~~~~ +!!! error TS7053: Element implicitly has an 'any' type because expression of type '"0B11010"' can't be used to index type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'. +!!! error TS7053: Property '0B11010' does not exist on type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'. + obj2["a"]; // number + obj2["b"]; // number + obj2["bin2"]; // number + obj2[9.671406556917009e+24]; // boolean + obj2["9.671406556917009e+24"]; // boolean + obj2["Infinity"]; // any + ~~~~~~~~~~~~~~~~ +!!! error TS7053: Element implicitly has an 'any' type because expression of type '"Infinity"' can't be used to index type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'. +!!! error TS7053: Property 'Infinity' does not exist on type '{ 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; }'. + + + \ No newline at end of file diff --git a/tests/baselines/reference/binaryIntegerLiteralES6.js b/tests/baselines/reference/binaryIntegerLiteralES6.js index f5f939072bc37..495479b362042 100644 --- a/tests/baselines/reference/binaryIntegerLiteralES6.js +++ b/tests/baselines/reference/binaryIntegerLiteralES6.js @@ -46,6 +46,7 @@ obj2["Infinity"]; // any //// [binaryIntegerLiteralES6.js] +"use strict"; var bin1 = 0b11010; var bin2 = 0B11010; var bin3 = 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111; diff --git a/tests/baselines/reference/binaryIntegerLiteralES6.types b/tests/baselines/reference/binaryIntegerLiteralES6.types index 8d0eeeb271a0d..c0a9f5e8bb162 100644 --- a/tests/baselines/reference/binaryIntegerLiteralES6.types +++ b/tests/baselines/reference/binaryIntegerLiteralES6.types @@ -120,7 +120,8 @@ obj1["26"]; // string > : ^^^^ obj1["0b11010"]; // any ->obj1["0b11010"] : error +>obj1["0b11010"] : any +> : ^^^ >obj1 : { 26: string; a: number; bin1: number; b: number; Infinity: boolean; } > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >"0b11010" : "0b11010" @@ -183,7 +184,8 @@ obj2["26"]; // string > : ^^^^ obj2["0B11010"]; // any ->obj2["0B11010"] : error +>obj2["0B11010"] : any +> : ^^^ >obj2 : { 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; } > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >"0B11010" : "0B11010" @@ -230,7 +232,8 @@ obj2["9.671406556917009e+24"]; // boolean > : ^^^^^^^^^^^^^^^^^^^^^^^ obj2["Infinity"]; // any ->obj2["Infinity"] : error +>obj2["Infinity"] : any +> : ^^^ >obj2 : { 26: string; a: number; bin2: number; b: number; 9.671406556917009e+24: boolean; } > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >"Infinity" : "Infinity" diff --git a/tests/baselines/reference/binaryIntegerLiteralError.js b/tests/baselines/reference/binaryIntegerLiteralError.js index dacb4a2a29b83..a4df10b556560 100644 --- a/tests/baselines/reference/binaryIntegerLiteralError.js +++ b/tests/baselines/reference/binaryIntegerLiteralError.js @@ -13,6 +13,7 @@ var obj1 = { //// [binaryIntegerLiteralError.js] +"use strict"; // error var bin1 = 0B110; 2110; diff --git a/tests/baselines/reference/bind1.js b/tests/baselines/reference/bind1.js index d1bcb2ce3a16d..03fb84bf79d4d 100644 --- a/tests/baselines/reference/bind1.js +++ b/tests/baselines/reference/bind1.js @@ -8,6 +8,7 @@ namespace M { //// [bind1.js] +"use strict"; var M; (function (M) { class C { diff --git a/tests/baselines/reference/bind2.js b/tests/baselines/reference/bind2.js index f249ef1ea1850..f948d1ccfe36a 100644 --- a/tests/baselines/reference/bind2.js +++ b/tests/baselines/reference/bind2.js @@ -4,3 +4,4 @@ //// [bind2.js] +"use strict"; diff --git a/tests/baselines/reference/binderBinaryExpressionStress.js b/tests/baselines/reference/binderBinaryExpressionStress.js index de9f50ecedfae..45fd955c280a5 100644 --- a/tests/baselines/reference/binderBinaryExpressionStress.js +++ b/tests/baselines/reference/binderBinaryExpressionStress.js @@ -4972,6 +4972,7 @@ var caps = //// [binderBinaryExpressionStress.js] +"use strict"; 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 + 100 + 101 + 102 + 103 + 104 + 105 + 106 + 107 + 108 + 109 + 110 + 111 + 112 + 113 + 114 + 115 + 116 + 117 + 118 + 119 + 120 + 121 + 122 + 123 + 124 + 125 + 126 + 127 + 128 + 129 + 130 + 131 + 132 + 133 + 134 + 135 + 136 + 137 + 138 + 139 + 140 + 141 + 142 + 143 + 144 + 145 + 146 + 147 + 148 + 149 + 150 + 151 + 152 + 153 + 154 + 155 + 156 + 157 + 158 + 159 + 160 + 161 + 162 + 163 + 164 + 165 + 166 + 167 + 168 + 169 + 170 + 171 + 172 + 173 + 174 + 175 + 176 + 177 + 178 + 179 + 180 + 181 + 182 + 183 + 184 + 185 + 186 + 187 + 188 + 189 + 190 + 191 + 192 + 193 + 194 + 195 + 196 + 197 + 198 + 199 + 200 + 201 + 202 + 203 + 204 + 205 + 206 + 207 + 208 + 209 + 210 + 211 + 212 + 213 + 214 + 215 + 216 + 217 + 218 + 219 + 220 + 221 + 222 + 223 + 224 + 225 + 226 + 227 + 228 + 229 + 230 + 231 + 232 + 233 + 234 + 235 + 236 + 237 + 238 + 239 + 240 + 241 + 242 + 243 + 244 + 245 + 246 + 247 + 248 + 249 + 250 + 251 + 252 + 253 + 254 + 255 + 256 + 257 + 258 + 259 + 260 + 261 + 262 + 263 + 264 + 265 + 266 + 267 + 268 + 269 + 270 + 271 + 272 + 273 + 274 + 275 + 276 + 277 + 278 + 279 + 280 + 281 + 282 + 283 + 284 + 285 + 286 + 287 + 288 + 289 + 290 + 291 + 292 + 293 + 294 + 295 + 296 + 297 + 298 + 299 + 300 + 301 + 302 + 303 + 304 + 305 + 306 + 307 + 308 + 309 + 310 + 311 + 312 + 313 + 314 + 315 + 316 + 317 + 318 + 319 + 320 + 321 + 322 + 323 + 324 + 325 + 326 + 327 + 328 + 329 + 330 + 331 + 332 + 333 + 334 + 335 + 336 + 337 + 338 + 339 + 340 + 341 + 342 + 343 + 344 + 345 + 346 + 347 + 348 + 349 + 350 + 351 + 352 + 353 + 354 + 355 + 356 + 357 + 358 + 359 + 360 + 361 + 362 + 363 + 364 + 365 + 366 + 367 + 368 + 369 + 370 + 371 + 372 + 373 + 374 + 375 + 376 + 377 + 378 + 379 + 380 + 381 + 382 + 383 + 384 + 385 + 386 + 387 + 388 + 389 + 390 + 391 + 392 + 393 + 394 + 395 + 396 + 397 + 398 + 399 + 400 + 401 + 402 + 403 + 404 + 405 + 406 + 407 + 408 + 409 + 410 + 411 + 412 + 413 + 414 + 415 + 416 + 417 + 418 + 419 + 420 + 421 + 422 + 423 + 424 + 425 + 426 + 427 + 428 + 429 + 430 + 431 + 432 + 433 + 434 + 435 + 436 + 437 + 438 + 439 + 440 + 441 + 442 + 443 + 444 + 445 + 446 + 447 + 448 + 449 + 450 + 451 + 452 + 453 + 454 + 455 + 456 + 457 + 458 + 459 + 460 + 461 + 462 + 463 + 464 + 465 + 466 + 467 + 468 + 469 + 470 + 471 + 472 + 473 + 474 + 475 + 476 + 477 + 478 + 479 + 480 + 481 + 482 + 483 + 484 + 485 + 486 + 487 + 488 + 489 + 490 + 491 + 492 + 493 + 494 + 495 + 496 + 497 + 498 + 499 + 500 + 501 + 502 + 503 + 504 + 505 + 506 + 507 + 508 + 509 + 510 + 511 + 512 + 513 + 514 + 515 + 516 + 517 + 518 + 519 + 520 + 521 + 522 + 523 + 524 + 525 + 526 + 527 + 528 + 529 + 530 + 531 + 532 + 533 + 534 + 535 + 536 + 537 + 538 + 539 + 540 + 541 + 542 + 543 + 544 + 545 + 546 + 547 + 548 + 549 + 550 + 551 + 552 + 553 + 554 + 555 + 556 + 557 + 558 + 559 + 560 + 561 + 562 + 563 + 564 + 565 + 566 + 567 + 568 + 569 + 570 + 571 + 572 + 573 + 574 + 575 + 576 + 577 + 578 + 579 + 580 + 581 + 582 + 583 + 584 + 585 + 586 + 587 + 588 + 589 + 590 + 591 + 592 + 593 + 594 + 595 + 596 + 597 + 598 + 599 + 600 + 601 + 602 + 603 + 604 + 605 + 606 + 607 + 608 + 609 + 610 + 611 + 612 + 613 + 614 + 615 + 616 + 617 + 618 + 619 + 620 + 621 + 622 + 623 + 624 + 625 + 626 + 627 + 628 + 629 + 630 + 631 + 632 + 633 + 634 + 635 + 636 + 637 + 638 + 639 + 640 + 641 + 642 + 643 + 644 + 645 + 646 + 647 + 648 + 649 + 650 + 651 + 652 + 653 + 654 + 655 + 656 + 657 + 658 + 659 + 660 + 661 + 662 + 663 + 664 + 665 + 666 + 667 + 668 + 669 + 670 + 671 + 672 + 673 + 674 + 675 + 676 + 677 + 678 + 679 + 680 + 681 + 682 + 683 + 684 + 685 + 686 + 687 + 688 + 689 + 690 + 691 + 692 + 693 + 694 + 695 + 696 + 697 + 698 + 699 + 700 + 701 + 702 + 703 + 704 + 705 + 706 + 707 + 708 + 709 + 710 + 711 + 712 + 713 + 714 + 715 + 716 + 717 + 718 + 719 + 720 + 721 + 722 + 723 + 724 + 725 + 726 + 727 + 728 + 729 + 730 + 731 + 732 + 733 + 734 + 735 + 736 + 737 + 738 + 739 + 740 + 741 + 742 + 743 + 744 + 745 + 746 + 747 + 748 + 749 + 750 + 751 + 752 + 753 + 754 + 755 + 756 + 757 + 758 + 759 + 760 + 761 + 762 + 763 + 764 + 765 + 766 + 767 + 768 + 769 + 770 + 771 + 772 + 773 + 774 + 775 + 776 + 777 + 778 + 779 + 780 + 781 + 782 + 783 + 784 + 785 + 786 + 787 + 788 + 789 + 790 + 791 + 792 + 793 + 794 + 795 + 796 + 797 + 798 + 799 + 800 + 801 + 802 + 803 + 804 + 805 + 806 + 807 + 808 + 809 + 810 + 811 + 812 + 813 + 814 + 815 + 816 + 817 + 818 + 819 + 820 + 821 + 822 + 823 + 824 + 825 + 826 + 827 + 828 + 829 + 830 + 831 + 832 + 833 + 834 + 835 + 836 + 837 + 838 + 839 + 840 + 841 + 842 + 843 + 844 + 845 + 846 + 847 + 848 + 849 + 850 + 851 + 852 + 853 + 854 + 855 + 856 + 857 + 858 + 859 + 860 + 861 + 862 + 863 + 864 + 865 + 866 + 867 + 868 + 869 + 870 + 871 + 872 + 873 + 874 + 875 + 876 + 877 + 878 + 879 + 880 + 881 + 882 + 883 + 884 + 885 + 886 + 887 + 888 + 889 + 890 + 891 + 892 + 893 + 894 + 895 + 896 + 897 + 898 + 899 + 900 + 901 + 902 + 903 + 904 + 905 + 906 + 907 + 908 + 909 + 910 + 911 + 912 + 913 + 914 + 915 + 916 + 917 + 918 + 919 + 920 + 921 + 922 + 923 + 924 + 925 + 926 + 927 + 928 + 929 + 930 + 931 + 932 + 933 + 934 + 935 + 936 + 937 + 938 + 939 + 940 + 941 + 942 + 943 + 944 + 945 + 946 + 947 + 948 + 949 + 950 + 951 + 952 + 953 + 954 + 955 + 956 + 957 + 958 + 959 + 960 + 961 + 962 + 963 + 964 + 965 + 966 + 967 + 968 + 969 + 970 + 971 + 972 + 973 + 974 + 975 + 976 + 977 + 978 + 979 + 980 + 981 + 982 + 983 + 984 + 985 + 986 + 987 + 988 + 989 + 990 + 991 + 992 + 993 + 994 + 995 + 996 + 997 + 998 + 999 + 1000 + 1001 + 1002 + 1003 + 1004 + 1005 + 1006 + 1007 + 1008 + 1009 + 1010 + 1011 + 1012 + 1013 + 1014 + 1015 + 1016 + 1017 + 1018 + 1019 + 1020 + 1021 + 1022 + 1023 + 1024 + 1025 + 1026 + 1027 + 1028 + 1029 + 1030 + 1031 + 1032 + 1033 + 1034 + 1035 + 1036 + 1037 + 1038 + 1039 + 1040 + 1041 + 1042 + 1043 + 1044 + 1045 + 1046 + 1047 + 1048 + 1049 + 1050 + 1051 + 1052 + 1053 + 1054 + 1055 + 1056 + 1057 + 1058 + 1059 + 1060 + 1061 + 1062 + 1063 + 1064 + 1065 + 1066 + 1067 + 1068 + 1069 + 1070 + 1071 + 1072 + 1073 + 1074 + 1075 + 1076 + 1077 + 1078 + 1079 + 1080 + 1081 + 1082 + 1083 + 1084 + 1085 + 1086 + 1087 + 1088 + 1089 + 1090 + 1091 + 1092 + 1093 + 1094 + 1095 + 1096 + 1097 + 1098 + 1099 + 1100 + 1101 + 1102 + 1103 + 1104 + 1105 + 1106 + 1107 + 1108 + 1109 + 1110 + 1111 + 1112 + 1113 + 1114 + 1115 + 1116 + 1117 + 1118 + 1119 + 1120 + 1121 + 1122 + 1123 + 1124 + 1125 + 1126 + 1127 + 1128 + 1129 + 1130 + 1131 + 1132 + 1133 + 1134 + 1135 + 1136 + 1137 + 1138 + 1139 + 1140 + 1141 + 1142 + 1143 + 1144 + 1145 + 1146 + 1147 + 1148 + 1149 + 1150 + 1151 + 1152 + 1153 + 1154 + 1155 + 1156 + 1157 + 1158 + 1159 + 1160 + 1161 + 1162 + 1163 + 1164 + 1165 + 1166 + 1167 + 1168 + 1169 + 1170 + 1171 + 1172 + 1173 + 1174 + 1175 + 1176 + 1177 + 1178 + 1179 + 1180 + 1181 + 1182 + 1183 + 1184 + 1185 + 1186 + 1187 + 1188 + 1189 + 1190 + 1191 + 1192 + 1193 + 1194 + 1195 + 1196 + 1197 + 1198 + 1199 + 1200 + 1201 + 1202 + 1203 + 1204 + 1205 + 1206 + 1207 + 1208 + 1209 + 1210 + 1211 + 1212 + 1213 + 1214 + 1215 + 1216 + 1217 + 1218 + 1219 + 1220 + 1221 + 1222 + 1223 + 1224 + 1225 + 1226 + 1227 + 1228 + 1229 + 1230 + 1231 + 1232 + 1233 + 1234 + 1235 + 1236 + 1237 + 1238 + 1239 + 1240 + 1241 + 1242 + 1243 + 1244 + 1245 + 1246 + 1247 + 1248 + 1249 + 1250 + 1251 + 1252 + 1253 + 1254 + 1255 + 1256 + 1257 + 1258 + 1259 + 1260 + 1261 + 1262 + 1263 + 1264 + 1265 + 1266 + 1267 + 1268 + 1269 + 1270 + 1271 + 1272 + 1273 + 1274 + 1275 + 1276 + 1277 + 1278 + 1279 + 1280 + 1281 + 1282 + 1283 + 1284 + 1285 + 1286 + 1287 + 1288 + 1289 + 1290 + 1291 + 1292 + 1293 + 1294 + 1295 + 1296 + 1297 + 1298 + 1299 + 1300 + 1301 + 1302 + 1303 + 1304 + 1305 + 1306 + 1307 + 1308 + 1309 + 1310 + 1311 + 1312 + 1313 + 1314 + 1315 + 1316 + 1317 + 1318 + 1319 + 1320 + 1321 + 1322 + 1323 + 1324 + 1325 + 1326 + 1327 + 1328 + 1329 + 1330 + 1331 + 1332 + 1333 + 1334 + 1335 + 1336 + 1337 + 1338 + 1339 + 1340 + 1341 + 1342 + 1343 + 1344 + 1345 + 1346 + 1347 + 1348 + 1349 + 1350 + 1351 + 1352 + 1353 + 1354 + 1355 + 1356 + 1357 + 1358 + 1359 + 1360 + 1361 + 1362 + 1363 + 1364 + 1365 + 1366 + 1367 + 1368 + 1369 + 1370 + 1371 + 1372 + 1373 + 1374 + 1375 + 1376 + 1377 + 1378 + 1379 + 1380 + 1381 + 1382 + 1383 + 1384 + 1385 + 1386 + 1387 + 1388 + 1389 + 1390 + 1391 + 1392 + 1393 + 1394 + 1395 + 1396 + 1397 + 1398 + 1399 + 1400 + 1401 + 1402 + 1403 + 1404 + 1405 + 1406 + 1407 + 1408 + 1409 + 1410 + 1411 + 1412 + 1413 + 1414 + 1415 + 1416 + 1417 + 1418 + 1419 + 1420 + 1421 + 1422 + 1423 + 1424 + 1425 + 1426 + 1427 + 1428 + 1429 + 1430 + 1431 + 1432 + 1433 + 1434 + 1435 + 1436 + 1437 + 1438 + 1439 + 1440 + 1441 + 1442 + 1443 + 1444 + 1445 + 1446 + 1447 + 1448 + 1449 + 1450 + 1451 + 1452 + 1453 + 1454 + 1455 + 1456 + 1457 + 1458 + 1459 + 1460 + 1461 + 1462 + 1463 + 1464 + 1465 + 1466 + 1467 + 1468 + 1469 + 1470 + 1471 + 1472 + 1473 + 1474 + 1475 + 1476 + 1477 + 1478 + 1479 + 1480 + 1481 + 1482 + 1483 + 1484 + 1485 + 1486 + 1487 + 1488 + 1489 + 1490 + 1491 + 1492 + 1493 + 1494 + 1495 + 1496 + 1497 + 1498 + 1499; var caps = '' + '' + diff --git a/tests/baselines/reference/bindingPatternCannotBeOnlyInferenceSource.js b/tests/baselines/reference/bindingPatternCannotBeOnlyInferenceSource.js index ea3edd6054ee5..c80aceda7b632 100644 --- a/tests/baselines/reference/bindingPatternCannotBeOnlyInferenceSource.js +++ b/tests/baselines/reference/bindingPatternCannotBeOnlyInferenceSource.js @@ -29,6 +29,7 @@ const {} = useReduxDispatch1( //// [bindingPatternCannotBeOnlyInferenceSource.js] +"use strict"; const {} = f(); // error (only in strictNullChecks) const { p1 } = f(); // error const [] = f(); // error diff --git a/tests/baselines/reference/bindingPatternContextualTypeDoesNotCauseWidening.js b/tests/baselines/reference/bindingPatternContextualTypeDoesNotCauseWidening.js index 7c2e4739dce52..3cd7257c0f159 100644 --- a/tests/baselines/reference/bindingPatternContextualTypeDoesNotCauseWidening.js +++ b/tests/baselines/reference/bindingPatternContextualTypeDoesNotCauseWidening.js @@ -7,5 +7,6 @@ const { } = pick(['b'], { a: 'a', b: 'b' }); // T: "b" | "a" ??? (before fix) //// [bindingPatternContextualTypeDoesNotCauseWidening.js] +"use strict"; const _ = pick(['b'], { a: 'a', b: 'b' }); // T: "b" const {} = pick(['b'], { a: 'a', b: 'b' }); // T: "b" | "a" ??? (before fix) diff --git a/tests/baselines/reference/bindingPatternContextualTypeDoesNotCauseWidening.types b/tests/baselines/reference/bindingPatternContextualTypeDoesNotCauseWidening.types index c2ab323df1845..dfe5132530ac0 100644 --- a/tests/baselines/reference/bindingPatternContextualTypeDoesNotCauseWidening.types +++ b/tests/baselines/reference/bindingPatternContextualTypeDoesNotCauseWidening.types @@ -6,8 +6,8 @@ declare function pick(keys: T[], obj?: O): Pick; > : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^ ^^^^^ >keys : T[] > : ^^^ ->obj : O -> : ^ +>obj : O | undefined +> : ^^^^^^^^^^^^^ const _ = pick(['b'], { a: 'a', b: 'b' }); // T: "b" >_ : Pick<{ a: string; b: string; }, "b"> diff --git a/tests/baselines/reference/bindingPatternInParameter01.js b/tests/baselines/reference/bindingPatternInParameter01.js index 87797a0a4b723..9cdb7891efca0 100644 --- a/tests/baselines/reference/bindingPatternInParameter01.js +++ b/tests/baselines/reference/bindingPatternInParameter01.js @@ -9,6 +9,7 @@ nestedArray.forEach(([[a, b]]) => { //// [bindingPatternInParameter01.js] +"use strict"; const nestedArray = [[[1, 2]], [[3, 4]]]; nestedArray.forEach(([[a, b]]) => { console.log(a, b); diff --git a/tests/baselines/reference/binopAssignmentShouldHaveType.js b/tests/baselines/reference/binopAssignmentShouldHaveType.js index 9d7b76f32b667..bda7df733d89e 100644 --- a/tests/baselines/reference/binopAssignmentShouldHaveType.js +++ b/tests/baselines/reference/binopAssignmentShouldHaveType.js @@ -23,6 +23,7 @@ namespace Test { //// [binopAssignmentShouldHaveType.js] "use strict"; +"use strict"; var Test; (function (Test) { class Bug { diff --git a/tests/baselines/reference/bitwiseCompoundAssignmentOperators.js b/tests/baselines/reference/bitwiseCompoundAssignmentOperators.js index e71d8be72ebc3..d7adca8cfde55 100644 --- a/tests/baselines/reference/bitwiseCompoundAssignmentOperators.js +++ b/tests/baselines/reference/bitwiseCompoundAssignmentOperators.js @@ -35,6 +35,7 @@ f |= f; //// [bitwiseCompoundAssignmentOperators.js] +"use strict"; var a = true; var b = 1; a ^= a; diff --git a/tests/baselines/reference/bitwiseNotOperatorInvalidOperations.js b/tests/baselines/reference/bitwiseNotOperatorInvalidOperations.js index fd67d38e58e57..1b6a502b94f66 100644 --- a/tests/baselines/reference/bitwiseNotOperatorInvalidOperations.js +++ b/tests/baselines/reference/bitwiseNotOperatorInvalidOperations.js @@ -14,6 +14,7 @@ var mul = ~[1, 2, "abc"], ""; //expect error var b =~; //// [bitwiseNotOperatorInvalidOperations.js] +"use strict"; // Unary operator ~ var q; // operand before ~ diff --git a/tests/baselines/reference/bitwiseNotOperatorInvalidOperations.types b/tests/baselines/reference/bitwiseNotOperatorInvalidOperations.types index 9dbcc48e7ad4a..6b2fef41fbaca 100644 --- a/tests/baselines/reference/bitwiseNotOperatorInvalidOperations.types +++ b/tests/baselines/reference/bitwiseNotOperatorInvalidOperations.types @@ -8,10 +8,10 @@ var q; // operand before ~ var a = q~; //expect error ->a : any -> : ^^^ ->q : any -> : ^^^ +>a : undefined +> : ^^^^^^^^^ +>q : undefined +> : ^^^^^^^^^ >~ : number > : ^^^^^^ > : any diff --git a/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.js b/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.js index 0025e9e20f321..c70c784de412c 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.js +++ b/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.js @@ -65,6 +65,7 @@ var ResultIsNumber20 = ~~~(ANY + ANY1); ~~obj1.x; //// [bitwiseNotOperatorWithAnyOtherType.js] +"use strict"; // ~ operator on any type function foo() { var a; diff --git a/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.errors.txt b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.errors.txt new file mode 100644 index 0000000000000..0d25c56c5d604 --- /dev/null +++ b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.errors.txt @@ -0,0 +1,53 @@ +bitwiseNotOperatorWithBooleanType.ts(7,12): error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. +bitwiseNotOperatorWithBooleanType.ts(17,24): error TS2454: Variable 'BOOLEAN' is used before being assigned. +bitwiseNotOperatorWithBooleanType.ts(30,25): error TS2454: Variable 'BOOLEAN' is used before being assigned. +bitwiseNotOperatorWithBooleanType.ts(34,2): error TS2454: Variable 'BOOLEAN' is used before being assigned. + + +==== bitwiseNotOperatorWithBooleanType.ts (4 errors) ==== + // ~ operator on boolean type + var BOOLEAN: boolean; + + function foo(): boolean { return true; } + + class A { + public a: boolean; + ~ +!!! error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. + static foo() { return false; } + } + namespace M { + export var n: boolean; + } + + var objA = new A(); + + // boolean type var + var ResultIsNumber1 = ~BOOLEAN; + ~~~~~~~ +!!! error TS2454: Variable 'BOOLEAN' is used before being assigned. + + // boolean type literal + var ResultIsNumber2 = ~true; + var ResultIsNumber3 = ~{ x: true, y: false }; + + // boolean type expressions + var ResultIsNumber4 = ~objA.a; + var ResultIsNumber5 = ~M.n; + var ResultIsNumber6 = ~foo(); + var ResultIsNumber7 = ~A.foo(); + + // multiple ~ operators + var ResultIsNumber8 = ~~BOOLEAN; + ~~~~~~~ +!!! error TS2454: Variable 'BOOLEAN' is used before being assigned. + + // miss assignment operators + ~true; + ~BOOLEAN; + ~~~~~~~ +!!! error TS2454: Variable 'BOOLEAN' is used before being assigned. + ~foo(); + ~true, false; + ~objA.a; + ~M.n; \ No newline at end of file diff --git a/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.js b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.js index 01d2335dbcb49..1143d3b2868b5 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.js +++ b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.js @@ -41,6 +41,7 @@ var ResultIsNumber8 = ~~BOOLEAN; ~M.n; //// [bitwiseNotOperatorWithBooleanType.js] +"use strict"; // ~ operator on boolean type var BOOLEAN; function foo() { return true; } diff --git a/tests/baselines/reference/bitwiseNotOperatorWithEnumType.js b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.js index 214c3b343a596..9e9aba1c576b4 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithEnumType.js +++ b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.js @@ -21,6 +21,7 @@ var ResultIsNumber4 = ~~~(ENUM1["A"] + ENUM1.B); ~ENUM1.A, ~ENUM1["B"]; //// [bitwiseNotOperatorWithEnumType.js] +"use strict"; // ~ operator on enum type var ENUM1; (function (ENUM1) { diff --git a/tests/baselines/reference/bitwiseNotOperatorWithNumberType.errors.txt b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.errors.txt new file mode 100644 index 0000000000000..82ba15faf4a84 --- /dev/null +++ b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.errors.txt @@ -0,0 +1,71 @@ +bitwiseNotOperatorWithNumberType.ts(8,12): error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. +bitwiseNotOperatorWithNumberType.ts(18,24): error TS2454: Variable 'NUMBER' is used before being assigned. +bitwiseNotOperatorWithNumberType.ts(32,26): error TS2454: Variable 'NUMBER' is used before being assigned. +bitwiseNotOperatorWithNumberType.ts(32,35): error TS2454: Variable 'NUMBER' is used before being assigned. +bitwiseNotOperatorWithNumberType.ts(35,26): error TS2454: Variable 'NUMBER' is used before being assigned. +bitwiseNotOperatorWithNumberType.ts(36,28): error TS2454: Variable 'NUMBER' is used before being assigned. +bitwiseNotOperatorWithNumberType.ts(36,37): error TS2454: Variable 'NUMBER' is used before being assigned. +bitwiseNotOperatorWithNumberType.ts(39,2): error TS2454: Variable 'NUMBER' is used before being assigned. + + +==== bitwiseNotOperatorWithNumberType.ts (8 errors) ==== + // ~ operator on number type + var NUMBER: number; + var NUMBER1: number[] = [1, 2]; + + function foo(): number { return 1; } + + class A { + public a: number; + ~ +!!! error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. + static foo() { return 1; } + } + namespace M { + export var n: number; + } + + var objA = new A(); + + // number type var + var ResultIsNumber1 = ~NUMBER; + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + var ResultIsNumber2 = ~NUMBER1; + + // number type literal + var ResultIsNumber3 = ~1; + var ResultIsNumber4 = ~{ x: 1, y: 2}; + var ResultIsNumber5 = ~{ x: 1, y: (n: number) => { return n; } }; + + // number type expressions + var ResultIsNumber6 = ~objA.a; + var ResultIsNumber7 = ~M.n; + var ResultIsNumber8 = ~NUMBER1[0]; + var ResultIsNumber9 = ~foo(); + var ResultIsNumber10 = ~A.foo(); + var ResultIsNumber11 = ~(NUMBER + NUMBER); + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + + // multiple ~ operators + var ResultIsNumber12 = ~~NUMBER; + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + var ResultIsNumber13 = ~~~(NUMBER + NUMBER); + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + + // miss assignment operators + ~NUMBER; + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + ~NUMBER1; + ~foo(); + ~objA.a; + ~M.n; + ~objA.a, M.n; \ No newline at end of file diff --git a/tests/baselines/reference/bitwiseNotOperatorWithNumberType.js b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.js index 75b8f45e866dc..1a205196851f6 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithNumberType.js +++ b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.js @@ -47,6 +47,7 @@ var ResultIsNumber13 = ~~~(NUMBER + NUMBER); ~objA.a, M.n; //// [bitwiseNotOperatorWithNumberType.js] +"use strict"; // ~ operator on number type var NUMBER; var NUMBER1 = [1, 2]; diff --git a/tests/baselines/reference/bitwiseNotOperatorWithStringType.errors.txt b/tests/baselines/reference/bitwiseNotOperatorWithStringType.errors.txt new file mode 100644 index 0000000000000..e6e3fc365d807 --- /dev/null +++ b/tests/baselines/reference/bitwiseNotOperatorWithStringType.errors.txt @@ -0,0 +1,73 @@ +bitwiseNotOperatorWithStringType.ts(8,12): error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. +bitwiseNotOperatorWithStringType.ts(18,24): error TS2454: Variable 'STRING' is used before being assigned. +bitwiseNotOperatorWithStringType.ts(32,26): error TS2454: Variable 'STRING' is used before being assigned. +bitwiseNotOperatorWithStringType.ts(32,35): error TS2454: Variable 'STRING' is used before being assigned. +bitwiseNotOperatorWithStringType.ts(33,25): error TS2454: Variable 'STRING' is used before being assigned. +bitwiseNotOperatorWithStringType.ts(36,26): error TS2454: Variable 'STRING' is used before being assigned. +bitwiseNotOperatorWithStringType.ts(37,28): error TS2454: Variable 'STRING' is used before being assigned. +bitwiseNotOperatorWithStringType.ts(37,37): error TS2454: Variable 'STRING' is used before being assigned. +bitwiseNotOperatorWithStringType.ts(40,2): error TS2454: Variable 'STRING' is used before being assigned. + + +==== bitwiseNotOperatorWithStringType.ts (9 errors) ==== + // ~ operator on string type + var STRING: string; + var STRING1: string[] = ["", "abc"]; + + function foo(): string { return "abc"; } + + class A { + public a: string; + ~ +!!! error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. + static foo() { return ""; } + } + namespace M { + export var n: string; + } + + var objA = new A(); + + // string type var + var ResultIsNumber1 = ~STRING; + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + var ResultIsNumber2 = ~STRING1; + + // string type literal + var ResultIsNumber3 = ~""; + var ResultIsNumber4 = ~{ x: "", y: "" }; + var ResultIsNumber5 = ~{ x: "", y: (s: string) => { return s; } }; + + // string type expressions + var ResultIsNumber6 = ~objA.a; + var ResultIsNumber7 = ~M.n; + var ResultIsNumber8 = ~STRING1[0]; + var ResultIsNumber9 = ~foo(); + var ResultIsNumber10 = ~A.foo(); + var ResultIsNumber11 = ~(STRING + STRING); + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + var ResultIsNumber12 = ~STRING.charAt(0); + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + + // multiple ~ operators + var ResultIsNumber13 = ~~STRING; + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + var ResultIsNumber14 = ~~~(STRING + STRING); + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + + //miss assignment operators + ~STRING; + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + ~STRING1; + ~foo(); + ~objA.a,M.n; \ No newline at end of file diff --git a/tests/baselines/reference/bitwiseNotOperatorWithStringType.js b/tests/baselines/reference/bitwiseNotOperatorWithStringType.js index dbf70c514214e..c1ce80e01d13b 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithStringType.js +++ b/tests/baselines/reference/bitwiseNotOperatorWithStringType.js @@ -46,6 +46,7 @@ var ResultIsNumber14 = ~~~(STRING + STRING); ~objA.a,M.n; //// [bitwiseNotOperatorWithStringType.js] +"use strict"; // ~ operator on string type var STRING; var STRING1 = ["", "abc"]; diff --git a/tests/baselines/reference/blockScopedBindingCaptureThisInFunction.js b/tests/baselines/reference/blockScopedBindingCaptureThisInFunction.js index 4661f68d1892b..c939148690745 100644 --- a/tests/baselines/reference/blockScopedBindingCaptureThisInFunction.js +++ b/tests/baselines/reference/blockScopedBindingCaptureThisInFunction.js @@ -10,6 +10,7 @@ }; //// [blockScopedBindingCaptureThisInFunction.js] +"use strict"; // https://github.com/Microsoft/TypeScript/issues/11038 () => function () { for (let someKey in {}) { diff --git a/tests/baselines/reference/blockScopedBindingUsedBeforeDef.js b/tests/baselines/reference/blockScopedBindingUsedBeforeDef.js index 12cffa7411c9c..adc235a842923 100644 --- a/tests/baselines/reference/blockScopedBindingUsedBeforeDef.js +++ b/tests/baselines/reference/blockScopedBindingUsedBeforeDef.js @@ -11,6 +11,7 @@ for (let {[a]: a} = { }; false; ) continue; let {[b]: b} = { }; //// [blockScopedBindingUsedBeforeDef.js] +"use strict"; // 1: for (let { [a]: a } of [{}]) continue; diff --git a/tests/baselines/reference/blockScopedBindingsInDownlevelGenerator(target=es2015).js b/tests/baselines/reference/blockScopedBindingsInDownlevelGenerator(target=es2015).js index 4e21b13090159..c9bb7e11f0405 100644 --- a/tests/baselines/reference/blockScopedBindingsInDownlevelGenerator(target=es2015).js +++ b/tests/baselines/reference/blockScopedBindingsInDownlevelGenerator(target=es2015).js @@ -9,6 +9,7 @@ function* a() { } //// [blockScopedBindingsInDownlevelGenerator.js] +"use strict"; function* a() { for (const i of [1, 2, 3]) { (() => i)(); diff --git a/tests/baselines/reference/blockScopedBindingsInDownlevelGenerator(target=es5).js b/tests/baselines/reference/blockScopedBindingsInDownlevelGenerator(target=es5).js index ca74ec4d9ddb1..fe8e2955d7113 100644 --- a/tests/baselines/reference/blockScopedBindingsInDownlevelGenerator(target=es5).js +++ b/tests/baselines/reference/blockScopedBindingsInDownlevelGenerator(target=es5).js @@ -9,6 +9,7 @@ function* a() { } //// [blockScopedBindingsInDownlevelGenerator.js] +"use strict"; var __generator = (this && this.__generator) || function (thisArg, body) { var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; diff --git a/tests/baselines/reference/blockScopedBindingsReassignedInLoop1.js b/tests/baselines/reference/blockScopedBindingsReassignedInLoop1.js index 11519f936a5c0..d56f9047cd7bb 100644 --- a/tests/baselines/reference/blockScopedBindingsReassignedInLoop1.js +++ b/tests/baselines/reference/blockScopedBindingsReassignedInLoop1.js @@ -10,6 +10,7 @@ declare function use(n: number): void; })(); //// [blockScopedBindingsReassignedInLoop1.js] +"use strict"; (function () { 'use strict'; for (let i = 0; i < 9; ++i) { diff --git a/tests/baselines/reference/blockScopedBindingsReassignedInLoop2.js b/tests/baselines/reference/blockScopedBindingsReassignedInLoop2.js index f746972a964f5..a598acf7a1093 100644 --- a/tests/baselines/reference/blockScopedBindingsReassignedInLoop2.js +++ b/tests/baselines/reference/blockScopedBindingsReassignedInLoop2.js @@ -44,6 +44,7 @@ for (let x = 1, y = 2; x < y; ++x, --y) { } //// [blockScopedBindingsReassignedInLoop2.js] +"use strict"; for (let x = 1, y = 2; x < y; ++x, --y) { let a = () => x++ + y++; if (x == 1) { diff --git a/tests/baselines/reference/blockScopedBindingsReassignedInLoop3.js b/tests/baselines/reference/blockScopedBindingsReassignedInLoop3.js index ad3c931bb3af4..dba2c65321c78 100644 --- a/tests/baselines/reference/blockScopedBindingsReassignedInLoop3.js +++ b/tests/baselines/reference/blockScopedBindingsReassignedInLoop3.js @@ -94,6 +94,7 @@ for (let x = 1, y = 2; x < y; ++x, --y) { //// [blockScopedBindingsReassignedInLoop3.js] +"use strict"; for (let x = 1, y = 2; x < y; ++x, --y) { let a = () => x++ + y++; if (x == 1) { diff --git a/tests/baselines/reference/blockScopedBindingsReassignedInLoop4.js b/tests/baselines/reference/blockScopedBindingsReassignedInLoop4.js index 50ee906529c16..209725685e546 100644 --- a/tests/baselines/reference/blockScopedBindingsReassignedInLoop4.js +++ b/tests/baselines/reference/blockScopedBindingsReassignedInLoop4.js @@ -14,6 +14,7 @@ function f1() { } //// [blockScopedBindingsReassignedInLoop4.js] +"use strict"; function f1() { for (let x = 1, y = 2; x < y; ++x, --y) { let a = () => x++ + y++; diff --git a/tests/baselines/reference/blockScopedBindingsReassignedInLoop4.types b/tests/baselines/reference/blockScopedBindingsReassignedInLoop4.types index 0091b3420b48f..489738efe15b7 100644 --- a/tests/baselines/reference/blockScopedBindingsReassignedInLoop4.types +++ b/tests/baselines/reference/blockScopedBindingsReassignedInLoop4.types @@ -2,8 +2,8 @@ === blockScopedBindingsReassignedInLoop4.ts === function f1() { ->f1 : () => number -> : ^^^^^^^^^^^^ +>f1 : () => 1 | undefined +> : ^^^^^^^^^^^^^^^^^^^ for (let x = 1, y = 2; x < y; ++x, --y) { >x : number diff --git a/tests/baselines/reference/blockScopedBindingsReassignedInLoop5.js b/tests/baselines/reference/blockScopedBindingsReassignedInLoop5.js index d1ac139c4f9fe..b3ef3d75faafe 100644 --- a/tests/baselines/reference/blockScopedBindingsReassignedInLoop5.js +++ b/tests/baselines/reference/blockScopedBindingsReassignedInLoop5.js @@ -11,6 +11,7 @@ for (let x = 1, y = 2; x < y; ++x, --y) { //// [blockScopedBindingsReassignedInLoop5.js] +"use strict"; for (let x = 1, y = 2; x < y; ++x, --y) { let a = () => x++ + y++; if (x == 1) diff --git a/tests/baselines/reference/blockScopedBindingsReassignedInLoop6.js b/tests/baselines/reference/blockScopedBindingsReassignedInLoop6.js index c8df362616bef..68b5c9535a737 100644 --- a/tests/baselines/reference/blockScopedBindingsReassignedInLoop6.js +++ b/tests/baselines/reference/blockScopedBindingsReassignedInLoop6.js @@ -32,6 +32,7 @@ function f2() { //// [blockScopedBindingsReassignedInLoop6.js] +"use strict"; function f1() { for (let [x, y] = [1, 2]; x < y; ++x, --y) { let a = () => x++ + y++; diff --git a/tests/baselines/reference/blockScopedClassDeclarationAcrossFiles.js b/tests/baselines/reference/blockScopedClassDeclarationAcrossFiles.js index 199d4cc08d6c5..e071d86c7a1e8 100644 --- a/tests/baselines/reference/blockScopedClassDeclarationAcrossFiles.js +++ b/tests/baselines/reference/blockScopedClassDeclarationAcrossFiles.js @@ -7,6 +7,7 @@ class C { } //// [foo.js] +"use strict"; let foo; class C { } diff --git a/tests/baselines/reference/blockScopedEnumVariablesUseBeforeDef(target=es2015).js b/tests/baselines/reference/blockScopedEnumVariablesUseBeforeDef(target=es2015).js index 1ce3d754926d0..84086dd068f5c 100644 --- a/tests/baselines/reference/blockScopedEnumVariablesUseBeforeDef(target=es2015).js +++ b/tests/baselines/reference/blockScopedEnumVariablesUseBeforeDef(target=es2015).js @@ -21,6 +21,7 @@ const enum AfterObject { //// [blockScopedEnumVariablesUseBeforeDef.js] +"use strict"; function foo1() { return E.A; let E; diff --git a/tests/baselines/reference/blockScopedEnumVariablesUseBeforeDef(target=es5).js b/tests/baselines/reference/blockScopedEnumVariablesUseBeforeDef(target=es5).js index 80bd068246b4e..4ee33329e953f 100644 --- a/tests/baselines/reference/blockScopedEnumVariablesUseBeforeDef(target=es5).js +++ b/tests/baselines/reference/blockScopedEnumVariablesUseBeforeDef(target=es5).js @@ -21,6 +21,7 @@ const enum AfterObject { //// [blockScopedEnumVariablesUseBeforeDef.js] +"use strict"; function foo1() { return E.A; var E; diff --git a/tests/baselines/reference/blockScopedEnumVariablesUseBeforeDef_isolatedModules(target=es2015).js b/tests/baselines/reference/blockScopedEnumVariablesUseBeforeDef_isolatedModules(target=es2015).js index 1602bbaa6f156..a60cb087231c6 100644 --- a/tests/baselines/reference/blockScopedEnumVariablesUseBeforeDef_isolatedModules(target=es2015).js +++ b/tests/baselines/reference/blockScopedEnumVariablesUseBeforeDef_isolatedModules(target=es2015).js @@ -21,6 +21,7 @@ const enum AfterObject { //// [blockScopedEnumVariablesUseBeforeDef_isolatedModules.js] +"use strict"; function foo1() { return E.A; let E; diff --git a/tests/baselines/reference/blockScopedEnumVariablesUseBeforeDef_isolatedModules(target=es5).js b/tests/baselines/reference/blockScopedEnumVariablesUseBeforeDef_isolatedModules(target=es5).js index 02875471bcb3d..62aa6e410c659 100644 --- a/tests/baselines/reference/blockScopedEnumVariablesUseBeforeDef_isolatedModules(target=es5).js +++ b/tests/baselines/reference/blockScopedEnumVariablesUseBeforeDef_isolatedModules(target=es5).js @@ -21,6 +21,7 @@ const enum AfterObject { //// [blockScopedEnumVariablesUseBeforeDef_isolatedModules.js] +"use strict"; function foo1() { return E.A; var E; diff --git a/tests/baselines/reference/blockScopedEnumVariablesUseBeforeDef_preserve(target=es2015).js b/tests/baselines/reference/blockScopedEnumVariablesUseBeforeDef_preserve(target=es2015).js index 232102d52d865..0b36cb80a9e41 100644 --- a/tests/baselines/reference/blockScopedEnumVariablesUseBeforeDef_preserve(target=es2015).js +++ b/tests/baselines/reference/blockScopedEnumVariablesUseBeforeDef_preserve(target=es2015).js @@ -21,6 +21,7 @@ const enum AfterObject { //// [blockScopedEnumVariablesUseBeforeDef_preserve.js] +"use strict"; function foo1() { return E.A; let E; diff --git a/tests/baselines/reference/blockScopedEnumVariablesUseBeforeDef_preserve(target=es5).js b/tests/baselines/reference/blockScopedEnumVariablesUseBeforeDef_preserve(target=es5).js index 1729f1624959d..ab1dc82fb2add 100644 --- a/tests/baselines/reference/blockScopedEnumVariablesUseBeforeDef_preserve(target=es5).js +++ b/tests/baselines/reference/blockScopedEnumVariablesUseBeforeDef_preserve(target=es5).js @@ -21,6 +21,7 @@ const enum AfterObject { //// [blockScopedEnumVariablesUseBeforeDef_preserve.js] +"use strict"; function foo1() { return E.A; var E; diff --git a/tests/baselines/reference/blockScopedEnumVariablesUseBeforeDef_verbatimModuleSyntax(target=es2015).js b/tests/baselines/reference/blockScopedEnumVariablesUseBeforeDef_verbatimModuleSyntax(target=es2015).js index 508dc616c145b..4d843f553e65e 100644 --- a/tests/baselines/reference/blockScopedEnumVariablesUseBeforeDef_verbatimModuleSyntax(target=es2015).js +++ b/tests/baselines/reference/blockScopedEnumVariablesUseBeforeDef_verbatimModuleSyntax(target=es2015).js @@ -21,6 +21,7 @@ const enum AfterObject { //// [blockScopedEnumVariablesUseBeforeDef_verbatimModuleSyntax.js] +"use strict"; function foo1() { return E.A; let E; diff --git a/tests/baselines/reference/blockScopedEnumVariablesUseBeforeDef_verbatimModuleSyntax(target=es5).js b/tests/baselines/reference/blockScopedEnumVariablesUseBeforeDef_verbatimModuleSyntax(target=es5).js index 4d4f7ead87418..c41b4612ad882 100644 --- a/tests/baselines/reference/blockScopedEnumVariablesUseBeforeDef_verbatimModuleSyntax(target=es5).js +++ b/tests/baselines/reference/blockScopedEnumVariablesUseBeforeDef_verbatimModuleSyntax(target=es5).js @@ -21,6 +21,7 @@ const enum AfterObject { //// [blockScopedEnumVariablesUseBeforeDef_verbatimModuleSyntax.js] +"use strict"; function foo1() { return E.A; var E; diff --git a/tests/baselines/reference/blockScopedFunctionDeclarationES5(target=es2015).errors.txt b/tests/baselines/reference/blockScopedFunctionDeclarationES5(target=es2015).errors.txt new file mode 100644 index 0000000000000..c5904d75507c4 --- /dev/null +++ b/tests/baselines/reference/blockScopedFunctionDeclarationES5(target=es2015).errors.txt @@ -0,0 +1,11 @@ +blockScopedFunctionDeclarationES5.ts(5,1): error TS2304: Cannot find name 'foo'. + + +==== blockScopedFunctionDeclarationES5.ts (1 errors) ==== + if (true) { + function foo() { } + foo(); + } + foo(); + ~~~ +!!! error TS2304: Cannot find name 'foo'. \ No newline at end of file diff --git a/tests/baselines/reference/blockScopedFunctionDeclarationES5(target=es2015).js b/tests/baselines/reference/blockScopedFunctionDeclarationES5(target=es2015).js index 4c0498586ae03..68db3f5d62e99 100644 --- a/tests/baselines/reference/blockScopedFunctionDeclarationES5(target=es2015).js +++ b/tests/baselines/reference/blockScopedFunctionDeclarationES5(target=es2015).js @@ -8,6 +8,7 @@ if (true) { foo(); //// [blockScopedFunctionDeclarationES5.js] +"use strict"; if (true) { function foo() { } foo(); diff --git a/tests/baselines/reference/blockScopedFunctionDeclarationES5(target=es2015).symbols b/tests/baselines/reference/blockScopedFunctionDeclarationES5(target=es2015).symbols index 7a4653165a1e3..3a54ffb3303d5 100644 --- a/tests/baselines/reference/blockScopedFunctionDeclarationES5(target=es2015).symbols +++ b/tests/baselines/reference/blockScopedFunctionDeclarationES5(target=es2015).symbols @@ -9,5 +9,3 @@ if (true) { >foo : Symbol(foo, Decl(blockScopedFunctionDeclarationES5.ts, 0, 11)) } foo(); ->foo : Symbol(foo, Decl(blockScopedFunctionDeclarationES5.ts, 0, 11)) - diff --git a/tests/baselines/reference/blockScopedFunctionDeclarationES5(target=es2015).types b/tests/baselines/reference/blockScopedFunctionDeclarationES5(target=es2015).types index 5edf7f7fdf725..eec0d5dd2bd6c 100644 --- a/tests/baselines/reference/blockScopedFunctionDeclarationES5(target=es2015).types +++ b/tests/baselines/reference/blockScopedFunctionDeclarationES5(target=es2015).types @@ -16,8 +16,8 @@ if (true) { > : ^^^^^^^^^^ } foo(); ->foo() : void -> : ^^^^ ->foo : () => void -> : ^^^^^^^^^^ +>foo() : any +> : ^^^ +>foo : any +> : ^^^ diff --git a/tests/baselines/reference/blockScopedFunctionDeclarationES5(target=es5).errors.txt b/tests/baselines/reference/blockScopedFunctionDeclarationES5(target=es5).errors.txt index 04023008c4cf9..3719e575239d1 100644 --- a/tests/baselines/reference/blockScopedFunctionDeclarationES5(target=es5).errors.txt +++ b/tests/baselines/reference/blockScopedFunctionDeclarationES5(target=es5).errors.txt @@ -1,10 +1,16 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +blockScopedFunctionDeclarationES5.ts(2,14): error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'. +blockScopedFunctionDeclarationES5.ts(5,1): error TS2304: Cannot find name 'foo'. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== blockScopedFunctionDeclarationES5.ts (0 errors) ==== +==== blockScopedFunctionDeclarationES5.ts (2 errors) ==== if (true) { function foo() { } + ~~~ +!!! error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'. foo(); } - foo(); \ No newline at end of file + foo(); + ~~~ +!!! error TS2304: Cannot find name 'foo'. \ No newline at end of file diff --git a/tests/baselines/reference/blockScopedFunctionDeclarationES5(target=es5).js b/tests/baselines/reference/blockScopedFunctionDeclarationES5(target=es5).js index 4c0498586ae03..68db3f5d62e99 100644 --- a/tests/baselines/reference/blockScopedFunctionDeclarationES5(target=es5).js +++ b/tests/baselines/reference/blockScopedFunctionDeclarationES5(target=es5).js @@ -8,6 +8,7 @@ if (true) { foo(); //// [blockScopedFunctionDeclarationES5.js] +"use strict"; if (true) { function foo() { } foo(); diff --git a/tests/baselines/reference/blockScopedFunctionDeclarationES5(target=es5).symbols b/tests/baselines/reference/blockScopedFunctionDeclarationES5(target=es5).symbols index 7a4653165a1e3..3a54ffb3303d5 100644 --- a/tests/baselines/reference/blockScopedFunctionDeclarationES5(target=es5).symbols +++ b/tests/baselines/reference/blockScopedFunctionDeclarationES5(target=es5).symbols @@ -9,5 +9,3 @@ if (true) { >foo : Symbol(foo, Decl(blockScopedFunctionDeclarationES5.ts, 0, 11)) } foo(); ->foo : Symbol(foo, Decl(blockScopedFunctionDeclarationES5.ts, 0, 11)) - diff --git a/tests/baselines/reference/blockScopedFunctionDeclarationES5(target=es5).types b/tests/baselines/reference/blockScopedFunctionDeclarationES5(target=es5).types index 5edf7f7fdf725..eec0d5dd2bd6c 100644 --- a/tests/baselines/reference/blockScopedFunctionDeclarationES5(target=es5).types +++ b/tests/baselines/reference/blockScopedFunctionDeclarationES5(target=es5).types @@ -16,8 +16,8 @@ if (true) { > : ^^^^^^^^^^ } foo(); ->foo() : void -> : ^^^^ ->foo : () => void -> : ^^^^^^^^^^ +>foo() : any +> : ^^^ +>foo : any +> : ^^^ diff --git a/tests/baselines/reference/blockScopedFunctionDeclarationES5.errors.txt b/tests/baselines/reference/blockScopedFunctionDeclarationES5.errors.txt new file mode 100644 index 0000000000000..94b9d0c6c550f --- /dev/null +++ b/tests/baselines/reference/blockScopedFunctionDeclarationES5.errors.txt @@ -0,0 +1,14 @@ +blockScopedFunctionDeclarationES5.ts(2,14): error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'. +blockScopedFunctionDeclarationES5.ts(5,1): error TS2304: Cannot find name 'foo'. + + +==== blockScopedFunctionDeclarationES5.ts (2 errors) ==== + if (true) { + function foo() { } + ~~~ +!!! error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'. + foo(); + } + foo(); + ~~~ +!!! error TS2304: Cannot find name 'foo'. \ No newline at end of file diff --git a/tests/baselines/reference/blockScopedFunctionDeclarationES6.errors.txt b/tests/baselines/reference/blockScopedFunctionDeclarationES6.errors.txt new file mode 100644 index 0000000000000..99935089e46a1 --- /dev/null +++ b/tests/baselines/reference/blockScopedFunctionDeclarationES6.errors.txt @@ -0,0 +1,11 @@ +blockScopedFunctionDeclarationES6.ts(5,1): error TS2304: Cannot find name 'foo'. + + +==== blockScopedFunctionDeclarationES6.ts (1 errors) ==== + if (true) { + function foo() { } + foo(); + } + foo(); + ~~~ +!!! error TS2304: Cannot find name 'foo'. \ No newline at end of file diff --git a/tests/baselines/reference/blockScopedFunctionDeclarationES6.js b/tests/baselines/reference/blockScopedFunctionDeclarationES6.js index 65aec79d5505a..bd23e8bcbb0c5 100644 --- a/tests/baselines/reference/blockScopedFunctionDeclarationES6.js +++ b/tests/baselines/reference/blockScopedFunctionDeclarationES6.js @@ -8,6 +8,7 @@ if (true) { foo(); //// [blockScopedFunctionDeclarationES6.js] +"use strict"; if (true) { function foo() { } foo(); diff --git a/tests/baselines/reference/blockScopedFunctionDeclarationES6.symbols b/tests/baselines/reference/blockScopedFunctionDeclarationES6.symbols index f19c147b66749..b05ed0cb85fc5 100644 --- a/tests/baselines/reference/blockScopedFunctionDeclarationES6.symbols +++ b/tests/baselines/reference/blockScopedFunctionDeclarationES6.symbols @@ -9,5 +9,3 @@ if (true) { >foo : Symbol(foo, Decl(blockScopedFunctionDeclarationES6.ts, 0, 11)) } foo(); ->foo : Symbol(foo, Decl(blockScopedFunctionDeclarationES6.ts, 0, 11)) - diff --git a/tests/baselines/reference/blockScopedFunctionDeclarationES6.types b/tests/baselines/reference/blockScopedFunctionDeclarationES6.types index fbaec812410ca..3d3b9c479b487 100644 --- a/tests/baselines/reference/blockScopedFunctionDeclarationES6.types +++ b/tests/baselines/reference/blockScopedFunctionDeclarationES6.types @@ -16,8 +16,8 @@ if (true) { > : ^^^^^^^^^^ } foo(); ->foo() : void -> : ^^^^ ->foo : () => void -> : ^^^^^^^^^^ +>foo() : any +> : ^^^ +>foo : any +> : ^^^ diff --git a/tests/baselines/reference/blockScopedFunctionDeclarationInStrictClass(target=es2015).js b/tests/baselines/reference/blockScopedFunctionDeclarationInStrictClass(target=es2015).js index 48753edde7b2c..710513444ccc4 100644 --- a/tests/baselines/reference/blockScopedFunctionDeclarationInStrictClass(target=es2015).js +++ b/tests/baselines/reference/blockScopedFunctionDeclarationInStrictClass(target=es2015).js @@ -12,6 +12,7 @@ class c { } //// [blockScopedFunctionDeclarationInStrictClass.js] +"use strict"; class c { method() { if (true) { diff --git a/tests/baselines/reference/blockScopedFunctionDeclarationInStrictClass(target=es5).js b/tests/baselines/reference/blockScopedFunctionDeclarationInStrictClass(target=es5).js index 1c4d022022918..0bf6697eb136d 100644 --- a/tests/baselines/reference/blockScopedFunctionDeclarationInStrictClass(target=es5).js +++ b/tests/baselines/reference/blockScopedFunctionDeclarationInStrictClass(target=es5).js @@ -12,6 +12,7 @@ class c { } //// [blockScopedFunctionDeclarationInStrictClass.js] +"use strict"; var c = /** @class */ (function () { function c() { } diff --git a/tests/baselines/reference/blockScopedNamespaceDifferentFile(target=es2015).js b/tests/baselines/reference/blockScopedNamespaceDifferentFile(target=es2015).js index f1ff6ca37c8f2..d000e790b0597 100644 --- a/tests/baselines/reference/blockScopedNamespaceDifferentFile(target=es2015).js +++ b/tests/baselines/reference/blockScopedNamespaceDifferentFile(target=es2015).js @@ -20,6 +20,7 @@ declare namespace A { //// [out.js] +"use strict"; var C; (function (C) { class Name { diff --git a/tests/baselines/reference/blockScopedNamespaceDifferentFile(target=es5).js b/tests/baselines/reference/blockScopedNamespaceDifferentFile(target=es5).js index 0933aa90fb61a..0a7c16cf68b5a 100644 --- a/tests/baselines/reference/blockScopedNamespaceDifferentFile(target=es5).js +++ b/tests/baselines/reference/blockScopedNamespaceDifferentFile(target=es5).js @@ -20,6 +20,7 @@ declare namespace A { //// [out.js] +"use strict"; var C; (function (C) { var Name = /** @class */ (function () { diff --git a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5(target=es2015).errors.txt b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5(target=es2015).errors.txt index 47b4cf9a063cf..f55ed3017c204 100644 --- a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5(target=es2015).errors.txt +++ b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5(target=es2015).errors.txt @@ -1,17 +1,13 @@ -blockScopedSameNameFunctionDeclarationES5.ts(3,18): error TS2393: Duplicate function implementation. blockScopedSameNameFunctionDeclarationES5.ts(5,13): error TS2554: Expected 0 arguments, but got 1. -blockScopedSameNameFunctionDeclarationES5.ts(8,18): error TS2393: Duplicate function implementation. blockScopedSameNameFunctionDeclarationES5.ts(10,13): error TS2554: Expected 0 arguments, but got 1. -blockScopedSameNameFunctionDeclarationES5.ts(12,9): error TS2554: Expected 0 arguments, but got 1. +blockScopedSameNameFunctionDeclarationES5.ts(13,5): error TS2554: Expected 1 arguments, but got 0. blockScopedSameNameFunctionDeclarationES5.ts(16,1): error TS2554: Expected 1 arguments, but got 0. -==== blockScopedSameNameFunctionDeclarationES5.ts (6 errors) ==== +==== blockScopedSameNameFunctionDeclarationES5.ts (4 errors) ==== function foo(a: number) { if (a === 1) { function foo() { } // duplicate function - ~~~ -!!! error TS2393: Duplicate function implementation. foo(); foo(10); // not ok ~~ @@ -19,17 +15,16 @@ blockScopedSameNameFunctionDeclarationES5.ts(16,1): error TS2554: Expected 1 arg } else { function foo() { } // duplicate function - ~~~ -!!! error TS2393: Duplicate function implementation. foo(); foo(10); // not ok ~~ !!! error TS2554: Expected 0 arguments, but got 1. } foo(10); // not ok - ~~ -!!! error TS2554: Expected 0 arguments, but got 1. foo(); + ~~~ +!!! error TS2554: Expected 1 arguments, but got 0. +!!! related TS6210 blockScopedSameNameFunctionDeclarationES5.ts:1:14: An argument for 'a' was not provided. } foo(10); foo(); // not ok - needs number diff --git a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5(target=es2015).js b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5(target=es2015).js index 00efc973004c0..373db7739d0a7 100644 --- a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5(target=es2015).js +++ b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5(target=es2015).js @@ -19,6 +19,7 @@ foo(10); foo(); // not ok - needs number //// [blockScopedSameNameFunctionDeclarationES5.js] +"use strict"; function foo(a) { if (a === 1) { function foo() { } // duplicate function diff --git a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5(target=es2015).symbols b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5(target=es2015).symbols index 9059c98982ce8..094cdcd450a7e 100644 --- a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5(target=es2015).symbols +++ b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5(target=es2015).symbols @@ -9,29 +9,29 @@ function foo(a: number) { >a : Symbol(a, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 0, 13)) function foo() { } // duplicate function ->foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 1, 18), Decl(blockScopedSameNameFunctionDeclarationES5.ts, 6, 10)) +>foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 1, 18)) foo(); ->foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 1, 18), Decl(blockScopedSameNameFunctionDeclarationES5.ts, 6, 10)) +>foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 1, 18)) foo(10); // not ok ->foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 1, 18), Decl(blockScopedSameNameFunctionDeclarationES5.ts, 6, 10)) +>foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 1, 18)) } else { function foo() { } // duplicate function ->foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 1, 18), Decl(blockScopedSameNameFunctionDeclarationES5.ts, 6, 10)) +>foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 6, 10)) foo(); ->foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 1, 18), Decl(blockScopedSameNameFunctionDeclarationES5.ts, 6, 10)) +>foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 6, 10)) foo(10); // not ok ->foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 1, 18), Decl(blockScopedSameNameFunctionDeclarationES5.ts, 6, 10)) +>foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 6, 10)) } foo(10); // not ok ->foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 1, 18), Decl(blockScopedSameNameFunctionDeclarationES5.ts, 6, 10)) +>foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 0, 0)) foo(); ->foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 1, 18), Decl(blockScopedSameNameFunctionDeclarationES5.ts, 6, 10)) +>foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 0, 0)) } foo(10); >foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 0, 0)) diff --git a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5(target=es2015).types b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5(target=es2015).types index 33989fec6734f..810aa8608c57f 100644 --- a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5(target=es2015).types +++ b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5(target=es2015).types @@ -16,55 +16,55 @@ function foo(a: number) { > : ^ function foo() { } // duplicate function ->foo : { (): void; (): void; } -> : ^^^^^^^^^^^^^^^^^^^^^^^ +>foo : () => void +> : ^^^^^^^^^^ foo(); >foo() : void > : ^^^^ ->foo : { (): void; (): void; } -> : ^^^^^^^^^^^^^^^^^^^^^^^ +>foo : () => void +> : ^^^^^^^^^^ foo(10); // not ok >foo(10) : void > : ^^^^ ->foo : { (): void; (): void; } -> : ^^^^^^^^^^^^^^^^^^^^^^^ +>foo : () => void +> : ^^^^^^^^^^ >10 : 10 > : ^^ } else { function foo() { } // duplicate function ->foo : { (): void; (): void; } -> : ^^^^^^^^^^^^^^^^^^^^^^^ +>foo : () => void +> : ^^^^^^^^^^ foo(); >foo() : void > : ^^^^ ->foo : { (): void; (): void; } -> : ^^^^^^^^^^^^^^^^^^^^^^^ +>foo : () => void +> : ^^^^^^^^^^ foo(10); // not ok >foo(10) : void > : ^^^^ ->foo : { (): void; (): void; } -> : ^^^^^^^^^^^^^^^^^^^^^^^ +>foo : () => void +> : ^^^^^^^^^^ >10 : 10 > : ^^ } foo(10); // not ok >foo(10) : void > : ^^^^ ->foo : { (): void; (): void; } -> : ^^^^^^^^^^^^^^^^^^^^^^^ +>foo : (a: number) => void +> : ^ ^^ ^^^^^^^^^ >10 : 10 > : ^^ foo(); >foo() : void > : ^^^^ ->foo : { (): void; (): void; } -> : ^^^^^^^^^^^^^^^^^^^^^^^ +>foo : (a: number) => void +> : ^ ^^ ^^^^^^^^^ } foo(10); >foo(10) : void diff --git a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5(target=es5).errors.txt b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5(target=es5).errors.txt index 9c54d31e8e5e1..c6b3412422adb 100644 --- a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5(target=es5).errors.txt +++ b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5(target=es5).errors.txt @@ -1,9 +1,9 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -blockScopedSameNameFunctionDeclarationES5.ts(3,18): error TS2393: Duplicate function implementation. +blockScopedSameNameFunctionDeclarationES5.ts(3,18): error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'. blockScopedSameNameFunctionDeclarationES5.ts(5,13): error TS2554: Expected 0 arguments, but got 1. -blockScopedSameNameFunctionDeclarationES5.ts(8,18): error TS2393: Duplicate function implementation. +blockScopedSameNameFunctionDeclarationES5.ts(8,18): error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'. blockScopedSameNameFunctionDeclarationES5.ts(10,13): error TS2554: Expected 0 arguments, but got 1. -blockScopedSameNameFunctionDeclarationES5.ts(12,9): error TS2554: Expected 0 arguments, but got 1. +blockScopedSameNameFunctionDeclarationES5.ts(13,5): error TS2554: Expected 1 arguments, but got 0. blockScopedSameNameFunctionDeclarationES5.ts(16,1): error TS2554: Expected 1 arguments, but got 0. @@ -13,7 +13,7 @@ blockScopedSameNameFunctionDeclarationES5.ts(16,1): error TS2554: Expected 1 arg if (a === 1) { function foo() { } // duplicate function ~~~ -!!! error TS2393: Duplicate function implementation. +!!! error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'. foo(); foo(10); // not ok ~~ @@ -22,16 +22,17 @@ blockScopedSameNameFunctionDeclarationES5.ts(16,1): error TS2554: Expected 1 arg else { function foo() { } // duplicate function ~~~ -!!! error TS2393: Duplicate function implementation. +!!! error TS1250: Function declarations are not allowed inside blocks in strict mode when targeting 'ES5'. foo(); foo(10); // not ok ~~ !!! error TS2554: Expected 0 arguments, but got 1. } foo(10); // not ok - ~~ -!!! error TS2554: Expected 0 arguments, but got 1. foo(); + ~~~ +!!! error TS2554: Expected 1 arguments, but got 0. +!!! related TS6210 blockScopedSameNameFunctionDeclarationES5.ts:1:14: An argument for 'a' was not provided. } foo(10); foo(); // not ok - needs number diff --git a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5(target=es5).js b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5(target=es5).js index 00efc973004c0..373db7739d0a7 100644 --- a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5(target=es5).js +++ b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5(target=es5).js @@ -19,6 +19,7 @@ foo(10); foo(); // not ok - needs number //// [blockScopedSameNameFunctionDeclarationES5.js] +"use strict"; function foo(a) { if (a === 1) { function foo() { } // duplicate function diff --git a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5(target=es5).symbols b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5(target=es5).symbols index 9059c98982ce8..094cdcd450a7e 100644 --- a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5(target=es5).symbols +++ b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5(target=es5).symbols @@ -9,29 +9,29 @@ function foo(a: number) { >a : Symbol(a, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 0, 13)) function foo() { } // duplicate function ->foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 1, 18), Decl(blockScopedSameNameFunctionDeclarationES5.ts, 6, 10)) +>foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 1, 18)) foo(); ->foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 1, 18), Decl(blockScopedSameNameFunctionDeclarationES5.ts, 6, 10)) +>foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 1, 18)) foo(10); // not ok ->foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 1, 18), Decl(blockScopedSameNameFunctionDeclarationES5.ts, 6, 10)) +>foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 1, 18)) } else { function foo() { } // duplicate function ->foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 1, 18), Decl(blockScopedSameNameFunctionDeclarationES5.ts, 6, 10)) +>foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 6, 10)) foo(); ->foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 1, 18), Decl(blockScopedSameNameFunctionDeclarationES5.ts, 6, 10)) +>foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 6, 10)) foo(10); // not ok ->foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 1, 18), Decl(blockScopedSameNameFunctionDeclarationES5.ts, 6, 10)) +>foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 6, 10)) } foo(10); // not ok ->foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 1, 18), Decl(blockScopedSameNameFunctionDeclarationES5.ts, 6, 10)) +>foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 0, 0)) foo(); ->foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 1, 18), Decl(blockScopedSameNameFunctionDeclarationES5.ts, 6, 10)) +>foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 0, 0)) } foo(10); >foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES5.ts, 0, 0)) diff --git a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5(target=es5).types b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5(target=es5).types index 33989fec6734f..810aa8608c57f 100644 --- a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5(target=es5).types +++ b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES5(target=es5).types @@ -16,55 +16,55 @@ function foo(a: number) { > : ^ function foo() { } // duplicate function ->foo : { (): void; (): void; } -> : ^^^^^^^^^^^^^^^^^^^^^^^ +>foo : () => void +> : ^^^^^^^^^^ foo(); >foo() : void > : ^^^^ ->foo : { (): void; (): void; } -> : ^^^^^^^^^^^^^^^^^^^^^^^ +>foo : () => void +> : ^^^^^^^^^^ foo(10); // not ok >foo(10) : void > : ^^^^ ->foo : { (): void; (): void; } -> : ^^^^^^^^^^^^^^^^^^^^^^^ +>foo : () => void +> : ^^^^^^^^^^ >10 : 10 > : ^^ } else { function foo() { } // duplicate function ->foo : { (): void; (): void; } -> : ^^^^^^^^^^^^^^^^^^^^^^^ +>foo : () => void +> : ^^^^^^^^^^ foo(); >foo() : void > : ^^^^ ->foo : { (): void; (): void; } -> : ^^^^^^^^^^^^^^^^^^^^^^^ +>foo : () => void +> : ^^^^^^^^^^ foo(10); // not ok >foo(10) : void > : ^^^^ ->foo : { (): void; (): void; } -> : ^^^^^^^^^^^^^^^^^^^^^^^ +>foo : () => void +> : ^^^^^^^^^^ >10 : 10 > : ^^ } foo(10); // not ok >foo(10) : void > : ^^^^ ->foo : { (): void; (): void; } -> : ^^^^^^^^^^^^^^^^^^^^^^^ +>foo : (a: number) => void +> : ^ ^^ ^^^^^^^^^ >10 : 10 > : ^^ foo(); >foo() : void > : ^^^^ ->foo : { (): void; (): void; } -> : ^^^^^^^^^^^^^^^^^^^^^^^ +>foo : (a: number) => void +> : ^ ^^ ^^^^^^^^^ } foo(10); >foo(10) : void diff --git a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES6.errors.txt b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES6.errors.txt index 19f6f09e639f4..8f634b2d0b334 100644 --- a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES6.errors.txt +++ b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES6.errors.txt @@ -1,17 +1,13 @@ -blockScopedSameNameFunctionDeclarationES6.ts(3,18): error TS2393: Duplicate function implementation. blockScopedSameNameFunctionDeclarationES6.ts(5,13): error TS2554: Expected 0 arguments, but got 1. -blockScopedSameNameFunctionDeclarationES6.ts(8,18): error TS2393: Duplicate function implementation. blockScopedSameNameFunctionDeclarationES6.ts(10,13): error TS2554: Expected 0 arguments, but got 1. -blockScopedSameNameFunctionDeclarationES6.ts(12,9): error TS2554: Expected 0 arguments, but got 1. +blockScopedSameNameFunctionDeclarationES6.ts(13,5): error TS2554: Expected 1 arguments, but got 0. blockScopedSameNameFunctionDeclarationES6.ts(16,1): error TS2554: Expected 1 arguments, but got 0. -==== blockScopedSameNameFunctionDeclarationES6.ts (6 errors) ==== +==== blockScopedSameNameFunctionDeclarationES6.ts (4 errors) ==== function foo(a: number) { if (a === 10) { function foo() { } // duplicate - ~~~ -!!! error TS2393: Duplicate function implementation. foo(); foo(10); // not ok ~~ @@ -19,17 +15,16 @@ blockScopedSameNameFunctionDeclarationES6.ts(16,1): error TS2554: Expected 1 arg } else { function foo() { } // duplicate - ~~~ -!!! error TS2393: Duplicate function implementation. foo(); foo(10);// not ok ~~ !!! error TS2554: Expected 0 arguments, but got 1. } foo(10); // not ok - ~~ -!!! error TS2554: Expected 0 arguments, but got 1. foo(); + ~~~ +!!! error TS2554: Expected 1 arguments, but got 0. +!!! related TS6210 blockScopedSameNameFunctionDeclarationES6.ts:1:14: An argument for 'a' was not provided. } foo(10); foo(); // not ok - needs number diff --git a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES6.js b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES6.js index 24ca3a82bf71a..5501cf7631ad1 100644 --- a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES6.js +++ b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES6.js @@ -19,6 +19,7 @@ foo(10); foo(); // not ok - needs number //// [blockScopedSameNameFunctionDeclarationES6.js] +"use strict"; function foo(a) { if (a === 10) { function foo() { } // duplicate diff --git a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES6.symbols b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES6.symbols index 125116a09b49e..29d15d21f43f4 100644 --- a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES6.symbols +++ b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES6.symbols @@ -9,29 +9,29 @@ function foo(a: number) { >a : Symbol(a, Decl(blockScopedSameNameFunctionDeclarationES6.ts, 0, 13)) function foo() { } // duplicate ->foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES6.ts, 1, 19), Decl(blockScopedSameNameFunctionDeclarationES6.ts, 6, 10)) +>foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES6.ts, 1, 19)) foo(); ->foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES6.ts, 1, 19), Decl(blockScopedSameNameFunctionDeclarationES6.ts, 6, 10)) +>foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES6.ts, 1, 19)) foo(10); // not ok ->foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES6.ts, 1, 19), Decl(blockScopedSameNameFunctionDeclarationES6.ts, 6, 10)) +>foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES6.ts, 1, 19)) } else { function foo() { } // duplicate ->foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES6.ts, 1, 19), Decl(blockScopedSameNameFunctionDeclarationES6.ts, 6, 10)) +>foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES6.ts, 6, 10)) foo(); ->foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES6.ts, 1, 19), Decl(blockScopedSameNameFunctionDeclarationES6.ts, 6, 10)) +>foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES6.ts, 6, 10)) foo(10);// not ok ->foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES6.ts, 1, 19), Decl(blockScopedSameNameFunctionDeclarationES6.ts, 6, 10)) +>foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES6.ts, 6, 10)) } foo(10); // not ok ->foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES6.ts, 1, 19), Decl(blockScopedSameNameFunctionDeclarationES6.ts, 6, 10)) +>foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES6.ts, 0, 0)) foo(); ->foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES6.ts, 1, 19), Decl(blockScopedSameNameFunctionDeclarationES6.ts, 6, 10)) +>foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES6.ts, 0, 0)) } foo(10); >foo : Symbol(foo, Decl(blockScopedSameNameFunctionDeclarationES6.ts, 0, 0)) diff --git a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES6.types b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES6.types index 5820765d029d3..ff7ce8d82c286 100644 --- a/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES6.types +++ b/tests/baselines/reference/blockScopedSameNameFunctionDeclarationES6.types @@ -16,55 +16,55 @@ function foo(a: number) { > : ^^ function foo() { } // duplicate ->foo : { (): void; (): void; } -> : ^^^^^^^^^^^^^^^^^^^^^^^ +>foo : () => void +> : ^^^^^^^^^^ foo(); >foo() : void > : ^^^^ ->foo : { (): void; (): void; } -> : ^^^^^^^^^^^^^^^^^^^^^^^ +>foo : () => void +> : ^^^^^^^^^^ foo(10); // not ok >foo(10) : void > : ^^^^ ->foo : { (): void; (): void; } -> : ^^^^^^^^^^^^^^^^^^^^^^^ +>foo : () => void +> : ^^^^^^^^^^ >10 : 10 > : ^^ } else { function foo() { } // duplicate ->foo : { (): void; (): void; } -> : ^^^^^^^^^^^^^^^^^^^^^^^ +>foo : () => void +> : ^^^^^^^^^^ foo(); >foo() : void > : ^^^^ ->foo : { (): void; (): void; } -> : ^^^^^^^^^^^^^^^^^^^^^^^ +>foo : () => void +> : ^^^^^^^^^^ foo(10);// not ok >foo(10) : void > : ^^^^ ->foo : { (): void; (): void; } -> : ^^^^^^^^^^^^^^^^^^^^^^^ +>foo : () => void +> : ^^^^^^^^^^ >10 : 10 > : ^^ } foo(10); // not ok >foo(10) : void > : ^^^^ ->foo : { (): void; (): void; } -> : ^^^^^^^^^^^^^^^^^^^^^^^ +>foo : (a: number) => void +> : ^ ^^ ^^^^^^^^^ >10 : 10 > : ^^ foo(); >foo() : void > : ^^^^ ->foo : { (): void; (): void; } -> : ^^^^^^^^^^^^^^^^^^^^^^^ +>foo : (a: number) => void +> : ^ ^^ ^^^^^^^^^ } foo(10); >foo(10) : void diff --git a/tests/baselines/reference/blockScopedVariablesUseBeforeDef(target=es2015).js b/tests/baselines/reference/blockScopedVariablesUseBeforeDef(target=es2015).js index c1cfdc27774af..88f82a87da942 100644 --- a/tests/baselines/reference/blockScopedVariablesUseBeforeDef(target=es2015).js +++ b/tests/baselines/reference/blockScopedVariablesUseBeforeDef(target=es2015).js @@ -162,6 +162,7 @@ function foo18() { //// [blockScopedVariablesUseBeforeDef.js] +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { diff --git a/tests/baselines/reference/blockScopedVariablesUseBeforeDef(target=es5).js b/tests/baselines/reference/blockScopedVariablesUseBeforeDef(target=es5).js index eed9549b53df8..6340aa1eea313 100644 --- a/tests/baselines/reference/blockScopedVariablesUseBeforeDef(target=es5).js +++ b/tests/baselines/reference/blockScopedVariablesUseBeforeDef(target=es5).js @@ -162,6 +162,7 @@ function foo18() { //// [blockScopedVariablesUseBeforeDef.js] +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { diff --git a/tests/baselines/reference/bluebirdStaticThis.types b/tests/baselines/reference/bluebirdStaticThis.types index 5611a3a4086e7..baecb10f61796 100644 --- a/tests/baselines/reference/bluebirdStaticThis.types +++ b/tests/baselines/reference/bluebirdStaticThis.types @@ -36,8 +36,8 @@ export declare class Promise implements Promise.Thenable { > : ^^^^^^ >Promise : any > : ^^^ ->args : any[] -> : ^^^^^ +>args : any[] | undefined +> : ^^^^^^^^^^^^^^^^^ >ctx : any > : ^^^ @@ -50,8 +50,8 @@ export declare class Promise implements Promise.Thenable { > : ^^^^^^^^^^^^^^ >fn : () => R > : ^^^^^^ ->args : any[] -> : ^^^^^ +>args : any[] | undefined +> : ^^^^^^^^^^^^^^^^^ >ctx : any > : ^^^ @@ -66,8 +66,8 @@ export declare class Promise implements Promise.Thenable { > : ^^^^^^ >Promise : any > : ^^^ ->args : any[] -> : ^^^^^ +>args : any[] | undefined +> : ^^^^^^^^^^^^^^^^^ >ctx : any > : ^^^ @@ -80,8 +80,8 @@ export declare class Promise implements Promise.Thenable { > : ^^^^^^^^^^^^^^ >fn : () => R > : ^^^^^^ ->args : any[] -> : ^^^^^ +>args : any[] | undefined +> : ^^^^^^^^^^^^^^^^^ >ctx : any > : ^^^ @@ -796,8 +796,8 @@ export declare class Promise implements Promise.Thenable { > : ^^^^^^ >Promise : any > : ^^^ ->initialValue : U -> : ^ +>initialValue : U | undefined +> : ^^^^^^^^^^^^^ static reduce(dit: typeof Promise, values: Promise.Thenable[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; >reduce : { (dit: typeof Promise, values: Promise.Thenable[]>, reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U_1): Promise; (dit: typeof Promise, values: Promise.Thenable[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable, reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U_1): Promise; (dit: typeof Promise, values: Promise.Thenable, reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => U_1, initialValue?: U_1): Promise; (dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U_1): Promise; (dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => U_1, initialValue?: U_1): Promise; (dit: typeof Promise, values: R_1[], reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U_1): Promise; (dit: typeof Promise, values: R_1[], reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => U_1, initialValue?: U_1): Promise; } @@ -822,8 +822,8 @@ export declare class Promise implements Promise.Thenable { > : ^^^^^^ >arrayLength : number > : ^^^^^^ ->initialValue : U -> : ^ +>initialValue : U | undefined +> : ^^^^^^^^^^^^^ static reduce(dit: typeof Promise, values: Promise.Thenable, reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; >reduce : { (dit: typeof Promise, values: Promise.Thenable[]>, reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U_1): Promise; (dit: typeof Promise, values: Promise.Thenable[]>, reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => U_1, initialValue?: U_1): Promise; (dit: typeof Promise, values: Promise.Thenable, reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable, reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => U_1, initialValue?: U_1): Promise; (dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U_1): Promise; (dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => U_1, initialValue?: U_1): Promise; (dit: typeof Promise, values: R_1[], reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U_1): Promise; (dit: typeof Promise, values: R_1[], reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => U_1, initialValue?: U_1): Promise; } @@ -848,8 +848,8 @@ export declare class Promise implements Promise.Thenable { > : ^^^^^^ >Promise : any > : ^^^ ->initialValue : U -> : ^ +>initialValue : U | undefined +> : ^^^^^^^^^^^^^ static reduce(dit: typeof Promise, values: Promise.Thenable, reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; >reduce : { (dit: typeof Promise, values: Promise.Thenable[]>, reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U_1): Promise; (dit: typeof Promise, values: Promise.Thenable[]>, reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => U_1, initialValue?: U_1): Promise; (dit: typeof Promise, values: Promise.Thenable, reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U_1): Promise; (dit: typeof Promise, values: Promise.Thenable, reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U_1): Promise; (dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => U_1, initialValue?: U_1): Promise; (dit: typeof Promise, values: R_1[], reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U_1): Promise; (dit: typeof Promise, values: R_1[], reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => U_1, initialValue?: U_1): Promise; } @@ -872,8 +872,8 @@ export declare class Promise implements Promise.Thenable { > : ^^^^^^ >arrayLength : number > : ^^^^^^ ->initialValue : U -> : ^ +>initialValue : U | undefined +> : ^^^^^^^^^^^^^ static reduce(dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; >reduce : { (dit: typeof Promise, values: Promise.Thenable[]>, reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U_1): Promise; (dit: typeof Promise, values: Promise.Thenable[]>, reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => U_1, initialValue?: U_1): Promise; (dit: typeof Promise, values: Promise.Thenable, reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U_1): Promise; (dit: typeof Promise, values: Promise.Thenable, reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => U_1, initialValue?: U_1): Promise; (dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => U_1, initialValue?: U_1): Promise; (dit: typeof Promise, values: R_1[], reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U_1): Promise; (dit: typeof Promise, values: R_1[], reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => U_1, initialValue?: U_1): Promise; } @@ -898,8 +898,8 @@ export declare class Promise implements Promise.Thenable { > : ^^^^^^ >Promise : any > : ^^^ ->initialValue : U -> : ^ +>initialValue : U | undefined +> : ^^^^^^^^^^^^^ static reduce(dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; >reduce : { (dit: typeof Promise, values: Promise.Thenable[]>, reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U_1): Promise; (dit: typeof Promise, values: Promise.Thenable[]>, reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => U_1, initialValue?: U_1): Promise; (dit: typeof Promise, values: Promise.Thenable, reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U_1): Promise; (dit: typeof Promise, values: Promise.Thenable, reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => U_1, initialValue?: U_1): Promise; (dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U_1): Promise; (dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; (dit: typeof Promise, values: R_1[], reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U_1): Promise; (dit: typeof Promise, values: R_1[], reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => U_1, initialValue?: U_1): Promise; } @@ -922,8 +922,8 @@ export declare class Promise implements Promise.Thenable { > : ^^^^^^ >arrayLength : number > : ^^^^^^ ->initialValue : U -> : ^ +>initialValue : U | undefined +> : ^^^^^^^^^^^^^ static reduce(dit: typeof Promise, values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; >reduce : { (dit: typeof Promise, values: Promise.Thenable[]>, reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U_1): Promise; (dit: typeof Promise, values: Promise.Thenable[]>, reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => U_1, initialValue?: U_1): Promise; (dit: typeof Promise, values: Promise.Thenable, reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U_1): Promise; (dit: typeof Promise, values: Promise.Thenable, reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => U_1, initialValue?: U_1): Promise; (dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U_1): Promise; (dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => U_1, initialValue?: U_1): Promise; (dit: typeof Promise, values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; (dit: typeof Promise, values: R_1[], reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => U_1, initialValue?: U_1): Promise; } @@ -946,8 +946,8 @@ export declare class Promise implements Promise.Thenable { > : ^^^^^^ >Promise : any > : ^^^ ->initialValue : U -> : ^ +>initialValue : U | undefined +> : ^^^^^^^^^^^^^ static reduce(dit: typeof Promise, values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; >reduce : { (dit: typeof Promise, values: Promise.Thenable[]>, reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U_1): Promise; (dit: typeof Promise, values: Promise.Thenable[]>, reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => U_1, initialValue?: U_1): Promise; (dit: typeof Promise, values: Promise.Thenable, reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U_1): Promise; (dit: typeof Promise, values: Promise.Thenable, reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => U_1, initialValue?: U_1): Promise; (dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U_1): Promise; (dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => U_1, initialValue?: U_1): Promise; (dit: typeof Promise, values: R_1[], reducer: (total: U_1, current: R_1, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U_1): Promise; (dit: typeof Promise, values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; } @@ -968,8 +968,8 @@ export declare class Promise implements Promise.Thenable { > : ^^^^^^ >arrayLength : number > : ^^^^^^ ->initialValue : U -> : ^ +>initialValue : U | undefined +> : ^^^^^^^^^^^^^ static filter(dit: typeof Promise, values: Promise.Thenable[]>, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; >filter : { (dit: typeof Promise, values: Promise.Thenable[]>, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[]>, filterer: (item: R_1, index: number, arrayLength: number) => boolean): Promise; (dit: typeof Promise, values: Promise.Thenable, filterer: (item: R_1, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable, filterer: (item: R_1, index: number, arrayLength: number) => boolean): Promise; (dit: typeof Promise, values: Promise.Thenable[], filterer: (item: R_1, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[], filterer: (item: R_1, index: number, arrayLength: number) => boolean): Promise; (dit: typeof Promise, values: R_1[], filterer: (item: R_1, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: R_1[], filterer: (item: R_1, index: number, arrayLength: number) => boolean): Promise; } @@ -1161,8 +1161,8 @@ export declare namespace Promise { > : ^ ^^ ^^^^^ >value : R > : ^ ->onRejected : (error: any) => U -> : ^ ^^ ^^^^^ +>onRejected : ((error: any) => U) | undefined +> : ^^ ^^ ^^^^^ ^^^^^^^^^^^^^ >error : any > : ^^^ @@ -1181,12 +1181,12 @@ export declare namespace Promise { then(onFulfilled?: (value: R) => U, onRejected?: (error: any) => U): Thenable; >then : { (onFulfilled: (value: R) => Thenable, onRejected: (error: any) => Thenable): Thenable; (onFulfilled: (value: R) => Thenable, onRejected?: (error: any) => U_1): Thenable; (onFulfilled: (value: R) => U_1, onRejected: (error: any) => Thenable): Thenable; (onFulfilled?: (value: R) => U, onRejected?: (error: any) => U): Thenable; } > : ^^^^^^^^ ^^ ^^ ^^ ^^^ ^^^^^^^^ ^^ ^^ ^^^ ^^^ ^^^^^^^^ ^^ ^^ ^^ ^^^ ^^^ ^^ ^^^ ^^ ^^^ ^^^ ^^^ ->onFulfilled : (value: R) => U -> : ^ ^^ ^^^^^ +>onFulfilled : ((value: R) => U) | undefined +> : ^^ ^^ ^^^^^ ^^^^^^^^^^^^^ >value : R > : ^ ->onRejected : (error: any) => U -> : ^ ^^ ^^^^^ +>onRejected : ((error: any) => U) | undefined +> : ^^ ^^ ^^^^^ ^^^^^^^^^^^^^ >error : any > : ^^^ } diff --git a/tests/baselines/reference/bom-utf16be.js b/tests/baselines/reference/bom-utf16be.js index e96c00c946bc6..eca81b9696500 100644 --- a/tests/baselines/reference/bom-utf16be.js +++ b/tests/baselines/reference/bom-utf16be.js @@ -5,4 +5,5 @@ var x=10; //// [bom-utf16be.js] +"use strict"; var x = 10; diff --git a/tests/baselines/reference/bom-utf16le.js b/tests/baselines/reference/bom-utf16le.js index 6dd21a102b28f..6d9a2c6205745 100644 --- a/tests/baselines/reference/bom-utf16le.js +++ b/tests/baselines/reference/bom-utf16le.js @@ -5,4 +5,5 @@ var x=10; //// [bom-utf16le.js] +"use strict"; var x = 10; diff --git a/tests/baselines/reference/bom-utf8.js b/tests/baselines/reference/bom-utf8.js index 2c2e7b3e6c06f..29e4866af6405 100644 --- a/tests/baselines/reference/bom-utf8.js +++ b/tests/baselines/reference/bom-utf8.js @@ -5,4 +5,5 @@ var x=10; //// [bom-utf8.js] +"use strict"; var x = 10; diff --git a/tests/baselines/reference/boolInsteadOfBoolean.js b/tests/baselines/reference/boolInsteadOfBoolean.js index b02fb15028a9b..b238d5bfd45b1 100644 --- a/tests/baselines/reference/boolInsteadOfBoolean.js +++ b/tests/baselines/reference/boolInsteadOfBoolean.js @@ -6,6 +6,7 @@ var a: boolean = x; x = a; //// [boolInsteadOfBoolean.js] +"use strict"; var x; var a = x; x = a; diff --git a/tests/baselines/reference/booleanAssignment.js b/tests/baselines/reference/booleanAssignment.js index 727823c4375ce..4fc714f1dda09 100644 --- a/tests/baselines/reference/booleanAssignment.js +++ b/tests/baselines/reference/booleanAssignment.js @@ -15,6 +15,7 @@ declare var b2:boolean; b = b2; // OK //// [booleanAssignment.js] +"use strict"; var b = new Boolean(); b = 1; // Error b = "a"; // Error diff --git a/tests/baselines/reference/booleanFilterAnyArray.js b/tests/baselines/reference/booleanFilterAnyArray.js index 9da91fc0d3f02..b90b3f71c5798 100644 --- a/tests/baselines/reference/booleanFilterAnyArray.js +++ b/tests/baselines/reference/booleanFilterAnyArray.js @@ -28,6 +28,7 @@ var foos = [true, true, false, null].filter((thing): thing is boolean => thing ! //// [booleanFilterAnyArray.js] +"use strict"; var xs; var xs = anys.filter(Bullean); var ys; diff --git a/tests/baselines/reference/booleanFilterAnyArray.types b/tests/baselines/reference/booleanFilterAnyArray.types index 8925f7d31779c..4dd8620ff89c5 100644 --- a/tests/baselines/reference/booleanFilterAnyArray.types +++ b/tests/baselines/reference/booleanFilterAnyArray.types @@ -7,8 +7,8 @@ interface BulleanConstructor { >v1 : any (v2?: T): v2 is T; ->v2 : T -> : ^ +>v2 : T | undefined +> : ^^^^^^^^^^^^^ } interface Ari { @@ -125,24 +125,24 @@ var foos = [true, true, false, null].filter((thing): thing is boolean => thing ! > : ^^^^^^^^^ >[true, true, false, null].filter((thing): thing is boolean => thing !== null) : boolean[] > : ^^^^^^^^^ ->[true, true, false, null].filter : { (predicate: (value: boolean, index: number, array: boolean[]) => value is S, thisArg?: any): S[]; (predicate: (value: boolean, index: number, array: boolean[]) => unknown, thisArg?: any): boolean[]; } -> : ^^^ ^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^ ^^^ ^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^^^^^^^^^^^ ->[true, true, false, null] : boolean[] -> : ^^^^^^^^^ +>[true, true, false, null].filter : { (predicate: (value: boolean | null, index: number, array: (boolean | null)[]) => value is S, thisArg?: any): S[]; (predicate: (value: boolean | null, index: number, array: (boolean | null)[]) => unknown, thisArg?: any): (boolean | null)[]; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^ +>[true, true, false, null] : (boolean | null)[] +> : ^^^^^^^^^^^^^^^^^^ >true : true > : ^^^^ >true : true > : ^^^^ >false : false > : ^^^^^ ->filter : { (predicate: (value: boolean, index: number, array: boolean[]) => value is S, thisArg?: any): S[]; (predicate: (value: boolean, index: number, array: boolean[]) => unknown, thisArg?: any): boolean[]; } -> : ^^^ ^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^ ^^^ ^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^^^^^^^^^^^ ->(thing): thing is boolean => thing !== null : (thing: boolean) => thing is boolean -> : ^ ^^^^^^^^^^^^^^ ->thing : boolean -> : ^^^^^^^ +>filter : { (predicate: (value: boolean | null, index: number, array: (boolean | null)[]) => value is S, thisArg?: any): S[]; (predicate: (value: boolean | null, index: number, array: (boolean | null)[]) => unknown, thisArg?: any): (boolean | null)[]; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^ +>(thing): thing is boolean => thing !== null : (thing: boolean | null) => thing is boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^ +>thing : boolean | null +> : ^^^^^^^^^^^^^^ >thing !== null : boolean > : ^^^^^^^ ->thing : boolean -> : ^^^^^^^ +>thing : boolean | null +> : ^^^^^^^^^^^^^^ diff --git a/tests/baselines/reference/booleanLiteralTypes1.js b/tests/baselines/reference/booleanLiteralTypes1.js index 3d97fc78772ca..360e12187f376 100644 --- a/tests/baselines/reference/booleanLiteralTypes1.js +++ b/tests/baselines/reference/booleanLiteralTypes1.js @@ -98,6 +98,7 @@ function f21(x: Item) { } //// [booleanLiteralTypes1.js] +"use strict"; function f1() { var a; var a; diff --git a/tests/baselines/reference/booleanLiteralTypes1.types b/tests/baselines/reference/booleanLiteralTypes1.types index bc640f5e0c44b..5e63a5aa3c7bb 100644 --- a/tests/baselines/reference/booleanLiteralTypes1.types +++ b/tests/baselines/reference/booleanLiteralTypes1.types @@ -153,10 +153,10 @@ function f4(t: true, f: false) { > : ^^^^ var x3 = t || f; ->x3 : boolean -> : ^^^^^^^ ->t || f : boolean -> : ^^^^^^^ +>x3 : true +> : ^^^^ +>t || f : true +> : ^^^^ >t : true > : ^^^^ >f : false @@ -175,8 +175,8 @@ function f4(t: true, f: false) { var x5 = !t; >x5 : boolean > : ^^^^^^^ ->!t : boolean -> : ^^^^^^^ +>!t : false +> : ^^^^^ >t : true > : ^^^^ @@ -346,8 +346,8 @@ function f12(x: true | false) { } else { x; ->x : boolean -> : ^^^^^^^ +>x : false +> : ^^^^^ } } diff --git a/tests/baselines/reference/booleanLiteralTypes2.js b/tests/baselines/reference/booleanLiteralTypes2.js index ac208a664af45..2b108f612f69f 100644 --- a/tests/baselines/reference/booleanLiteralTypes2.js +++ b/tests/baselines/reference/booleanLiteralTypes2.js @@ -98,6 +98,7 @@ function f21(x: Item) { } //// [booleanLiteralTypes2.js] +"use strict"; function f1() { var a; var a; diff --git a/tests/baselines/reference/booleanPropertyAccess.js b/tests/baselines/reference/booleanPropertyAccess.js index 267317d267eb6..5c848ee6bc5bf 100644 --- a/tests/baselines/reference/booleanPropertyAccess.js +++ b/tests/baselines/reference/booleanPropertyAccess.js @@ -7,6 +7,7 @@ var a = x.toString(); var b = x['toString'](); //// [booleanPropertyAccess.js] +"use strict"; var x = true; var a = x.toString(); var b = x['toString'](); diff --git a/tests/baselines/reference/breakInIterationOrSwitchStatement1.js b/tests/baselines/reference/breakInIterationOrSwitchStatement1.js index ae5c636656517..322c83d956368 100644 --- a/tests/baselines/reference/breakInIterationOrSwitchStatement1.js +++ b/tests/baselines/reference/breakInIterationOrSwitchStatement1.js @@ -6,6 +6,7 @@ while (true) { } //// [breakInIterationOrSwitchStatement1.js] +"use strict"; while (true) { break; } diff --git a/tests/baselines/reference/breakInIterationOrSwitchStatement2.js b/tests/baselines/reference/breakInIterationOrSwitchStatement2.js index 12c33887f6f88..4b1cd82361903 100644 --- a/tests/baselines/reference/breakInIterationOrSwitchStatement2.js +++ b/tests/baselines/reference/breakInIterationOrSwitchStatement2.js @@ -7,6 +7,7 @@ do { while (true); //// [breakInIterationOrSwitchStatement2.js] +"use strict"; do { break; } while (true); diff --git a/tests/baselines/reference/breakInIterationOrSwitchStatement3.js b/tests/baselines/reference/breakInIterationOrSwitchStatement3.js index 1bbe738aa55b1..f799f969624c5 100644 --- a/tests/baselines/reference/breakInIterationOrSwitchStatement3.js +++ b/tests/baselines/reference/breakInIterationOrSwitchStatement3.js @@ -6,6 +6,7 @@ for (;;) { } //// [breakInIterationOrSwitchStatement3.js] +"use strict"; for (;;) { break; } diff --git a/tests/baselines/reference/breakInIterationOrSwitchStatement4.js b/tests/baselines/reference/breakInIterationOrSwitchStatement4.js index e93ffe7661626..f34356f40c1f9 100644 --- a/tests/baselines/reference/breakInIterationOrSwitchStatement4.js +++ b/tests/baselines/reference/breakInIterationOrSwitchStatement4.js @@ -6,6 +6,7 @@ for (var i in something) { } //// [breakInIterationOrSwitchStatement4.js] +"use strict"; for (var i in something) { break; } diff --git a/tests/baselines/reference/breakNotInIterationOrSwitchStatement1.js b/tests/baselines/reference/breakNotInIterationOrSwitchStatement1.js index 29f70a69abb18..8709ecc8ef6a6 100644 --- a/tests/baselines/reference/breakNotInIterationOrSwitchStatement1.js +++ b/tests/baselines/reference/breakNotInIterationOrSwitchStatement1.js @@ -4,4 +4,5 @@ break; //// [breakNotInIterationOrSwitchStatement1.js] +"use strict"; break; diff --git a/tests/baselines/reference/breakNotInIterationOrSwitchStatement2.js b/tests/baselines/reference/breakNotInIterationOrSwitchStatement2.js index e4141dd0e481f..da2a00bae395d 100644 --- a/tests/baselines/reference/breakNotInIterationOrSwitchStatement2.js +++ b/tests/baselines/reference/breakNotInIterationOrSwitchStatement2.js @@ -8,6 +8,7 @@ while (true) { } //// [breakNotInIterationOrSwitchStatement2.js] +"use strict"; while (true) { function f() { break; diff --git a/tests/baselines/reference/breakTarget1.js b/tests/baselines/reference/breakTarget1.js index 63ae8453566cd..0ef49b8fbad1d 100644 --- a/tests/baselines/reference/breakTarget1.js +++ b/tests/baselines/reference/breakTarget1.js @@ -5,4 +5,5 @@ target: break target; //// [breakTarget1.js] +"use strict"; target: break target; diff --git a/tests/baselines/reference/breakTarget2.js b/tests/baselines/reference/breakTarget2.js index b5d0fb650fe58..6e084d821c978 100644 --- a/tests/baselines/reference/breakTarget2.js +++ b/tests/baselines/reference/breakTarget2.js @@ -7,6 +7,7 @@ while (true) { } //// [breakTarget2.js] +"use strict"; target: while (true) { break target; } diff --git a/tests/baselines/reference/breakTarget3.js b/tests/baselines/reference/breakTarget3.js index 3bdc743b0c80a..48d36933a8192 100644 --- a/tests/baselines/reference/breakTarget3.js +++ b/tests/baselines/reference/breakTarget3.js @@ -8,6 +8,7 @@ while (true) { } //// [breakTarget3.js] +"use strict"; target1: target2: while (true) { break target1; } diff --git a/tests/baselines/reference/breakTarget4.js b/tests/baselines/reference/breakTarget4.js index 38dd0fd994b48..820939f1fdc9c 100644 --- a/tests/baselines/reference/breakTarget4.js +++ b/tests/baselines/reference/breakTarget4.js @@ -8,6 +8,7 @@ while (true) { } //// [breakTarget4.js] +"use strict"; target1: target2: while (true) { break target2; } diff --git a/tests/baselines/reference/breakTarget5.js b/tests/baselines/reference/breakTarget5.js index 51deeda7c3ba4..20ac88e6de2d9 100644 --- a/tests/baselines/reference/breakTarget5.js +++ b/tests/baselines/reference/breakTarget5.js @@ -11,6 +11,7 @@ while (true) { } //// [breakTarget5.js] +"use strict"; target: while (true) { function f() { while (true) { diff --git a/tests/baselines/reference/breakTarget6.js b/tests/baselines/reference/breakTarget6.js index 11ffb11504fee..32549903c8424 100644 --- a/tests/baselines/reference/breakTarget6.js +++ b/tests/baselines/reference/breakTarget6.js @@ -6,6 +6,7 @@ while (true) { } //// [breakTarget6.js] +"use strict"; while (true) { break target; } diff --git a/tests/baselines/reference/bundlerCommonJS.js b/tests/baselines/reference/bundlerCommonJS.js index 6d419cecbcbb5..06f3103e71e73 100644 --- a/tests/baselines/reference/bundlerCommonJS.js +++ b/tests/baselines/reference/bundlerCommonJS.js @@ -42,4 +42,5 @@ Object.defineProperty(exports, "__esModule", { value: true }); const pkg_1 = require("pkg"); pkg_1.x; //// [real-imports.mjs] +"use strict"; export {}; diff --git a/tests/baselines/reference/bundlerSyntaxRestrictions(module=esnext).types b/tests/baselines/reference/bundlerSyntaxRestrictions(module=esnext).types index 9bd31ef4b3cda..877016e6a5445 100644 --- a/tests/baselines/reference/bundlerSyntaxRestrictions(module=esnext).types +++ b/tests/baselines/reference/bundlerSyntaxRestrictions(module=esnext).types @@ -17,8 +17,8 @@ declare module "fs" { > : ^ ^^ ^^ ^^^ ^^^^^ >path : string > : ^^^^^^ ->encoding : string -> : ^^^^^^ +>encoding : string | undefined +> : ^^^^^^^^^^^^^^^^^^ } declare module "path" { >"path" : typeof import("path") diff --git a/tests/baselines/reference/bundlerSyntaxRestrictions(module=preserve).types b/tests/baselines/reference/bundlerSyntaxRestrictions(module=preserve).types index 9bd31ef4b3cda..877016e6a5445 100644 --- a/tests/baselines/reference/bundlerSyntaxRestrictions(module=preserve).types +++ b/tests/baselines/reference/bundlerSyntaxRestrictions(module=preserve).types @@ -17,8 +17,8 @@ declare module "fs" { > : ^ ^^ ^^ ^^^ ^^^^^ >path : string > : ^^^^^^ ->encoding : string -> : ^^^^^^ +>encoding : string | undefined +> : ^^^^^^^^^^^^^^^^^^ } declare module "path" { >"path" : typeof import("path") diff --git a/tests/baselines/reference/callChain.2.js b/tests/baselines/reference/callChain.2.js index 1e5985f585401..01a30b47116e7 100644 --- a/tests/baselines/reference/callChain.2.js +++ b/tests/baselines/reference/callChain.2.js @@ -12,6 +12,7 @@ o3.b?.().c; //// [callChain.2.js] +"use strict"; var _a; o1 === null || o1 === void 0 ? void 0 : o1(); o2 === null || o2 === void 0 ? void 0 : o2.b(); diff --git a/tests/baselines/reference/callConstructAssignment.js b/tests/baselines/reference/callConstructAssignment.js index 2ecc4ef183923..b32180b149a76 100644 --- a/tests/baselines/reference/callConstructAssignment.js +++ b/tests/baselines/reference/callConstructAssignment.js @@ -9,5 +9,6 @@ foo = bar; // error bar = foo; // error //// [callConstructAssignment.js] +"use strict"; foo = bar; // error bar = foo; // error diff --git a/tests/baselines/reference/callExpressionWithMissingTypeArgument1.js b/tests/baselines/reference/callExpressionWithMissingTypeArgument1.js index 514cc6a77e7ff..915a67b13161f 100644 --- a/tests/baselines/reference/callExpressionWithMissingTypeArgument1.js +++ b/tests/baselines/reference/callExpressionWithMissingTypeArgument1.js @@ -4,4 +4,5 @@ Foo(); //// [callExpressionWithMissingTypeArgument1.js] +"use strict"; Foo(); diff --git a/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.errors.txt b/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.errors.txt new file mode 100644 index 0000000000000..143f46bce29dd --- /dev/null +++ b/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.errors.txt @@ -0,0 +1,11 @@ +callExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts(5,9): error TS2454: Variable 'i' is used before being assigned. + + +==== callExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts (1 errors) ==== + interface I { + (u: U): U; + } + var i: I; + var y = i(""); // y should be string + ~ +!!! error TS2454: Variable 'i' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.js b/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.js index 8bb5b9aaae827..ae9671f0a76fe 100644 --- a/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.js +++ b/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.js @@ -8,5 +8,6 @@ var i: I; var y = i(""); // y should be string //// [callExpressionWithTypeParameterConstrainedToOuterTypeParameter.js] +"use strict"; var i; var y = i(""); // y should be string diff --git a/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.errors.txt b/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.errors.txt index 14d0e666de94e..0bdfe399f0a0b 100644 --- a/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.errors.txt +++ b/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.errors.txt @@ -1,24 +1,35 @@ +callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(4,35): error TS2322: Type 'null' is not assignable to type 'T'. + 'T' could be instantiated with an arbitrary type which could be unrelated to 'null'. callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(5,12): error TS2558: Expected 2 type arguments, but got 1. callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(6,13): error TS2558: Expected 2 type arguments, but got 3. +callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(8,37): error TS2322: Type 'null' is not assignable to type 'T'. + 'T' could be instantiated with an arbitrary type which could be unrelated to 'null'. callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(9,13): error TS2558: Expected 2 type arguments, but got 1. callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(10,14): error TS2558: Expected 2 type arguments, but got 3. callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(13,13): error TS2558: Expected 2 type arguments, but got 1. callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(14,14): error TS2558: Expected 2 type arguments, but got 3. +callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(18,9): error TS2322: Type 'null' is not assignable to type 'T'. + 'T' could be instantiated with an arbitrary type which could be unrelated to 'null'. callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(21,22): error TS2558: Expected 2 type arguments, but got 1. callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(22,23): error TS2558: Expected 2 type arguments, but got 3. callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(28,14): error TS2558: Expected 2 type arguments, but got 1. callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(29,15): error TS2558: Expected 2 type arguments, but got 3. +callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(33,9): error TS2322: Type 'null' is not assignable to type 'T'. + 'T' could be instantiated with an arbitrary type which could be unrelated to 'null'. callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(36,23): error TS2558: Expected 0 type arguments, but got 1. callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(37,24): error TS2558: Expected 0 type arguments, but got 3. callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(43,15): error TS2558: Expected 0 type arguments, but got 1. callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(44,16): error TS2558: Expected 0 type arguments, but got 3. -==== callGenericFunctionWithIncorrectNumberOfTypeArguments.ts (14 errors) ==== +==== callGenericFunctionWithIncorrectNumberOfTypeArguments.ts (18 errors) ==== // type parameter lists must exactly match type argument lists // all of these invocations are errors function f(x: T, y: U): T { return null; } + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'T'. +!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'null'. var r1 = f(1, ''); ~~~~~~ !!! error TS2558: Expected 2 type arguments, but got 1. @@ -27,6 +38,9 @@ callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(44,16): error TS2558: E !!! error TS2558: Expected 2 type arguments, but got 3. var f2 = (x: T, y: U): T => { return null; } + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'T'. +!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'null'. var r2 = f2(1, ''); ~~~~~~ !!! error TS2558: Expected 2 type arguments, but got 1. @@ -45,6 +59,9 @@ callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(44,16): error TS2558: E class C { f(x: T, y: U): T { return null; + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'T'. +!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'null'. } } var r4 = (new C()).f(1, ''); @@ -68,6 +85,9 @@ callGenericFunctionWithIncorrectNumberOfTypeArguments.ts(44,16): error TS2558: E class C2 { f(x: T, y: U): T { return null; + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'T'. +!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'null'. } } var r6 = (new C2()).f(1, ''); diff --git a/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.js b/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.js index 293ff621cbbc2..77b4505621278 100644 --- a/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.js +++ b/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.js @@ -47,6 +47,7 @@ var r7 = i2.f(1, ''); var r7b = i2.f(1, ''); //// [callGenericFunctionWithIncorrectNumberOfTypeArguments.js] +"use strict"; // type parameter lists must exactly match type argument lists // all of these invocations are errors function f(x, y) { return null; } diff --git a/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.errors.txt b/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.errors.txt new file mode 100644 index 0000000000000..2101a8596943c --- /dev/null +++ b/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.errors.txt @@ -0,0 +1,68 @@ +callGenericFunctionWithZeroTypeArguments.ts(3,26): error TS2322: Type 'null' is not assignable to type 'T'. + 'T' could be instantiated with an arbitrary type which could be unrelated to 'null'. +callGenericFunctionWithZeroTypeArguments.ts(6,28): error TS2322: Type 'null' is not assignable to type 'T'. + 'T' could be instantiated with an arbitrary type which could be unrelated to 'null'. +callGenericFunctionWithZeroTypeArguments.ts(10,10): error TS2454: Variable 'f3' is used before being assigned. +callGenericFunctionWithZeroTypeArguments.ts(14,9): error TS2322: Type 'null' is not assignable to type 'T'. + 'T' could be instantiated with an arbitrary type which could be unrelated to 'null'. +callGenericFunctionWithZeroTypeArguments.ts(23,10): error TS2454: Variable 'i' is used before being assigned. +callGenericFunctionWithZeroTypeArguments.ts(27,9): error TS2322: Type 'null' is not assignable to type 'T'. + 'T' could be instantiated with an arbitrary type which could be unrelated to 'null'. +callGenericFunctionWithZeroTypeArguments.ts(36,10): error TS2454: Variable 'i2' is used before being assigned. + + +==== callGenericFunctionWithZeroTypeArguments.ts (7 errors) ==== + // valid invocations of generic functions with no explicit type arguments provided + + function f(x: T): T { return null; } + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'T'. +!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'null'. + var r = f(1); + + var f2 = (x: T): T => { return null; } + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'T'. +!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'null'. + var r2 = f2(1); + + var f3: { (x: T): T; } + var r3 = f3(1); + ~~ +!!! error TS2454: Variable 'f3' is used before being assigned. + + class C { + f(x: T): T { + return null; + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'T'. +!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'null'. + } + } + var r4 = (new C()).f(1); + + interface I { + f(x: T): T; + } + var i: I; + var r5 = i.f(1); + ~ +!!! error TS2454: Variable 'i' is used before being assigned. + + class C2 { + f(x: T): T { + return null; + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'T'. +!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'null'. + } + } + var r6 = (new C2()).f(1); + + interface I2 { + f(x: T): T; + } + var i2: I2; + var r7 = i2.f(1); + ~~ +!!! error TS2454: Variable 'i2' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.js b/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.js index c3551a68add46..bb651cd6ccec4 100644 --- a/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.js +++ b/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.js @@ -39,6 +39,7 @@ var i2: I2; var r7 = i2.f(1); //// [callGenericFunctionWithZeroTypeArguments.js] +"use strict"; // valid invocations of generic functions with no explicit type arguments provided function f(x) { return null; } var r = f(1); diff --git a/tests/baselines/reference/callNonGenericFunctionWithTypeArguments.js b/tests/baselines/reference/callNonGenericFunctionWithTypeArguments.js index 9940f580d956c..60bf2be74b57c 100644 --- a/tests/baselines/reference/callNonGenericFunctionWithTypeArguments.js +++ b/tests/baselines/reference/callNonGenericFunctionWithTypeArguments.js @@ -46,6 +46,7 @@ declare var a2: any; var r8 = a2(); //// [callNonGenericFunctionWithTypeArguments.js] +"use strict"; // it is always illegal to provide type arguments to a non-generic function // all invocations here are illegal function f(x) { return null; } diff --git a/tests/baselines/reference/callOnClass.js b/tests/baselines/reference/callOnClass.js index f4236139f71fe..762b3d59eae97 100644 --- a/tests/baselines/reference/callOnClass.js +++ b/tests/baselines/reference/callOnClass.js @@ -7,6 +7,7 @@ var c = C(); //// [callOnClass.js] +"use strict"; class C { } var c = C(); diff --git a/tests/baselines/reference/callOnInstance.js b/tests/baselines/reference/callOnInstance.js index b8f4ac6adfc49..d00e29d4c61e5 100644 --- a/tests/baselines/reference/callOnInstance.js +++ b/tests/baselines/reference/callOnInstance.js @@ -13,6 +13,7 @@ declare class C { constructor(value: number); } (new C(1))(); // Error for calling an instance //// [callOnInstance.js] +"use strict"; var s1 = D(); // OK var s2 = (new D(1))(); (new C(1))(); // Error for calling an instance diff --git a/tests/baselines/reference/callOverload.js b/tests/baselines/reference/callOverload.js index 5d56f5a9d966f..e46b10f6e340a 100644 --- a/tests/baselines/reference/callOverload.js +++ b/tests/baselines/reference/callOverload.js @@ -14,6 +14,7 @@ withRest(); withRest(...n); //// [callOverload.js] +"use strict"; fn(1); // no error fn(1, 2, 3, 4); takeTwo(1, 2, 3, 4); diff --git a/tests/baselines/reference/callOverloadViaElementAccessExpression.js b/tests/baselines/reference/callOverloadViaElementAccessExpression.js index a0286e6614b78..cc0a7206fa54f 100644 --- a/tests/baselines/reference/callOverloadViaElementAccessExpression.js +++ b/tests/baselines/reference/callOverloadViaElementAccessExpression.js @@ -14,6 +14,7 @@ var r: string = c['foo'](1); var r2: number = c['foo'](''); //// [callOverloadViaElementAccessExpression.js] +"use strict"; class C { foo(x) { return null; diff --git a/tests/baselines/reference/callOverloads1.js b/tests/baselines/reference/callOverloads1.js index 695f5d5d7ab6b..7082bab364933 100644 --- a/tests/baselines/reference/callOverloads1.js +++ b/tests/baselines/reference/callOverloads1.js @@ -20,6 +20,7 @@ f1.bar1(); Foo(); //// [callOverloads1.js] +"use strict"; class Foo { bar1() { } constructor(x) { diff --git a/tests/baselines/reference/callOverloads2.js b/tests/baselines/reference/callOverloads2.js index 0f51e6ccf4d35..e18ff86c89cff 100644 --- a/tests/baselines/reference/callOverloads2.js +++ b/tests/baselines/reference/callOverloads2.js @@ -26,6 +26,7 @@ Foo(); //// [callOverloads2.js] +"use strict"; class Foo { bar1() { } constructor(x) { diff --git a/tests/baselines/reference/callOverloads3.js b/tests/baselines/reference/callOverloads3.js index 46091313c45c0..768ddf2582179 100644 --- a/tests/baselines/reference/callOverloads3.js +++ b/tests/baselines/reference/callOverloads3.js @@ -20,6 +20,7 @@ Foo("s"); //// [callOverloads3.js] +"use strict"; class Foo { bar1() { } constructor(x) { diff --git a/tests/baselines/reference/callOverloads4.js b/tests/baselines/reference/callOverloads4.js index 92e3c99f096a7..050f8d31ac469 100644 --- a/tests/baselines/reference/callOverloads4.js +++ b/tests/baselines/reference/callOverloads4.js @@ -20,6 +20,7 @@ Foo("s"); //// [callOverloads4.js] +"use strict"; class Foo { bar1() { } constructor(x) { diff --git a/tests/baselines/reference/callOverloads5.js b/tests/baselines/reference/callOverloads5.js index f424aa5461677..04d9010e2b50a 100644 --- a/tests/baselines/reference/callOverloads5.js +++ b/tests/baselines/reference/callOverloads5.js @@ -22,6 +22,7 @@ Foo("s"); //// [callOverloads5.js] +"use strict"; class Foo { bar1(a) { } constructor(x) { diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance.js index 5ef702d2a022e..5b9fd286e9506 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance.js @@ -70,3 +70,4 @@ namespace MemberWithCallSignature { } //// [callSignatureAssignabilityInInheritance.js] +"use strict"; diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance2.errors.txt b/tests/baselines/reference/callSignatureAssignabilityInInheritance2.errors.txt new file mode 100644 index 0000000000000..86dcca9c344fc --- /dev/null +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance2.errors.txt @@ -0,0 +1,84 @@ +callSignatureAssignabilityInInheritance2.ts(3,14): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. +callSignatureAssignabilityInInheritance2.ts(4,30): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. +callSignatureAssignabilityInInheritance2.ts(5,34): error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. +callSignatureAssignabilityInInheritance2.ts(6,35): error TS2564: Property 'bing' has no initializer and is not definitely assigned in the constructor. + + +==== callSignatureAssignabilityInInheritance2.ts (4 errors) ==== + // checking subtype relations for function types as it relates to contextual signature instantiation + + class Base { foo: string; } + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. + class Derived extends Base { bar: string; } + ~~~ +!!! error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. + class Derived2 extends Derived { baz: string; } + ~~~ +!!! error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. + class OtherDerived extends Base { bing: string; } + ~~~~ +!!! error TS2564: Property 'bing' has no initializer and is not definitely assigned in the constructor. + + interface A { // T + // M's + a: (x: number) => number[]; + a2: (x: number) => string[]; + a3: (x: number) => void; + a4: (x: string, y: number) => string; + a5: (x: (arg: string) => number) => string; + a6: (x: (arg: Base) => Derived) => Base; + a7: (x: (arg: Base) => Derived) => (r: Base) => Derived; + a8: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; + a9: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; + a10: (...x: Derived[]) => Derived; + a11: (x: { foo: string }, y: { foo: string; bar: string }) => Base; + a12: (x: Array, y: Array) => Array; + a13: (x: Array, y: Array) => Array; + a14: (x: { a: string; b: number }) => Object; + a15: { + (x: number): number[]; + (x: string): string[]; + }; + a16: { + (x: T): number[]; + (x: U): number[]; + }; + a17: { + (x: (a: number) => number): number[]; + (x: (a: string) => string): string[]; + }; + a18: { + (x: { + (a: number): number; + (a: string): string; + }): any[]; + (x: { + (a: boolean): boolean; + (a: Date): Date; + }): any[]; + }; + } + + // S's + interface I extends A { + // N's + a: (x: T) => T[]; // ok, instantiation of N is a subtype of M, T is number + a2: (x: T) => string[]; // ok + a3: (x: T) => T; // ok since Base returns void + a4: (x: T, y: U) => T; // ok, instantiation of N is a subtype of M, T is string, U is number + a5: (x: (arg: T) => U) => T; // ok, U is in a parameter position so inferences can be made + a6: (x: (arg: T) => U) => T; // ok, same as a5 but with object type hierarchy + a7: (x: (arg: T) => U) => (r: T) => U; // ok + a8: (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U; // ok + a9: (x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U; // ok, same as a8 with compatible object literal + a10: (...x: T[]) => T; // ok + a11: (x: T, y: T) => T; // ok + a12: >(x: Array, y: T) => Array; // ok, less specific parameter type + a13: >(x: Array, y: T) => T; // ok, T = Array, satisfies constraint, contextual signature instantiation succeeds + a14: (x: { a: T; b: U }) => T; // ok + a15: (x: T) => T[]; // ok + a16: (x: T) => number[]; // ok + a17: (x: (a: T) => T) => T[]; // ok + a18: (x: (a: T) => T) => T[]; // ok, no inferences for T but assignable to any + } \ No newline at end of file diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance2.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance2.js index 50366ac744ec6..46a3cdc4b4165 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance2.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance2.js @@ -72,6 +72,7 @@ interface I extends A { } //// [callSignatureAssignabilityInInheritance2.js] +"use strict"; // checking subtype relations for function types as it relates to contextual signature instantiation class Base { } diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt index 291b641998b8b..ff09a56eb7d65 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt @@ -1,3 +1,7 @@ +callSignatureAssignabilityInInheritance3.ts(5,18): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. +callSignatureAssignabilityInInheritance3.ts(6,34): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. +callSignatureAssignabilityInInheritance3.ts(7,38): error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. +callSignatureAssignabilityInInheritance3.ts(8,39): error TS2564: Property 'bing' has no initializer and is not definitely assigned in the constructor. callSignatureAssignabilityInInheritance3.ts(51,19): error TS2430: Interface 'I2' incorrectly extends interface 'A'. Types of property 'a2' are incompatible. Type '(x: T) => U[]' is not assignable to type '(x: number) => string[]'. @@ -12,6 +16,16 @@ callSignatureAssignabilityInInheritance3.ts(60,19): error TS2430: Interface 'I4' Type '{ foo: number; }' is not assignable to type 'Base'. Types of property 'foo' are incompatible. Type 'number' is not assignable to type 'string'. +callSignatureAssignabilityInInheritance3.ts(64,19): error TS2430: Interface 'I4B' incorrectly extends interface 'A'. + Types of property 'a10' are incompatible. + Type '(...x: T[]) => T' is not assignable to type '(...x: Base[]) => Base'. + Types of parameters 'x' and 'x' are incompatible. + Property 'bar' is missing in type 'Base' but required in type 'Derived'. +callSignatureAssignabilityInInheritance3.ts(68,19): error TS2430: Interface 'I4C' incorrectly extends interface 'A'. + Types of property 'a11' are incompatible. + Type '(x: T, y: T) => T' is not assignable to type '(x: { foo: string; }, y: { foo: string; bar: string; }) => Base'. + Types of parameters 'x' and 'x' are incompatible. + Property 'bar' is missing in type '{ foo: string; }' but required in type 'Derived'. callSignatureAssignabilityInInheritance3.ts(76,19): error TS2430: Interface 'I6' incorrectly extends interface 'A'. Types of property 'a15' are incompatible. Type '(x: { a: T; b: T; }) => T' is not assignable to type '(x: { a: string; b: number; }) => number'. @@ -37,15 +51,23 @@ callSignatureAssignabilityInInheritance3.ts(109,19): error TS2430: Interface 'I7 Type 'T' is not assignable to type 'string'. -==== callSignatureAssignabilityInInheritance3.ts (6 errors) ==== +==== callSignatureAssignabilityInInheritance3.ts (12 errors) ==== // checking subtype relations for function types as it relates to contextual signature instantiation // error cases namespace Errors { class Base { foo: string; } + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. class Derived extends Base { bar: string; } + ~~~ +!!! error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. class Derived2 extends Derived { baz: string; } + ~~~ +!!! error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. class OtherDerived extends Base { bing: string; } + ~~~~ +!!! error TS2564: Property 'bing' has no initializer and is not definitely assigned in the constructor. namespace WithNonGenericSignaturesInBaseType { // base type with non-generic call signatures @@ -118,10 +140,24 @@ callSignatureAssignabilityInInheritance3.ts(109,19): error TS2430: Interface 'I7 } interface I4B extends A { + ~~~ +!!! error TS2430: Interface 'I4B' incorrectly extends interface 'A'. +!!! error TS2430: Types of property 'a10' are incompatible. +!!! error TS2430: Type '(...x: T[]) => T' is not assignable to type '(...x: Base[]) => Base'. +!!! error TS2430: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2430: Property 'bar' is missing in type 'Base' but required in type 'Derived'. +!!! related TS2728 callSignatureAssignabilityInInheritance3.ts:6:34: 'bar' is declared here. a10: (...x: T[]) => T; // valid, parameter covariance works even after contextual signature instantiation } interface I4C extends A { + ~~~ +!!! error TS2430: Interface 'I4C' incorrectly extends interface 'A'. +!!! error TS2430: Types of property 'a11' are incompatible. +!!! error TS2430: Type '(x: T, y: T) => T' is not assignable to type '(x: { foo: string; }, y: { foo: string; bar: string; }) => Base'. +!!! error TS2430: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2430: Property 'bar' is missing in type '{ foo: string; }' but required in type 'Derived'. +!!! related TS2728 callSignatureAssignabilityInInheritance3.ts:6:34: 'bar' is declared here. a11: (x: T, y: T) => T; // valid, even though x is a Base, parameter covariance works even after contextual signature instantiation } diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.js index 3b13c93beac64..21e271f08ade1 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.js @@ -116,6 +116,7 @@ namespace Errors { } //// [callSignatureAssignabilityInInheritance3.js] +"use strict"; // checking subtype relations for function types as it relates to contextual signature instantiation // error cases var Errors; diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.types b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.types index 70d90ea1425cb..b9e8a29d6e119 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.types +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.types @@ -136,8 +136,8 @@ namespace Errors { > : ^^^^^^ (a?: number): number; ->a : number -> : ^^^^^^ +>a : number | undefined +> : ^^^^^^^^^^^^^^^^^^ }): number[]; (x: { @@ -149,8 +149,8 @@ namespace Errors { > : ^^^^^^^ (a?: boolean): boolean; ->a : boolean -> : ^^^^^^^ +>a : boolean | undefined +> : ^^^^^^^^^^^^^^^^^^^ }): boolean[]; }; diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance4.errors.txt b/tests/baselines/reference/callSignatureAssignabilityInInheritance4.errors.txt new file mode 100644 index 0000000000000..ce416811f8d3b --- /dev/null +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance4.errors.txt @@ -0,0 +1,64 @@ +callSignatureAssignabilityInInheritance4.ts(3,14): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. +callSignatureAssignabilityInInheritance4.ts(4,30): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. +callSignatureAssignabilityInInheritance4.ts(5,34): error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. +callSignatureAssignabilityInInheritance4.ts(6,35): error TS2564: Property 'bing' has no initializer and is not definitely assigned in the constructor. + + +==== callSignatureAssignabilityInInheritance4.ts (4 errors) ==== + // checking subtype relations for function types as it relates to contextual signature instantiation + + class Base { foo: string; } + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. + class Derived extends Base { bar: string; } + ~~~ +!!! error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. + class Derived2 extends Derived { baz: string; } + ~~~ +!!! error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. + class OtherDerived extends Base { bing: string; } + ~~~~ +!!! error TS2564: Property 'bing' has no initializer and is not definitely assigned in the constructor. + + interface A { // T + // M's + a: (x: T) => T[]; + a2: (x: T) => string[]; + a3: (x: T) => void; + a4: (x: T, y: U) => string; + a5: (x: (arg: T) => U) => T; + a6: (x: (arg: T) => Derived) => T; + a11: (x: { foo: T }, y: { foo: T; bar: T }) => Base; + a15: (x: { a: T; b: T }) => T[]; + a16: (x: { a: T; b: T }) => T[]; + a17: { + (x: (a: T) => T): T[]; + (x: (a: T) => T): T[]; + }; + a18: { + (x: { + (a: T): T; + (a: T): T; + }): any[]; + (x: { + (a: T): T; + (a: T): T; + }): any[]; + }; + } + + // S's + interface I extends A { + // N's + a: (x: T) => T[]; // ok, instantiation of N is a subtype of M, T is number + a2: (x: T) => string[]; // ok + a3: (x: T) => T; // ok since Base returns void + a4: (x: T, y: U) => string; // ok, instantiation of N is a subtype of M, T is string, U is number + a5: (x: (arg: T) => U) => T; // ok, U is in a parameter position so inferences can be made + a6: (x: (arg: T) => U) => T; // ok, same as a5 but with object type hierarchy + a11: (x: { foo: T }, y: { foo: U; bar: U }) => Base; // ok + a15: (x: { a: U; b: V; }) => U[]; // ok, T = U, T = V + a16: (x: { a: T; b: T }) => T[]; // ok, more general parameter type + a17: (x: (a: T) => T) => T[]; // ok + a18: (x: (a: T) => T) => any[]; // ok + } \ No newline at end of file diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance4.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance4.js index 3b491277243d2..6f75501058e8a 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance4.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance4.js @@ -52,6 +52,7 @@ interface I extends A { } //// [callSignatureAssignabilityInInheritance4.js] +"use strict"; // checking subtype relations for function types as it relates to contextual signature instantiation class Base { } diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance5.errors.txt b/tests/baselines/reference/callSignatureAssignabilityInInheritance5.errors.txt new file mode 100644 index 0000000000000..6701fba989b19 --- /dev/null +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance5.errors.txt @@ -0,0 +1,63 @@ +callSignatureAssignabilityInInheritance5.ts(4,14): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. +callSignatureAssignabilityInInheritance5.ts(5,30): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. +callSignatureAssignabilityInInheritance5.ts(6,34): error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. +callSignatureAssignabilityInInheritance5.ts(7,35): error TS2564: Property 'bing' has no initializer and is not definitely assigned in the constructor. + + +==== callSignatureAssignabilityInInheritance5.ts (4 errors) ==== + // 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; } + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. + class Derived extends Base { bar: string; } + ~~~ +!!! error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. + class Derived2 extends Derived { baz: string; } + ~~~ +!!! error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. + class OtherDerived extends Base { bing: string; } + ~~~~ +!!! error TS2564: Property 'bing' has no initializer and is not definitely assigned in the constructor. + + interface A { // T + // M's + a: (x: number) => number[]; + a2: (x: number) => string[]; + a3: (x: number) => void; + a4: (x: string, y: number) => string; + a5: (x: (arg: string) => number) => string; + a6: (x: (arg: Base) => Derived) => Base; + a7: (x: (arg: Base) => Derived) => (r: Base) => Derived; + a8: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; + a9: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; + a10: (...x: Derived[]) => Derived; + a11: (x: { foo: string }, y: { foo: string; bar: string }) => Base; + a12: (x: Array, y: Array) => Array; + a13: (x: Array, y: Array) => Array; + a14: (x: { a: string; b: number }) => Object; + } + + interface B extends A { + a: (x: T) => T[]; + } + + // S's + interface I extends B { + // N's + a: (x: T) => T[]; // ok, instantiation of N is a subtype of M, T is number + a2: (x: T) => string[]; // ok + a3: (x: T) => T; // ok since Base returns void + a4: (x: T, y: U) => T; // ok, instantiation of N is a subtype of M, T is string, U is number + a5: (x: (arg: T) => U) => T; // ok, U is in a parameter position so inferences can be made + a6: (x: (arg: T) => U) => T; // ok, same as a5 but with object type hierarchy + a7: (x: (arg: T) => U) => (r: T) => U; // ok + a8: (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U; // ok + a9: (x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U; // ok, same as a8 with compatible object literal + a10: (...x: T[]) => T; // ok + a11: (x: T, y: T) => T; // ok + a12: >(x: Array, y: T) => Array; // ok, less specific parameter type + a13: >(x: Array, y: T) => T; // ok, T = Array, satisfies constraint, contextual signature instantiation succeeds + a14: (x: { a: T; b: U }) => T; // ok + } \ No newline at end of file diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance5.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance5.js index fa7e58542ce9b..3d32f9f4580ea 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance5.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance5.js @@ -51,6 +51,7 @@ interface I extends B { } //// [callSignatureAssignabilityInInheritance5.js] +"use strict"; // 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 { diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance6.errors.txt b/tests/baselines/reference/callSignatureAssignabilityInInheritance6.errors.txt index e4812b4b85da5..759ea04673316 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance6.errors.txt +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance6.errors.txt @@ -1,3 +1,7 @@ +callSignatureAssignabilityInInheritance6.ts(5,14): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. +callSignatureAssignabilityInInheritance6.ts(6,30): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. +callSignatureAssignabilityInInheritance6.ts(7,34): error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. +callSignatureAssignabilityInInheritance6.ts(8,35): error TS2564: Property 'bing' has no initializer and is not definitely assigned in the constructor. callSignatureAssignabilityInInheritance6.ts(24,11): error TS2430: Interface 'I' incorrectly extends interface 'A'. Types of property 'a' are incompatible. Type '(x: T) => T[]' is not assignable to type '(x: T) => T[]'. @@ -47,15 +51,23 @@ callSignatureAssignabilityInInheritance6.ts(48,11): error TS2430: Interface 'I9< 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'. -==== callSignatureAssignabilityInInheritance6.ts (7 errors) ==== +==== callSignatureAssignabilityInInheritance6.ts (11 errors) ==== // 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; } + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. class Derived extends Base { bar: string; } + ~~~ +!!! error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. class Derived2 extends Derived { baz: string; } + ~~~ +!!! error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. class OtherDerived extends Base { bing: string; } + ~~~~ +!!! error TS2564: Property 'bing' has no initializer and is not definitely assigned in the constructor. interface A { // T // M's diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance6.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance6.js index 46a6bd0d20b46..fc15761e2359f 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance6.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance6.js @@ -53,6 +53,7 @@ interface I9 extends A { } //// [callSignatureAssignabilityInInheritance6.js] +"use strict"; // 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 diff --git a/tests/baselines/reference/callSignatureFunctionOverload.js b/tests/baselines/reference/callSignatureFunctionOverload.js index d1bf5643567c1..40646b608f60f 100644 --- a/tests/baselines/reference/callSignatureFunctionOverload.js +++ b/tests/baselines/reference/callSignatureFunctionOverload.js @@ -17,5 +17,6 @@ var foo2: { //// [callSignatureFunctionOverload.js] +"use strict"; var foo; var foo2; diff --git a/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.js b/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.js index e8b84d9870327..d345a6ab4a39a 100644 --- a/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.js +++ b/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.js @@ -58,6 +58,7 @@ b.b(1); //// [callSignatureWithOptionalParameterAndInitializer.js] +"use strict"; // Optional parameters cannot also have initializer expressions, these are all errors function foo(x = 1) { } var f = function foo(x = 1) { }; diff --git a/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.js b/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.js index 4cd7b156b0d30..0f543ddf56435 100644 --- a/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.js +++ b/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.js @@ -22,6 +22,7 @@ var r4 = a(); var r5 = a.f(); //// [callSignatureWithoutAnnotationsOrBody.js] +"use strict"; // Call signatures without a return type annotation and function body return 'any' function foo(x) { } var r = foo(1); // void since there's a body diff --git a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.js b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.js index 9624e33d1bb22..6c97fa886a5e9 100644 --- a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.js +++ b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.js @@ -123,6 +123,7 @@ function foo15() { var r15 = foo15(); //// [callSignatureWithoutReturnTypeAnnotationInference.js] +"use strict"; // Call signatures without a return type should infer one from the function body (if present) // Simple types function foo(x) { diff --git a/tests/baselines/reference/callSignaturesShouldBeResolvedBeforeSpecialization.js b/tests/baselines/reference/callSignaturesShouldBeResolvedBeforeSpecialization.js index fa6b73519fe50..6cf5c6538715f 100644 --- a/tests/baselines/reference/callSignaturesShouldBeResolvedBeforeSpecialization.js +++ b/tests/baselines/reference/callSignaturesShouldBeResolvedBeforeSpecialization.js @@ -13,6 +13,7 @@ function foo() { } //// [callSignaturesShouldBeResolvedBeforeSpecialization.js] +"use strict"; function foo() { var test; test("expects boolean instead of string"); // should not error - "test" should not expect a boolean diff --git a/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType.js b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType.js index 53ae65599d92b..706d9b53c867a 100644 --- a/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType.js +++ b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType.js @@ -31,5 +31,6 @@ var a2: { } //// [callSignaturesThatDifferOnlyByReturnType.js] +"use strict"; var a; var a2; diff --git a/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.js b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.js index 13da70445befb..f14de4d39ab89 100644 --- a/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.js +++ b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.js @@ -17,6 +17,7 @@ var r2 = x.foo(''); // error //// [callSignaturesThatDifferOnlyByReturnType2.js] +"use strict"; // Normally it is an error to have multiple overloads which differ only by return type in a single type declaration. // Here the multiple overloads come from multiple bases. // BUG 822524 diff --git a/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType3.js b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType3.js index d9ba902f71e74..3e49f46ddbb34 100644 --- a/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType3.js +++ b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType3.js @@ -21,5 +21,6 @@ interface I2 { } //// [callSignaturesThatDifferOnlyByReturnType3.js] +"use strict"; // 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. diff --git a/tests/baselines/reference/callSignaturesWithAccessibilityModifiersOnParameters.js b/tests/baselines/reference/callSignaturesWithAccessibilityModifiersOnParameters.js index 6fbb336bb8b6f..39c5ebeca9331 100644 --- a/tests/baselines/reference/callSignaturesWithAccessibilityModifiersOnParameters.js +++ b/tests/baselines/reference/callSignaturesWithAccessibilityModifiersOnParameters.js @@ -41,6 +41,7 @@ var b = { } //// [callSignaturesWithAccessibilityModifiersOnParameters.js] +"use strict"; // Call signature parameters do not allow accessibility modifiers function foo(x, y) { } var f = function foo(x, y) { }; diff --git a/tests/baselines/reference/callSignaturesWithDuplicateParameters.js b/tests/baselines/reference/callSignaturesWithDuplicateParameters.js index 62498a8500fe6..e12292325de3a 100644 --- a/tests/baselines/reference/callSignaturesWithDuplicateParameters.js +++ b/tests/baselines/reference/callSignaturesWithDuplicateParameters.js @@ -41,6 +41,7 @@ var b = { } //// [callSignaturesWithDuplicateParameters.js] +"use strict"; // Duplicate parameter names are always an error function foo(x, x) { } var f = function foo(x, x) { }; diff --git a/tests/baselines/reference/callSignaturesWithOptionalParameters.js b/tests/baselines/reference/callSignaturesWithOptionalParameters.js index 1ace9470e703c..695320ec00e16 100644 --- a/tests/baselines/reference/callSignaturesWithOptionalParameters.js +++ b/tests/baselines/reference/callSignaturesWithOptionalParameters.js @@ -58,6 +58,7 @@ b.b(1); //// [callSignaturesWithOptionalParameters.js] +"use strict"; // Optional parameters should be valid in all the below casts function foo(x) { } var f = function foo(x) { }; diff --git a/tests/baselines/reference/callSignaturesWithOptionalParameters2.js b/tests/baselines/reference/callSignaturesWithOptionalParameters2.js index 5849798188b21..5468d4830e0f9 100644 --- a/tests/baselines/reference/callSignaturesWithOptionalParameters2.js +++ b/tests/baselines/reference/callSignaturesWithOptionalParameters2.js @@ -62,6 +62,7 @@ a.foo(1, 2); a.foo(1, 2, 3); //// [callSignaturesWithOptionalParameters2.js] +"use strict"; // Optional parameters should be valid in all the below casts function foo(x) { } foo(1); diff --git a/tests/baselines/reference/callSignaturesWithParameterInitializers.js b/tests/baselines/reference/callSignaturesWithParameterInitializers.js index fe85cd11cd4d0..a9010fbf34647 100644 --- a/tests/baselines/reference/callSignaturesWithParameterInitializers.js +++ b/tests/baselines/reference/callSignaturesWithParameterInitializers.js @@ -60,6 +60,7 @@ b.b(1); //// [callSignaturesWithParameterInitializers.js] +"use strict"; // Optional parameters allow initializers only in implementation signatures function foo(x = 1) { } var f = function foo(x = 1) { }; diff --git a/tests/baselines/reference/callSignaturesWithParameterInitializers2.js b/tests/baselines/reference/callSignaturesWithParameterInitializers2.js index 278c39d54c53c..026653fb0a8e2 100644 --- a/tests/baselines/reference/callSignaturesWithParameterInitializers2.js +++ b/tests/baselines/reference/callSignaturesWithParameterInitializers2.js @@ -28,6 +28,7 @@ b.foo(); b.foo(1); //// [callSignaturesWithParameterInitializers2.js] +"use strict"; // Optional parameters allow initializers only in implementation signatures // All the below declarations are errors function foo(x = 1) { } diff --git a/tests/baselines/reference/callWithSpread.errors.txt b/tests/baselines/reference/callWithSpread.errors.txt new file mode 100644 index 0000000000000..0bfd01809c281 --- /dev/null +++ b/tests/baselines/reference/callWithSpread.errors.txt @@ -0,0 +1,163 @@ +callWithSpread.ts(14,14): error TS2454: Variable 'a' is used before being assigned. +callWithSpread.ts(15,14): error TS2454: Variable 'a' is used before being assigned. +callWithSpread.ts(17,1): error TS2454: Variable 'obj' is used before being assigned. +callWithSpread.ts(18,1): error TS2454: Variable 'obj' is used before being assigned. +callWithSpread.ts(18,18): error TS2454: Variable 'a' is used before being assigned. +callWithSpread.ts(19,1): error TS2454: Variable 'obj' is used before being assigned. +callWithSpread.ts(19,18): error TS2454: Variable 'a' is used before being assigned. +callWithSpread.ts(21,1): error TS2454: Variable 'obj' is used before being assigned. +callWithSpread.ts(21,18): error TS2454: Variable 'a' is used before being assigned. +callWithSpread.ts(22,1): error TS2454: Variable 'obj' is used before being assigned. +callWithSpread.ts(22,18): error TS2454: Variable 'a' is used before being assigned. +callWithSpread.ts(22,34): error TS2454: Variable 'a' is used before being assigned. +callWithSpread.ts(23,1): error TS2454: Variable 'obj' is used before being assigned. +callWithSpread.ts(23,18): error TS2454: Variable 'a' is used before being assigned. +callWithSpread.ts(23,34): error TS2454: Variable 'a' is used before being assigned. +callWithSpread.ts(25,2): error TS2454: Variable 'obj' is used before being assigned. +callWithSpread.ts(26,2): error TS2454: Variable 'obj' is used before being assigned. +callWithSpread.ts(26,20): error TS2454: Variable 'a' is used before being assigned. +callWithSpread.ts(27,2): error TS2454: Variable 'obj' is used before being assigned. +callWithSpread.ts(27,20): error TS2454: Variable 'a' is used before being assigned. +callWithSpread.ts(29,3): error TS2454: Variable 'obj' is used before being assigned. +callWithSpread.ts(29,21): error TS2454: Variable 'a' is used before being assigned. +callWithSpread.ts(30,3): error TS2454: Variable 'obj' is used before being assigned. +callWithSpread.ts(30,21): error TS2454: Variable 'a' is used before being assigned. +callWithSpread.ts(30,38): error TS2454: Variable 'a' is used before being assigned. +callWithSpread.ts(31,3): error TS2454: Variable 'obj' is used before being assigned. +callWithSpread.ts(31,21): error TS2454: Variable 'a' is used before being assigned. +callWithSpread.ts(31,38): error TS2454: Variable 'a' is used before being assigned. +callWithSpread.ts(33,1): error TS2454: Variable 'xa' is used before being assigned. +callWithSpread.ts(34,1): error TS2454: Variable 'xa' is used before being assigned. +callWithSpread.ts(34,20): error TS2454: Variable 'a' is used before being assigned. +callWithSpread.ts(35,1): error TS2454: Variable 'xa' is used before being assigned. +callWithSpread.ts(35,20): error TS2454: Variable 'a' is used before being assigned. +callWithSpread.ts(37,12): error TS2454: Variable 'xa' is used before being assigned. + + +==== callWithSpread.ts (34 errors) ==== + interface X { + foo(x: number, y: number, ...z: string[]): X; + } + + function foo(x: number, y: number, ...z: string[]) { + } + + var a: string[]; + var z: number[]; + var obj: X; + var xa: X[]; + + foo(1, 2, "abc"); + foo(1, 2, ...a); + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + foo(1, 2, ...a, "abc"); + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + + obj.foo(1, 2, "abc"); + ~~~ +!!! error TS2454: Variable 'obj' is used before being assigned. + obj.foo(1, 2, ...a); + ~~~ +!!! error TS2454: Variable 'obj' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + obj.foo(1, 2, ...a, "abc"); + ~~~ +!!! error TS2454: Variable 'obj' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + + obj.foo(1, 2, ...a).foo(1, 2, "abc"); + ~~~ +!!! error TS2454: Variable 'obj' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + obj.foo(1, 2, ...a).foo(1, 2, ...a); + ~~~ +!!! error TS2454: Variable 'obj' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + obj.foo(1, 2, ...a).foo(1, 2, ...a, "abc"); + ~~~ +!!! error TS2454: Variable 'obj' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + + (obj.foo)(1, 2, "abc"); + ~~~ +!!! error TS2454: Variable 'obj' is used before being assigned. + (obj.foo)(1, 2, ...a); + ~~~ +!!! error TS2454: Variable 'obj' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + (obj.foo)(1, 2, ...a, "abc"); + ~~~ +!!! error TS2454: Variable 'obj' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + + ((obj.foo)(1, 2, ...a).foo)(1, 2, "abc"); + ~~~ +!!! error TS2454: Variable 'obj' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + ((obj.foo)(1, 2, ...a).foo)(1, 2, ...a); + ~~~ +!!! error TS2454: Variable 'obj' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + ((obj.foo)(1, 2, ...a).foo)(1, 2, ...a, "abc"); + ~~~ +!!! error TS2454: Variable 'obj' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + + xa[1].foo(1, 2, "abc"); + ~~ +!!! error TS2454: Variable 'xa' is used before being assigned. + xa[1].foo(1, 2, ...a); + ~~ +!!! error TS2454: Variable 'xa' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + xa[1].foo(1, 2, ...a, "abc"); + ~~ +!!! error TS2454: Variable 'xa' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + + (xa[1].foo)(...[1, 2, "abc"]); + ~~ +!!! error TS2454: Variable 'xa' is used before being assigned. + + class C { + constructor(x: number, y: number, ...z: string[]) { + this.foo(x, y); + this.foo(x, y, ...z); + } + foo(x: number, y: number, ...z: string[]) { + } + } + + class D extends C { + constructor() { + super(1, 2); + super(1, 2, ...a); + } + foo() { + super.foo(1, 2); + super.foo(1, 2, ...a); + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/callWithSpread.js b/tests/baselines/reference/callWithSpread.js index decc82fdeeb7b..c60053c456e78 100644 --- a/tests/baselines/reference/callWithSpread.js +++ b/tests/baselines/reference/callWithSpread.js @@ -61,6 +61,7 @@ class D extends C { //// [callWithSpread.js] +"use strict"; function foo(x, y, ...z) { } var a; diff --git a/tests/baselines/reference/callWithSpread.types b/tests/baselines/reference/callWithSpread.types index 8aef499d6fd7e..097d5ca077bd5 100644 --- a/tests/baselines/reference/callWithSpread.types +++ b/tests/baselines/reference/callWithSpread.types @@ -468,6 +468,7 @@ xa[1].foo(1, 2, ...a, "abc"); (xa[1].foo)(...[1, 2, "abc"]); >(xa[1].foo)(...[1, 2, "abc"]) : any +> : ^^^ >(xa[1].foo) : Function > : ^^^^^^^^ >xa[1].foo : Function diff --git a/tests/baselines/reference/callWithSpread2.errors.txt b/tests/baselines/reference/callWithSpread2.errors.txt index 495fc3eddfc94..ec4627f8260c7 100644 --- a/tests/baselines/reference/callWithSpread2.errors.txt +++ b/tests/baselines/reference/callWithSpread2.errors.txt @@ -1,12 +1,12 @@ callWithSpread2.ts(23,13): error TS2556: A spread argument must either have a tuple type or be passed to a rest parameter. callWithSpread2.ts(24,7): error TS2556: A spread argument must either have a tuple type or be passed to a rest parameter. -callWithSpread2.ts(27,5): error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number'. +callWithSpread2.ts(27,5): error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number | undefined'. Type 'string' is not assignable to type 'number'. callWithSpread2.ts(28,5): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. -callWithSpread2.ts(29,13): error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number'. +callWithSpread2.ts(29,13): error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number | undefined'. Type 'string' is not assignable to type 'number'. callWithSpread2.ts(30,13): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. -callWithSpread2.ts(31,11): error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number'. +callWithSpread2.ts(31,11): error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number | undefined'. Type 'string' is not assignable to type 'number'. callWithSpread2.ts(32,11): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. callWithSpread2.ts(33,8): error TS2556: A spread argument must either have a tuple type or be passed to a rest parameter. @@ -48,21 +48,21 @@ callWithSpread2.ts(36,14): error TS2556: A spread argument must either have a tu // bad all(...mixed) ~~~~~~~~ -!!! error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number | undefined'. !!! error TS2345: Type 'string' is not assignable to type 'number'. all(...tuple) ~~~~~~~~ !!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. prefix("b", ...mixed) ~~~~~~~~ -!!! error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number | undefined'. !!! error TS2345: Type 'string' is not assignable to type 'number'. prefix("c", ...tuple) ~~~~~~~~ !!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. rest("e", ...mixed) ~~~~~~~~ -!!! error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number'. +!!! error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'number | undefined'. !!! error TS2345: Type 'string' is not assignable to type 'number'. rest("f", ...tuple) ~~~~~~~~ diff --git a/tests/baselines/reference/callWithSpread2.js b/tests/baselines/reference/callWithSpread2.js index dc74992a43c76..c0f5c8104db89 100644 --- a/tests/baselines/reference/callWithSpread2.js +++ b/tests/baselines/reference/callWithSpread2.js @@ -40,6 +40,7 @@ prefix2("g", ...ns); //// [callWithSpread2.js] +"use strict"; // good all(...ns); weird(...ns); diff --git a/tests/baselines/reference/callWithSpread2.types b/tests/baselines/reference/callWithSpread2.types index 46bc52ec63880..3af747b389b87 100644 --- a/tests/baselines/reference/callWithSpread2.types +++ b/tests/baselines/reference/callWithSpread2.types @@ -4,38 +4,38 @@ declare function all(a?: number, b?: number): void; >all : (a?: number, b?: number) => void > : ^ ^^^ ^^ ^^^ ^^^^^ ->a : number -> : ^^^^^^ ->b : number -> : ^^^^^^ +>a : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>b : number | undefined +> : ^^^^^^^^^^^^^^^^^^ declare function weird(a?: number | string, b?: number | string): void; >weird : (a?: number | string, b?: number | string) => void > : ^ ^^^ ^^ ^^^ ^^^^^ ->a : string | number -> : ^^^^^^^^^^^^^^^ ->b : string | number -> : ^^^^^^^^^^^^^^^ +>a : string | number | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>b : string | number | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ declare function prefix(s: string, a?: number, b?: number): void; >prefix : (s: string, a?: number, b?: number) => void > : ^ ^^ ^^ ^^^ ^^ ^^^ ^^^^^ >s : string > : ^^^^^^ ->a : number -> : ^^^^^^ ->b : number -> : ^^^^^^ +>a : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>b : number | undefined +> : ^^^^^^^^^^^^^^^^^^ declare function rest(s: string, a?: number, b?: number, ...rest: number[]): void; >rest : (s: string, a?: number, b?: number, ...rest: number[]) => void > : ^ ^^ ^^ ^^^ ^^ ^^^ ^^^^^ ^^ ^^^^^ >s : string > : ^^^^^^ ->a : number -> : ^^^^^^ ->b : number -> : ^^^^^^ +>a : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>b : number | undefined +> : ^^^^^^^^^^^^^^^^^^ >rest : number[] > : ^^^^^^^^ @@ -56,10 +56,10 @@ declare function prefix2(s: string, n: number, a?: number, b?: number): void; > : ^^^^^^ >n : number > : ^^^^^^ ->a : number -> : ^^^^^^ ->b : number -> : ^^^^^^ +>a : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>b : number | undefined +> : ^^^^^^^^^^^^^^^^^^ declare var ns: number[]; >ns : number[] diff --git a/tests/baselines/reference/callWithSpread3.js b/tests/baselines/reference/callWithSpread3.js index 38eba460de814..e00f0c4ad7e40 100644 --- a/tests/baselines/reference/callWithSpread3.js +++ b/tests/baselines/reference/callWithSpread3.js @@ -39,6 +39,7 @@ fs5(...s2, "foo", ...s2); //// [callWithSpread3.js] +"use strict"; // error fs2('a', ...s2); // error on ...s2 fs2('a', 'b', 'c', ...s2); // error on 'c' and ...s2 diff --git a/tests/baselines/reference/callWithSpread5.errors.txt b/tests/baselines/reference/callWithSpread5.errors.txt index 2ccf2765e4750..c3794a8b7d176 100644 --- a/tests/baselines/reference/callWithSpread5.errors.txt +++ b/tests/baselines/reference/callWithSpread5.errors.txt @@ -1,13 +1,18 @@ +callWithSpread5.ts(6,4): error TS2345: Argument of type 'number | undefined' is not assignable to parameter of type 'number'. + Type 'undefined' is not assignable to type 'number'. callWithSpread5.ts(7,4): error TS2556: A spread argument must either have a tuple type or be passed to a rest parameter. -==== callWithSpread5.ts (1 errors) ==== +==== callWithSpread5.ts (2 errors) ==== declare const x: number declare const nnnu: [number, number, number?] declare const nntnnnt: [number, number] | [number, number, number] declare function fn(a: number, b: number, bb: number, ...c: number[]): number fn(...nnnu, x) + ~~~~~~~ +!!! error TS2345: Argument of type 'number | undefined' is not assignable to parameter of type 'number'. +!!! error TS2345: Type 'undefined' is not assignable to type 'number'. fn(...nntnnnt, x) ~~~~~~~~~~ !!! error TS2556: A spread argument must either have a tuple type or be passed to a rest parameter. diff --git a/tests/baselines/reference/callWithSpread5.js b/tests/baselines/reference/callWithSpread5.js index 9b29d0b577f0f..7fccdfe928b24 100644 --- a/tests/baselines/reference/callWithSpread5.js +++ b/tests/baselines/reference/callWithSpread5.js @@ -11,5 +11,6 @@ fn(...nntnnnt, x) //// [callWithSpread5.js] +"use strict"; fn(...nnnu, x); fn(...nntnnnt, x); diff --git a/tests/baselines/reference/callWithSpread5.types b/tests/baselines/reference/callWithSpread5.types index 85ef8ce296437..7fb4279c1f84f 100644 --- a/tests/baselines/reference/callWithSpread5.types +++ b/tests/baselines/reference/callWithSpread5.types @@ -6,8 +6,8 @@ declare const x: number > : ^^^^^^ declare const nnnu: [number, number, number?] ->nnnu : [number, number, number?] -> : ^^^^^^^^^^^^^^^^^^^^^^^^^ +>nnnu : [number, number, (number | undefined)?] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ declare const nntnnnt: [number, number] | [number, number, number] >nntnnnt : [number, number] | [number, number, number] @@ -30,10 +30,10 @@ fn(...nnnu, x) > : ^^^^^^ >fn : (a: number, b: number, bb: number, ...c: number[]) => number > : ^ ^^ ^^ ^^ ^^ ^^ ^^^^^ ^^ ^^^^^ ->...nnnu : number -> : ^^^^^^ ->nnnu : [number, number, number?] -> : ^^^^^^^^^^^^^^^^^^^^^^^^^ +>...nnnu : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>nnnu : [number, number, (number | undefined)?] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >x : number > : ^^^^^^ diff --git a/tests/baselines/reference/callWithSpreadES6.js b/tests/baselines/reference/callWithSpreadES6.js index f322034c5fa79..8fbe69feddda7 100644 --- a/tests/baselines/reference/callWithSpreadES6.js +++ b/tests/baselines/reference/callWithSpreadES6.js @@ -53,6 +53,7 @@ class D extends C { //// [callWithSpreadES6.js] +"use strict"; function foo(x, y, ...z) { } var a; diff --git a/tests/baselines/reference/callWithWrongNumberOfTypeArguments.js b/tests/baselines/reference/callWithWrongNumberOfTypeArguments.js index 21d3df12cbbe1..aa7a4bd175bba 100644 --- a/tests/baselines/reference/callWithWrongNumberOfTypeArguments.js +++ b/tests/baselines/reference/callWithWrongNumberOfTypeArguments.js @@ -8,6 +8,7 @@ f(); f(); //// [callWithWrongNumberOfTypeArguments.js] +"use strict"; function f() { } f(); f(); diff --git a/tests/baselines/reference/callbackArgsDifferByOptionality.js b/tests/baselines/reference/callbackArgsDifferByOptionality.js index a9baa81b477a8..296c8a11dd15b 100644 --- a/tests/baselines/reference/callbackArgsDifferByOptionality.js +++ b/tests/baselines/reference/callbackArgsDifferByOptionality.js @@ -8,6 +8,7 @@ function x3(callback: (x: any) => number) { } //// [callbackArgsDifferByOptionality.js] +"use strict"; function x3(callback) { cb(); } diff --git a/tests/baselines/reference/callbackOnConstructor.types b/tests/baselines/reference/callbackOnConstructor.types index 70e112b4adfc9..f03f0bdc88e2d 100644 --- a/tests/baselines/reference/callbackOnConstructor.types +++ b/tests/baselines/reference/callbackOnConstructor.types @@ -24,8 +24,8 @@ export class Preferences { var ooscope2 = s => s.length > 0 >ooscope2 : (name: string) => boolean | number | string | undefined > : ^ ^^ ^^^^^ ->s => s.length > 0 : (s: string) => string | number | boolean -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>s => s.length > 0 : (s: string) => string | number | boolean | undefined +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >s : string > : ^^^^^^ >s.length > 0 : boolean diff --git a/tests/baselines/reference/callbackTagNamespace.types b/tests/baselines/reference/callbackTagNamespace.types index cde356b407a60..f5872109c20cc 100644 --- a/tests/baselines/reference/callbackTagNamespace.types +++ b/tests/baselines/reference/callbackTagNamespace.types @@ -15,10 +15,12 @@ var x = 1; /** @type {NS.Nested.Inner} */ function f(space, peace) { ->f : (space: any, peace: any) => string | number -> : ^ ^^^^^^^ ^^^^^^^^^^ ->space : any ->peace : any +>f : (space: Object, peace: Object) => string | number +> : ^ ^^ ^^ ^^ ^^^^^ +>space : Object +> : ^^^^^^ +>peace : Object +> : ^^^^^^ return '1' >'1' : "1" diff --git a/tests/baselines/reference/callbackTagNestedParameter.js b/tests/baselines/reference/callbackTagNestedParameter.js index 7bd2fbaa734d3..36c34e86bf063 100644 --- a/tests/baselines/reference/callbackTagNestedParameter.js +++ b/tests/baselines/reference/callbackTagNestedParameter.js @@ -37,5 +37,5 @@ function eachPerson(callback) { declare function eachPerson(callback: WorksWithPeopleCallback): void; type WorksWithPeopleCallback = (person: { name: string; - age?: number; + age?: number | undefined; }) => void; diff --git a/tests/baselines/reference/callbacksDontShareTypes.errors.txt b/tests/baselines/reference/callbacksDontShareTypes.errors.txt new file mode 100644 index 0000000000000..2f699119e862b --- /dev/null +++ b/tests/baselines/reference/callbacksDontShareTypes.errors.txt @@ -0,0 +1,45 @@ +callbacksDontShareTypes.ts(15,11): error TS2454: Variable '_' is used before being assigned. +callbacksDontShareTypes.ts(15,17): error TS2454: Variable 'c2' is used before being assigned. +callbacksDontShareTypes.ts(16,11): error TS2454: Variable '_' is used before being assigned. +callbacksDontShareTypes.ts(16,17): error TS2454: Variable 'c2' is used before being assigned. +callbacksDontShareTypes.ts(17,11): error TS2454: Variable '_' is used before being assigned. +callbacksDontShareTypes.ts(17,33): error TS2454: Variable 'c2' is used before being assigned. +callbacksDontShareTypes.ts(18,11): error TS2454: Variable '_' is used before being assigned. +callbacksDontShareTypes.ts(18,33): error TS2454: Variable 'c2' is used before being assigned. + + +==== callbacksDontShareTypes.ts (8 errors) ==== + interface Collection { + length: number; + add(x: T): void; + remove(x: T): boolean; + } + interface Combinators { + map(c: Collection, f: (x: T) => U): Collection; + map(c: Collection, f: (x: T) => any): Collection; + } + + var _: Combinators; + var c2: Collection; + + var rf1 = (x: number) => { return x.toFixed() }; + var r1a = _.map(c2, (x) => { return x.toFixed() }); + ~ +!!! error TS2454: Variable '_' is used before being assigned. + ~~ +!!! error TS2454: Variable 'c2' is used before being assigned. + var r1b = _.map(c2, rf1); // this line should not cause the following 2 to have errors + ~ +!!! error TS2454: Variable '_' is used before being assigned. + ~~ +!!! error TS2454: Variable 'c2' is used before being assigned. + var r5a = _.map(c2, (x) => { return x.toFixed() }); + ~ +!!! error TS2454: Variable '_' is used before being assigned. + ~~ +!!! error TS2454: Variable 'c2' is used before being assigned. + var r5b = _.map(c2, rf1); + ~ +!!! error TS2454: Variable '_' is used before being assigned. + ~~ +!!! error TS2454: Variable 'c2' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/callbacksDontShareTypes.js b/tests/baselines/reference/callbacksDontShareTypes.js index fc28cef9199d6..feb30b31d1b0e 100644 --- a/tests/baselines/reference/callbacksDontShareTypes.js +++ b/tests/baselines/reference/callbacksDontShareTypes.js @@ -21,6 +21,7 @@ var r5a = _.map(c2, (x) => { return x.toFixed() }); var r5b = _.map(c2, rf1); //// [callbacksDontShareTypes.js] +"use strict"; var _; var c2; var rf1 = (x) => { return x.toFixed(); }; diff --git a/tests/baselines/reference/canFollowGetSetKeyword.js b/tests/baselines/reference/canFollowGetSetKeyword.js index c43276eba0d59..27a9006555cfb 100644 --- a/tests/baselines/reference/canFollowGetSetKeyword.js +++ b/tests/baselines/reference/canFollowGetSetKeyword.js @@ -19,6 +19,7 @@ const d = { }; //// [canFollowGetSetKeyword.js] +"use strict"; class A { *x() { } } diff --git a/tests/baselines/reference/cannotInvokeNewOnErrorExpression.js b/tests/baselines/reference/cannotInvokeNewOnErrorExpression.js index ec60ce0518769..e21061d44768c 100644 --- a/tests/baselines/reference/cannotInvokeNewOnErrorExpression.js +++ b/tests/baselines/reference/cannotInvokeNewOnErrorExpression.js @@ -8,6 +8,7 @@ namespace M var t = new M.ClassA[]; //// [cannotInvokeNewOnErrorExpression.js] +"use strict"; var M; (function (M) { class ClassA { diff --git a/tests/baselines/reference/cannotInvokeNewOnIndexExpression.js b/tests/baselines/reference/cannotInvokeNewOnIndexExpression.js index ed93b9d635e25..09f865648f468 100644 --- a/tests/baselines/reference/cannotInvokeNewOnIndexExpression.js +++ b/tests/baselines/reference/cannotInvokeNewOnIndexExpression.js @@ -4,4 +4,5 @@ var test: any[] = new any[1]; //// [cannotInvokeNewOnIndexExpression.js] +"use strict"; var test = new any[1]; diff --git a/tests/baselines/reference/captureSuperPropertyAccessInSuperCall01.js b/tests/baselines/reference/captureSuperPropertyAccessInSuperCall01.js index 425de1975c6f4..738f0ceaa37d5 100644 --- a/tests/baselines/reference/captureSuperPropertyAccessInSuperCall01.js +++ b/tests/baselines/reference/captureSuperPropertyAccessInSuperCall01.js @@ -14,6 +14,7 @@ class B extends A { } //// [captureSuperPropertyAccessInSuperCall01.js] +"use strict"; class A { constructor(f) { } diff --git a/tests/baselines/reference/captureThisInSuperCall.js b/tests/baselines/reference/captureThisInSuperCall.js index ff89e3f4deb78..890c3900c8fd2 100644 --- a/tests/baselines/reference/captureThisInSuperCall.js +++ b/tests/baselines/reference/captureThisInSuperCall.js @@ -11,6 +11,7 @@ class B extends A { } //// [captureThisInSuperCall.js] +"use strict"; class A { constructor(p) { } } diff --git a/tests/baselines/reference/capturedLetConstInLoop1.js b/tests/baselines/reference/capturedLetConstInLoop1.js index 4f0fc409ef77e..76028113b4ab7 100644 --- a/tests/baselines/reference/capturedLetConstInLoop1.js +++ b/tests/baselines/reference/capturedLetConstInLoop1.js @@ -141,6 +141,7 @@ for (let ix in iobj) { } //// [capturedLetConstInLoop1.js] +"use strict"; //==== let for (let x in {}) { (function () { return x; }); diff --git a/tests/baselines/reference/capturedLetConstInLoop10.js b/tests/baselines/reference/capturedLetConstInLoop10.js index e5c79901db394..3b706c1bf5251 100644 --- a/tests/baselines/reference/capturedLetConstInLoop10.js +++ b/tests/baselines/reference/capturedLetConstInLoop10.js @@ -48,6 +48,7 @@ class B { } //// [capturedLetConstInLoop10.js] +"use strict"; class A { foo() { for (let x of [0]) { diff --git a/tests/baselines/reference/capturedLetConstInLoop10_ES6.js b/tests/baselines/reference/capturedLetConstInLoop10_ES6.js index aa1935f3f31fd..fe3f4b858696d 100644 --- a/tests/baselines/reference/capturedLetConstInLoop10_ES6.js +++ b/tests/baselines/reference/capturedLetConstInLoop10_ES6.js @@ -48,6 +48,7 @@ class B { } //// [capturedLetConstInLoop10_ES6.js] +"use strict"; class A { foo() { for (let x of [0]) { diff --git a/tests/baselines/reference/capturedLetConstInLoop11.js b/tests/baselines/reference/capturedLetConstInLoop11.js index ec0adca7b137d..520dee8ec07a1 100644 --- a/tests/baselines/reference/capturedLetConstInLoop11.js +++ b/tests/baselines/reference/capturedLetConstInLoop11.js @@ -16,6 +16,7 @@ function foo() { } //// [capturedLetConstInLoop11.js] +"use strict"; for (;;) { let x = 1; () => x; diff --git a/tests/baselines/reference/capturedLetConstInLoop11_ES6.js b/tests/baselines/reference/capturedLetConstInLoop11_ES6.js index 22beaa2b8ccc1..cc2002bd384a7 100644 --- a/tests/baselines/reference/capturedLetConstInLoop11_ES6.js +++ b/tests/baselines/reference/capturedLetConstInLoop11_ES6.js @@ -16,6 +16,7 @@ function foo() { } //// [capturedLetConstInLoop11_ES6.js] +"use strict"; for (;;) { let x = 1; () => x; diff --git a/tests/baselines/reference/capturedLetConstInLoop12.js b/tests/baselines/reference/capturedLetConstInLoop12.js index 92d4504710370..832754ce386da 100644 --- a/tests/baselines/reference/capturedLetConstInLoop12.js +++ b/tests/baselines/reference/capturedLetConstInLoop12.js @@ -18,6 +18,7 @@ })(); //// [capturedLetConstInLoop12.js] +"use strict"; (function () { "use strict"; for (let i = 0; i < 4; i++) { diff --git a/tests/baselines/reference/capturedLetConstInLoop13.js b/tests/baselines/reference/capturedLetConstInLoop13.js index ec893691dce57..ac4ac5dee09e7 100644 --- a/tests/baselines/reference/capturedLetConstInLoop13.js +++ b/tests/baselines/reference/capturedLetConstInLoop13.js @@ -25,6 +25,7 @@ class Main { new Main(); //// [capturedLetConstInLoop13.js] +"use strict"; class Main { constructor() { this.register("a", "b", "c"); diff --git a/tests/baselines/reference/capturedLetConstInLoop1_ES6.js b/tests/baselines/reference/capturedLetConstInLoop1_ES6.js index 18727ee67a0b2..97c4b57886fda 100644 --- a/tests/baselines/reference/capturedLetConstInLoop1_ES6.js +++ b/tests/baselines/reference/capturedLetConstInLoop1_ES6.js @@ -116,6 +116,7 @@ for (const y = 0; y < 1;) { } //// [capturedLetConstInLoop1_ES6.js] +"use strict"; //==== let for (let x in {}) { (function () { return x; }); diff --git a/tests/baselines/reference/capturedLetConstInLoop2.js b/tests/baselines/reference/capturedLetConstInLoop2.js index 2a6e0e472385e..502b00c7b1fd8 100644 --- a/tests/baselines/reference/capturedLetConstInLoop2.js +++ b/tests/baselines/reference/capturedLetConstInLoop2.js @@ -177,6 +177,7 @@ function foo8_c(x) { } //// [capturedLetConstInLoop2.js] +"use strict"; // ========let function foo0(x) { for (let x of []) { diff --git a/tests/baselines/reference/capturedLetConstInLoop2_ES6.js b/tests/baselines/reference/capturedLetConstInLoop2_ES6.js index 745bd874e2341..444fff3e3e83d 100644 --- a/tests/baselines/reference/capturedLetConstInLoop2_ES6.js +++ b/tests/baselines/reference/capturedLetConstInLoop2_ES6.js @@ -177,6 +177,7 @@ function foo8_c(x) { } //// [capturedLetConstInLoop2_ES6.js] +"use strict"; // ========let function foo0(x) { for (let x of []) { diff --git a/tests/baselines/reference/capturedLetConstInLoop3.js b/tests/baselines/reference/capturedLetConstInLoop3.js index 6baacd54b9c21..de5d4c9286175 100644 --- a/tests/baselines/reference/capturedLetConstInLoop3.js +++ b/tests/baselines/reference/capturedLetConstInLoop3.js @@ -220,6 +220,7 @@ function foo8_c(x) { } //// [capturedLetConstInLoop3.js] +"use strict"; function foo0(x) { for (let x of []) { var v = x; diff --git a/tests/baselines/reference/capturedLetConstInLoop3_ES6.js b/tests/baselines/reference/capturedLetConstInLoop3_ES6.js index 63d6c521b68db..672d39dfff00f 100644 --- a/tests/baselines/reference/capturedLetConstInLoop3_ES6.js +++ b/tests/baselines/reference/capturedLetConstInLoop3_ES6.js @@ -220,6 +220,7 @@ function foo8_c(x) { } //// [capturedLetConstInLoop3_ES6.js] +"use strict"; function foo0(x) { for (let x of []) { var v = x; diff --git a/tests/baselines/reference/capturedLetConstInLoop5.js b/tests/baselines/reference/capturedLetConstInLoop5.js index becbf24cb8657..82c1a040f2b54 100644 --- a/tests/baselines/reference/capturedLetConstInLoop5.js +++ b/tests/baselines/reference/capturedLetConstInLoop5.js @@ -282,6 +282,7 @@ function foo8_c(x) { } //// [capturedLetConstInLoop5.js] +"use strict"; //====let function foo0(x) { for (let x of []) { diff --git a/tests/baselines/reference/capturedLetConstInLoop5_ES6.js b/tests/baselines/reference/capturedLetConstInLoop5_ES6.js index 2b53c3c5b2d0b..25abdcde1f83a 100644 --- a/tests/baselines/reference/capturedLetConstInLoop5_ES6.js +++ b/tests/baselines/reference/capturedLetConstInLoop5_ES6.js @@ -282,6 +282,7 @@ function foo8_c(x) { } //// [capturedLetConstInLoop5_ES6.js] +"use strict"; //====let function foo0(x) { for (let x of []) { diff --git a/tests/baselines/reference/capturedLetConstInLoop6.js b/tests/baselines/reference/capturedLetConstInLoop6.js index 8151166ab21a3..8669b5212ebe2 100644 --- a/tests/baselines/reference/capturedLetConstInLoop6.js +++ b/tests/baselines/reference/capturedLetConstInLoop6.js @@ -241,6 +241,7 @@ for (const y = 0; y < 1;) { //// [capturedLetConstInLoop6.js] +"use strict"; // ====let for (let x of []) { (function () { return x; }); diff --git a/tests/baselines/reference/capturedLetConstInLoop6_ES6.js b/tests/baselines/reference/capturedLetConstInLoop6_ES6.js index ca856a9f3f9c4..6d982ebc99af3 100644 --- a/tests/baselines/reference/capturedLetConstInLoop6_ES6.js +++ b/tests/baselines/reference/capturedLetConstInLoop6_ES6.js @@ -241,6 +241,7 @@ for (const y = 0; y < 1;) { //// [capturedLetConstInLoop6_ES6.js] +"use strict"; // ====let for (let x of []) { (function () { return x; }); diff --git a/tests/baselines/reference/capturedLetConstInLoop7.js b/tests/baselines/reference/capturedLetConstInLoop7.js index 6229ee443abbf..ab5c9f42b5a05 100644 --- a/tests/baselines/reference/capturedLetConstInLoop7.js +++ b/tests/baselines/reference/capturedLetConstInLoop7.js @@ -378,6 +378,7 @@ for (const y = 0; y < 1;) { } //// [capturedLetConstInLoop7.js] +"use strict"; //===let l0: for (let x of []) { (function () { return x; }); diff --git a/tests/baselines/reference/capturedLetConstInLoop7_ES6.js b/tests/baselines/reference/capturedLetConstInLoop7_ES6.js index 38974e9809ab1..18122a6f1b742 100644 --- a/tests/baselines/reference/capturedLetConstInLoop7_ES6.js +++ b/tests/baselines/reference/capturedLetConstInLoop7_ES6.js @@ -378,6 +378,7 @@ for (const y = 0; y < 1;) { } //// [capturedLetConstInLoop7_ES6.js] +"use strict"; //===let l0: for (let x of []) { (function () { return x; }); diff --git a/tests/baselines/reference/capturedLetConstInLoop8.js b/tests/baselines/reference/capturedLetConstInLoop8.js index 5e7576d838256..305efe164d4c1 100644 --- a/tests/baselines/reference/capturedLetConstInLoop8.js +++ b/tests/baselines/reference/capturedLetConstInLoop8.js @@ -129,6 +129,7 @@ function foo_c() { //// [capturedLetConstInLoop8.js] +"use strict"; function foo() { l0: for (let z = 0; z < 1; ++z) { l1: for (let x = 0; x < 1; ++x) { diff --git a/tests/baselines/reference/capturedLetConstInLoop8.types b/tests/baselines/reference/capturedLetConstInLoop8.types index cb76619146c62..1a43ab867b8e8 100644 --- a/tests/baselines/reference/capturedLetConstInLoop8.types +++ b/tests/baselines/reference/capturedLetConstInLoop8.types @@ -2,8 +2,8 @@ === capturedLetConstInLoop8.ts === function foo() { ->foo : () => "123" | "456" -> : ^^^^^^^^^^^^^^^^^^^ +>foo : () => "123" | "456" | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ l0: >l0 : any @@ -276,8 +276,8 @@ function foo() { } function foo_c() { ->foo_c : () => "123" | "456" -> : ^^^^^^^^^^^^^^^^^^^ +>foo_c : () => "123" | "456" | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ l0: >l0 : any diff --git a/tests/baselines/reference/capturedLetConstInLoop8_ES6.js b/tests/baselines/reference/capturedLetConstInLoop8_ES6.js index 7ade5fcecd882..f580aa79b188e 100644 --- a/tests/baselines/reference/capturedLetConstInLoop8_ES6.js +++ b/tests/baselines/reference/capturedLetConstInLoop8_ES6.js @@ -129,6 +129,7 @@ function foo_c() { //// [capturedLetConstInLoop8_ES6.js] +"use strict"; function foo() { l0: for (let z = 0; z < 1; ++z) { l1: for (let x = 0; x < 1; ++x) { diff --git a/tests/baselines/reference/capturedLetConstInLoop8_ES6.types b/tests/baselines/reference/capturedLetConstInLoop8_ES6.types index 39e10314077fe..9a70858dff056 100644 --- a/tests/baselines/reference/capturedLetConstInLoop8_ES6.types +++ b/tests/baselines/reference/capturedLetConstInLoop8_ES6.types @@ -2,8 +2,8 @@ === capturedLetConstInLoop8_ES6.ts === function foo() { ->foo : () => "123" | "456" -> : ^^^^^^^^^^^^^^^^^^^ +>foo : () => "123" | "456" | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ l0: >l0 : any @@ -276,8 +276,8 @@ function foo() { } function foo_c() { ->foo_c : () => "123" | "456" -> : ^^^^^^^^^^^^^^^^^^^ +>foo_c : () => "123" | "456" | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ l0: >l0 : any diff --git a/tests/baselines/reference/capturedLetConstInLoop9.js b/tests/baselines/reference/capturedLetConstInLoop9.js index 2e33b22271438..2f6b7164d869d 100644 --- a/tests/baselines/reference/capturedLetConstInLoop9.js +++ b/tests/baselines/reference/capturedLetConstInLoop9.js @@ -141,6 +141,7 @@ function foo3 () { } //// [capturedLetConstInLoop9.js] +"use strict"; for (let x = 0; x < 1; ++x) { let x; (function () { return x; }); diff --git a/tests/baselines/reference/capturedLetConstInLoop9_ES6.js b/tests/baselines/reference/capturedLetConstInLoop9_ES6.js index d5eb6a5571405..5e53a991edb60 100644 --- a/tests/baselines/reference/capturedLetConstInLoop9_ES6.js +++ b/tests/baselines/reference/capturedLetConstInLoop9_ES6.js @@ -140,6 +140,7 @@ function foo3 () { } //// [capturedLetConstInLoop9_ES6.js] +"use strict"; for (let x = 0; x < 1; ++x) { let x; (function () { return x; }); diff --git a/tests/baselines/reference/capturedParametersInInitializers1.js b/tests/baselines/reference/capturedParametersInInitializers1.js index c3403b7186889..71ce62a3dca19 100644 --- a/tests/baselines/reference/capturedParametersInInitializers1.js +++ b/tests/baselines/reference/capturedParametersInInitializers1.js @@ -43,6 +43,7 @@ function foo9(y = {[z]() { return z; }}, z = 1) { //// [capturedParametersInInitializers1.js] +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { diff --git a/tests/baselines/reference/capturedParametersInInitializers2(target=es2015).js b/tests/baselines/reference/capturedParametersInInitializers2(target=es2015).js index ae2a81645d949..4edd27518de35 100644 --- a/tests/baselines/reference/capturedParametersInInitializers2(target=es2015).js +++ b/tests/baselines/reference/capturedParametersInInitializers2(target=es2015).js @@ -17,6 +17,7 @@ function foo2(y = class {[x] = x}, x = 1) { } //// [capturedParametersInInitializers2.js] +"use strict"; var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) { if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); diff --git a/tests/baselines/reference/capturedParametersInInitializers2(target=es5).js b/tests/baselines/reference/capturedParametersInInitializers2(target=es5).js index 5289fa14092ac..a432d6ac92ec7 100644 --- a/tests/baselines/reference/capturedParametersInInitializers2(target=es5).js +++ b/tests/baselines/reference/capturedParametersInInitializers2(target=es5).js @@ -17,6 +17,7 @@ function foo2(y = class {[x] = x}, x = 1) { } //// [capturedParametersInInitializers2.js] +"use strict"; var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) { if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); diff --git a/tests/baselines/reference/capturedShorthandPropertyAssignmentNoCheck(target=es2015).js b/tests/baselines/reference/capturedShorthandPropertyAssignmentNoCheck(target=es2015).js index d33ec6a3eb0e3..546c54525a5a1 100644 --- a/tests/baselines/reference/capturedShorthandPropertyAssignmentNoCheck(target=es2015).js +++ b/tests/baselines/reference/capturedShorthandPropertyAssignmentNoCheck(target=es2015).js @@ -10,6 +10,7 @@ console.log(result) //// [capturedShorthandPropertyAssignmentNoCheck.js] +"use strict"; const fns = []; for (const value of [1, 2, 3]) { fns.push(() => ({ value })); diff --git a/tests/baselines/reference/capturedShorthandPropertyAssignmentNoCheck(target=es2015).types b/tests/baselines/reference/capturedShorthandPropertyAssignmentNoCheck(target=es2015).types index ff153e104aa65..02a81a669a32b 100644 --- a/tests/baselines/reference/capturedShorthandPropertyAssignmentNoCheck(target=es2015).types +++ b/tests/baselines/reference/capturedShorthandPropertyAssignmentNoCheck(target=es2015).types @@ -4,8 +4,8 @@ const fns = []; >fns : any[] > : ^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ for (const value of [1, 2, 3]) { >value : number @@ -38,21 +38,24 @@ for (const value of [1, 2, 3]) { > : ^^^^^^ } const result = fns.map(fn => fn()); ->result : any[] -> : ^^^^^ ->fns.map(fn => fn()) : any[] -> : ^^^^^ ->fns.map : (callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[] -> : ^ ^^ ^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ ->fns : any[] -> : ^^^^^ ->map : (callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[] -> : ^ ^^ ^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ ->fn => fn() : (fn: any) => any -> : ^ ^^^^^^^^^^^^^ ->fn : any ->fn() : any ->fn : any +>result : { value: number; }[] +> : ^^^^^^^^^^^^^^^^^^^^ +>fns.map(fn => fn()) : { value: number; }[] +> : ^^^^^^^^^^^^^^^^^^^^ +>fns.map : (callbackfn: (value: () => { value: number; }, index: number, array: (() => { value: number; })[]) => U, thisArg?: any) => U[] +> : ^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ +>fns : (() => { value: number; })[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>map : (callbackfn: (value: () => { value: number; }, index: number, array: (() => { value: number; })[]) => U, thisArg?: any) => U[] +> : ^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ +>fn => fn() : (fn: () => { value: number; }) => { value: number; } +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>fn : () => { value: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>fn() : { value: number; } +> : ^^^^^^^^^^^^^^^^^^ +>fn : () => { value: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^ console.log(result) >console.log(result) : void @@ -63,6 +66,6 @@ console.log(result) > : ^^^^^^^ >log : (...data: any[]) => void > : ^^^^ ^^ ^^^^^ ->result : any[] -> : ^^^^^ +>result : { value: number; }[] +> : ^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/baselines/reference/capturedShorthandPropertyAssignmentNoCheck(target=es5).js b/tests/baselines/reference/capturedShorthandPropertyAssignmentNoCheck(target=es5).js index 14b8387479794..cf8d8e30596b2 100644 --- a/tests/baselines/reference/capturedShorthandPropertyAssignmentNoCheck(target=es5).js +++ b/tests/baselines/reference/capturedShorthandPropertyAssignmentNoCheck(target=es5).js @@ -10,6 +10,7 @@ console.log(result) //// [capturedShorthandPropertyAssignmentNoCheck.js] +"use strict"; var fns = []; var _loop_1 = function (value) { fns.push(function () { return ({ value: value }); }); diff --git a/tests/baselines/reference/capturedShorthandPropertyAssignmentNoCheck(target=es5).types b/tests/baselines/reference/capturedShorthandPropertyAssignmentNoCheck(target=es5).types index 30fdc2aea7f58..02a81a669a32b 100644 --- a/tests/baselines/reference/capturedShorthandPropertyAssignmentNoCheck(target=es5).types +++ b/tests/baselines/reference/capturedShorthandPropertyAssignmentNoCheck(target=es5).types @@ -4,8 +4,8 @@ const fns = []; >fns : any[] > : ^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ for (const value of [1, 2, 3]) { >value : number @@ -38,24 +38,24 @@ for (const value of [1, 2, 3]) { > : ^^^^^^ } const result = fns.map(fn => fn()); ->result : any[] -> : ^^^^^ ->fns.map(fn => fn()) : any[] -> : ^^^^^ ->fns.map : (callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[] -> : ^ ^^ ^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ ->fns : any[] -> : ^^^^^ ->map : (callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[] -> : ^ ^^ ^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ ->fn => fn() : (fn: any) => any -> : ^ ^^^^^^^^^^^^^ ->fn : any -> : ^^^ ->fn() : any -> : ^^^ ->fn : any -> : ^^^ +>result : { value: number; }[] +> : ^^^^^^^^^^^^^^^^^^^^ +>fns.map(fn => fn()) : { value: number; }[] +> : ^^^^^^^^^^^^^^^^^^^^ +>fns.map : (callbackfn: (value: () => { value: number; }, index: number, array: (() => { value: number; })[]) => U, thisArg?: any) => U[] +> : ^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ +>fns : (() => { value: number; })[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>map : (callbackfn: (value: () => { value: number; }, index: number, array: (() => { value: number; })[]) => U, thisArg?: any) => U[] +> : ^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ +>fn => fn() : (fn: () => { value: number; }) => { value: number; } +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>fn : () => { value: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>fn() : { value: number; } +> : ^^^^^^^^^^^^^^^^^^ +>fn : () => { value: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^ console.log(result) >console.log(result) : void @@ -66,6 +66,6 @@ console.log(result) > : ^^^^^^^ >log : (...data: any[]) => void > : ^^^^ ^^ ^^^^^ ->result : any[] -> : ^^^^^ +>result : { value: number; }[] +> : ^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/baselines/reference/capturedVarInLoop(target=es2015).js b/tests/baselines/reference/capturedVarInLoop(target=es2015).js index bfa6a576a7252..e6204680c544f 100644 --- a/tests/baselines/reference/capturedVarInLoop(target=es2015).js +++ b/tests/baselines/reference/capturedVarInLoop(target=es2015).js @@ -8,6 +8,7 @@ for (var i = 0; i < 10; i++) { } //// [capturedVarInLoop.js] +"use strict"; for (var i = 0; i < 10; i++) { var str = 'x', len = str.length; let lambda1 = (y) => { }; diff --git a/tests/baselines/reference/capturedVarInLoop(target=es5).js b/tests/baselines/reference/capturedVarInLoop(target=es5).js index ff49cda7181b3..c76e955a14692 100644 --- a/tests/baselines/reference/capturedVarInLoop(target=es5).js +++ b/tests/baselines/reference/capturedVarInLoop(target=es5).js @@ -8,6 +8,7 @@ for (var i = 0; i < 10; i++) { } //// [capturedVarInLoop.js] +"use strict"; var _loop_1 = function () { str = 'x', len = str.length; var lambda1 = function (y) { }; diff --git a/tests/baselines/reference/castExpressionParentheses.js b/tests/baselines/reference/castExpressionParentheses.js index f547a2ec92424..11cd9fca73e77 100644 --- a/tests/baselines/reference/castExpressionParentheses.js +++ b/tests/baselines/reference/castExpressionParentheses.js @@ -53,6 +53,7 @@ new (A()); //// [castExpressionParentheses.js] +"use strict"; // parentheses should be omitted // literals ({ a: 0 }); diff --git a/tests/baselines/reference/castFunctionExpressionShouldBeParenthesized.js b/tests/baselines/reference/castFunctionExpressionShouldBeParenthesized.js index e42bd801c4f6f..6aa5093ffd630 100644 --- a/tests/baselines/reference/castFunctionExpressionShouldBeParenthesized.js +++ b/tests/baselines/reference/castFunctionExpressionShouldBeParenthesized.js @@ -4,4 +4,5 @@ (function a() { } as any)().foo() //// [castFunctionExpressionShouldBeParenthesized.js] +"use strict"; (function a() { }().foo()); diff --git a/tests/baselines/reference/castNewObjectBug.js b/tests/baselines/reference/castNewObjectBug.js index 54fcd26568be7..868c6226c0ea0 100644 --- a/tests/baselines/reference/castNewObjectBug.js +++ b/tests/baselines/reference/castNewObjectBug.js @@ -5,4 +5,5 @@ interface Foo { } var xx = new Object(); //// [castNewObjectBug.js] +"use strict"; var xx = new Object(); diff --git a/tests/baselines/reference/castOfAwait.errors.txt b/tests/baselines/reference/castOfAwait.errors.txt new file mode 100644 index 0000000000000..1e377dadb7ca0 --- /dev/null +++ b/tests/baselines/reference/castOfAwait.errors.txt @@ -0,0 +1,14 @@ +castOfAwait.ts(5,32): error TS2352: Conversion of type 'undefined' to type 'number' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. + + +==== castOfAwait.ts (1 errors) ==== + async function f() { + await 0; + typeof await 0; + void await 0; + await void typeof void await 0; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2352: Conversion of type 'undefined' to type 'number' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. + await await 0; + } + \ No newline at end of file diff --git a/tests/baselines/reference/castOfAwait.js b/tests/baselines/reference/castOfAwait.js index 7450b64f47233..6e36d785983e4 100644 --- a/tests/baselines/reference/castOfAwait.js +++ b/tests/baselines/reference/castOfAwait.js @@ -11,6 +11,7 @@ async function f() { //// [castOfAwait.js] +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { diff --git a/tests/baselines/reference/castOfYield.js b/tests/baselines/reference/castOfYield.js index fa808f1570a4e..85a724aa4e86d 100644 --- a/tests/baselines/reference/castOfYield.js +++ b/tests/baselines/reference/castOfYield.js @@ -9,6 +9,7 @@ function* f() { //// [castOfYield.js] +"use strict"; function* f() { (yield 0); // Unlike await, yield is not allowed to appear in a simple unary expression. diff --git a/tests/baselines/reference/castParentheses.js b/tests/baselines/reference/castParentheses.js index f0f44ba04a252..6a61ca05e2286 100644 --- a/tests/baselines/reference/castParentheses.js +++ b/tests/baselines/reference/castParentheses.js @@ -14,6 +14,7 @@ var b = (new a.b); var b = (new a).b //// [castParentheses.js] +"use strict"; class a { } var b = a; diff --git a/tests/baselines/reference/castTest.errors.txt b/tests/baselines/reference/castTest.errors.txt new file mode 100644 index 0000000000000..cd0666f4fb89a --- /dev/null +++ b/tests/baselines/reference/castTest.errors.txt @@ -0,0 +1,40 @@ +castTest.ts(9,10): error TS2352: Conversion of type 'null' to type 'any[]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. +castTest.ts(11,9): error TS2352: Conversion of type 'null' to type '(res: number) => void' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. + + +==== castTest.ts (2 errors) ==== + var x : any = 0; + var z = x; + var y = x + z; + + var a = 0; + var b = true; + var s = ""; + + var ar = null; + ~~~~~~~~~~~ +!!! error TS2352: Conversion of type 'null' to type 'any[]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. + + var f = <(res : number) => void>null; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2352: Conversion of type 'null' to type '(res: number) => void' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. + + declare class Point + { + x: number; + y: number; + add(dx: number, dy: number): Point; + mult(p: Point): Point; + constructor(x: number, y: number); + } + + var p_cast = ({ + x: 0, + y: 0, + add: function(dx, dy) { + return new Point(this.x + dx, this.y + dy); + }, + mult: function(p) { return p; } + }) + + \ No newline at end of file diff --git a/tests/baselines/reference/castTest.js b/tests/baselines/reference/castTest.js index 02412d44beded..f0209ce695c76 100644 --- a/tests/baselines/reference/castTest.js +++ b/tests/baselines/reference/castTest.js @@ -34,6 +34,7 @@ var p_cast = ({ //// [castTest.js] +"use strict"; var x = 0; var z = x; var y = x + z; diff --git a/tests/baselines/reference/castTest.symbols b/tests/baselines/reference/castTest.symbols index 6c4fd6d8d36cb..90481d1a72765 100644 --- a/tests/baselines/reference/castTest.symbols +++ b/tests/baselines/reference/castTest.symbols @@ -72,7 +72,13 @@ var p_cast = ({ return new Point(this.x + dx, this.y + dy); >Point : Symbol(Point, Decl(castTest.ts, 10, 37)) +>this.x : Symbol(Point.x, Decl(castTest.ts, 13, 1)) +>this : Symbol(Point, Decl(castTest.ts, 10, 37)) +>x : Symbol(Point.x, Decl(castTest.ts, 13, 1)) >dx : Symbol(dx, Decl(castTest.ts, 24, 18)) +>this.y : Symbol(Point.y, Decl(castTest.ts, 14, 14)) +>this : Symbol(Point, Decl(castTest.ts, 10, 37)) +>y : Symbol(Point.y, Decl(castTest.ts, 14, 14)) >dy : Symbol(dy, Decl(castTest.ts, 24, 21)) }, diff --git a/tests/baselines/reference/castTest.types b/tests/baselines/reference/castTest.types index fd605be141f07..44f69bdb940c1 100644 --- a/tests/baselines/reference/castTest.types +++ b/tests/baselines/reference/castTest.types @@ -3,6 +3,7 @@ === castTest.ts === var x : any = 0; >x : any +> : ^^^ >0 : 0 > : ^ @@ -12,17 +13,23 @@ var z = x; > x : number > : ^^^^^^ >x : any +> : ^^^ var y = x + z; >y : any +> : ^^^ >x + z : any +> : ^^^ >x : any +> : ^^^ >z : number > : ^^^^^^ var a = 0; >a : any +> : ^^^ >0 : any +> : ^^^ >0 : 0 > : ^ @@ -126,20 +133,24 @@ var p_cast = ({ > : ^^^^^ >Point : typeof Point > : ^^^^^^^^^^^^ ->this.x + dx : any ->this.x : any ->this : any -> : ^^^ ->x : any -> : ^^^ +>this.x + dx : number +> : ^^^^^^ +>this.x : number +> : ^^^^^^ +>this : Point +> : ^^^^^ +>x : number +> : ^^^^^^ >dx : number > : ^^^^^^ ->this.y + dy : any ->this.y : any ->this : any -> : ^^^ ->y : any -> : ^^^ +>this.y + dy : number +> : ^^^^^^ +>this.y : number +> : ^^^^^^ +>this : Point +> : ^^^^^ +>y : number +> : ^^^^^^ >dy : number > : ^^^^^^ diff --git a/tests/baselines/reference/castingTuple.errors.txt b/tests/baselines/reference/castingTuple.errors.txt index 0a2b933f57d25..9a690e6e2c2fd 100644 --- a/tests/baselines/reference/castingTuple.errors.txt +++ b/tests/baselines/reference/castingTuple.errors.txt @@ -1,3 +1,7 @@ +castingTuple.ts(3,24): error TS7008: Member 'c' implicitly has an 'any' type. +castingTuple.ts(4,24): error TS7008: Member 'd' implicitly has an 'any' type. +castingTuple.ts(5,21): error TS7008: Member 'e' implicitly has an 'any' type. +castingTuple.ts(6,21): error TS7008: Member 'f' implicitly has an 'any' type. castingTuple.ts(13,23): error TS2352: Conversion of type '[number, string]' to type '[number, string, boolean]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. Source has 2 element(s) but target requires 3. castingTuple.ts(14,15): error TS2352: Conversion of type '[number, string, boolean]' to type '[number, string]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. @@ -17,13 +21,21 @@ castingTuple.ts(32,5): error TS2403: Subsequent variable declarations must have castingTuple.ts(33,1): error TS2304: Cannot find name 't4'. -==== castingTuple.ts (9 errors) ==== +==== castingTuple.ts (13 errors) ==== interface I { } class A { a = 10; } class C implements I { c }; + ~ +!!! error TS7008: Member 'c' implicitly has an 'any' type. class D implements I { d }; + ~ +!!! error TS7008: Member 'd' implicitly has an 'any' type. class E extends A { e }; + ~ +!!! error TS7008: Member 'e' implicitly has an 'any' type. class F extends A { f }; + ~ +!!! error TS7008: Member 'f' implicitly has an 'any' type. enum E1 { one } enum E2 { one } diff --git a/tests/baselines/reference/castingTuple.js b/tests/baselines/reference/castingTuple.js index 11b1a369deac5..da6ce4c6dd12d 100644 --- a/tests/baselines/reference/castingTuple.js +++ b/tests/baselines/reference/castingTuple.js @@ -37,6 +37,7 @@ t4[2] = 10; //// [castingTuple.js] +"use strict"; class A { constructor() { this.a = 10; diff --git a/tests/baselines/reference/catch.js b/tests/baselines/reference/catch.js index 2539bad1eaa48..772d1f32c06c4 100644 --- a/tests/baselines/reference/catch.js +++ b/tests/baselines/reference/catch.js @@ -8,6 +8,7 @@ function f() { //// [catch.js] +"use strict"; function f() { try { } catch (e) { } diff --git a/tests/baselines/reference/catch.types b/tests/baselines/reference/catch.types index 9321ee9556a7e..cfcd2dd162514 100644 --- a/tests/baselines/reference/catch.types +++ b/tests/baselines/reference/catch.types @@ -6,9 +6,11 @@ function f() { > : ^^^^^^^^^^ try {} catch(e) { } ->e : any +>e : unknown +> : ^^^^^^^ try {} catch(e) { } ->e : any +>e : unknown +> : ^^^^^^^ } diff --git a/tests/baselines/reference/catchClauseWithInitializer1.js b/tests/baselines/reference/catchClauseWithInitializer1.js index 7ddb817e90a81..42cb4fa1c4704 100644 --- a/tests/baselines/reference/catchClauseWithInitializer1.js +++ b/tests/baselines/reference/catchClauseWithInitializer1.js @@ -7,6 +7,7 @@ catch (e = 1) { } //// [catchClauseWithInitializer1.js] +"use strict"; try { } catch (e = 1) { diff --git a/tests/baselines/reference/catchClauseWithInitializer1.types b/tests/baselines/reference/catchClauseWithInitializer1.types index d700872695743..03bf8fafa8b15 100644 --- a/tests/baselines/reference/catchClauseWithInitializer1.types +++ b/tests/baselines/reference/catchClauseWithInitializer1.types @@ -4,8 +4,8 @@ try { } catch (e = 1) { ->e : any -> : ^^^ +>e : unknown +> : ^^^^^^^ >1 : 1 > : ^ } diff --git a/tests/baselines/reference/catchClauseWithTypeAnnotation.errors.txt b/tests/baselines/reference/catchClauseWithTypeAnnotation.errors.txt index 9d982bca4f517..385a180da6ac0 100644 --- a/tests/baselines/reference/catchClauseWithTypeAnnotation.errors.txt +++ b/tests/baselines/reference/catchClauseWithTypeAnnotation.errors.txt @@ -1,11 +1,11 @@ -catchClauseWithTypeAnnotation.ts(17,36): error TS2339: Property 'foo' does not exist on type 'unknown'. -catchClauseWithTypeAnnotation.ts(18,37): error TS2339: Property 'foo' does not exist on type 'unknown'. +catchClauseWithTypeAnnotation.ts(17,34): error TS18046: 'x' is of type 'unknown'. +catchClauseWithTypeAnnotation.ts(18,35): error TS18046: 'x' is of type 'unknown'. catchClauseWithTypeAnnotation.ts(19,23): error TS1196: Catch clause variable type annotation must be 'any' or 'unknown' if specified. catchClauseWithTypeAnnotation.ts(20,23): error TS1196: Catch clause variable type annotation must be 'any' or 'unknown' if specified. catchClauseWithTypeAnnotation.ts(29,29): error TS2492: Cannot redeclare identifier 'x' in catch clause. catchClauseWithTypeAnnotation.ts(30,29): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'boolean', but here has type 'string'. -catchClauseWithTypeAnnotation.ts(36,22): error TS2339: Property 'x' does not exist on type '{}'. -catchClauseWithTypeAnnotation.ts(37,22): error TS2339: Property 'x' does not exist on type '{}'. +catchClauseWithTypeAnnotation.ts(36,22): error TS2339: Property 'x' does not exist on type 'unknown'. +catchClauseWithTypeAnnotation.ts(37,22): error TS2339: Property 'x' does not exist on type 'unknown'. catchClauseWithTypeAnnotation.ts(38,27): error TS1196: Catch clause variable type annotation must be 'any' or 'unknown' if specified. catchClauseWithTypeAnnotation.ts(39,27): error TS1196: Catch clause variable type annotation must be 'any' or 'unknown' if specified. @@ -28,11 +28,11 @@ catchClauseWithTypeAnnotation.ts(39,27): error TS1196: Catch clause variable typ try { } catch (x: unknown) { console.log(x); } // should be OK try { } catch (x: unknown1) { console.log(x); } // should be OK try { } catch (x: unknown) { x.foo; } // error in the body - ~~~ -!!! error TS2339: Property 'foo' does not exist on type 'unknown'. + ~ +!!! error TS18046: 'x' is of type 'unknown'. try { } catch (x: unknown1) { x.foo; } // error in the body - ~~~ -!!! error TS2339: Property 'foo' does not exist on type 'unknown'. + ~ +!!! error TS18046: 'x' is of type 'unknown'. try { } catch (x: Error) { } // error in the type ~~~~~ !!! error TS1196: Catch clause variable type annotation must be 'any' or 'unknown' if specified. @@ -61,10 +61,10 @@ catchClauseWithTypeAnnotation.ts(39,27): error TS1196: Catch clause variable typ try { } catch ({ x }: any1) { x.foo;} // should be OK try { } catch ({ x }: unknown) { console.log(x); } // error in the destructure ~ -!!! error TS2339: Property 'x' does not exist on type '{}'. +!!! error TS2339: Property 'x' does not exist on type 'unknown'. try { } catch ({ x }: unknown1) { console.log(x); } // error in the destructure ~ -!!! error TS2339: Property 'x' does not exist on type '{}'. +!!! error TS2339: Property 'x' does not exist on type 'unknown'. try { } catch ({ x }: object) { } // error in the type ~~~~~~ !!! error TS1196: Catch clause variable type annotation must be 'any' or 'unknown' if specified. diff --git a/tests/baselines/reference/catchClauseWithTypeAnnotation.js b/tests/baselines/reference/catchClauseWithTypeAnnotation.js index a600f13719561..1d0e640550ef2 100644 --- a/tests/baselines/reference/catchClauseWithTypeAnnotation.js +++ b/tests/baselines/reference/catchClauseWithTypeAnnotation.js @@ -44,6 +44,7 @@ function fn(x: boolean) { //// [catchClauseWithTypeAnnotation.js] +"use strict"; function fn(x) { // no type annotation allowed other than `any` and `unknown` try { } diff --git a/tests/baselines/reference/cf.js b/tests/baselines/reference/cf.js index 025f7e4cd88f7..2798a2aa2c4e6 100644 --- a/tests/baselines/reference/cf.js +++ b/tests/baselines/reference/cf.js @@ -60,6 +60,7 @@ function f() { //// [cf.js] +"use strict"; function f() { var z; var x = 10; diff --git a/tests/baselines/reference/cf.types b/tests/baselines/reference/cf.types index eff12a94eeff7..c68557a9f3a30 100644 --- a/tests/baselines/reference/cf.types +++ b/tests/baselines/reference/cf.types @@ -181,8 +181,8 @@ function f() { } } catch (e) { ->e : any -> : ^^^ +>e : unknown +> : ^^^^^^^ x++; >x++ : number @@ -222,8 +222,8 @@ function f() { > : ^^^^^^ z; ->z : any -> : ^^^ +>z : undefined +> : ^^^^^^^^^ break; } diff --git a/tests/baselines/reference/chainedAssignment1.js b/tests/baselines/reference/chainedAssignment1.js index c89e3356f8f6c..89e57a98a7469 100644 --- a/tests/baselines/reference/chainedAssignment1.js +++ b/tests/baselines/reference/chainedAssignment1.js @@ -25,6 +25,7 @@ c1 = c2 = c3; // a bug made this not report the same error as below c2 = c3; // Error TS111: Cannot convert Z to Y //// [chainedAssignment1.js] +"use strict"; class X { constructor(z) { this.z = z; diff --git a/tests/baselines/reference/chainedAssignment2.errors.txt b/tests/baselines/reference/chainedAssignment2.errors.txt new file mode 100644 index 0000000000000..06b8da291474a --- /dev/null +++ b/tests/baselines/reference/chainedAssignment2.errors.txt @@ -0,0 +1,27 @@ +chainedAssignment2.ts(7,1): error TS2322: Type 'null' is not assignable to type 'string'. +chainedAssignment2.ts(7,5): error TS2322: Type 'null' is not assignable to type 'number'. +chainedAssignment2.ts(7,9): error TS2322: Type 'null' is not assignable to type 'boolean'. +chainedAssignment2.ts(7,13): error TS2322: Type 'null' is not assignable to type 'Date'. +chainedAssignment2.ts(7,17): error TS2322: Type 'null' is not assignable to type 'RegExp'. + + +==== chainedAssignment2.ts (5 errors) ==== + var a: string; + var b: number; + var c: boolean; + var d: Date; + var e: RegExp; + + a = b = c = d = e = null; + ~ +!!! error TS2322: Type 'null' is not assignable to type 'string'. + ~ +!!! error TS2322: Type 'null' is not assignable to type 'number'. + ~ +!!! error TS2322: Type 'null' is not assignable to type 'boolean'. + ~ +!!! error TS2322: Type 'null' is not assignable to type 'Date'. + ~ +!!! error TS2322: Type 'null' is not assignable to type 'RegExp'. + + \ No newline at end of file diff --git a/tests/baselines/reference/chainedAssignment2.js b/tests/baselines/reference/chainedAssignment2.js index 7a92c942d7f1f..6c159fd5fc567 100644 --- a/tests/baselines/reference/chainedAssignment2.js +++ b/tests/baselines/reference/chainedAssignment2.js @@ -12,6 +12,7 @@ a = b = c = d = e = null; //// [chainedAssignment2.js] +"use strict"; var a; var b; var c; diff --git a/tests/baselines/reference/chainedAssignment3.errors.txt b/tests/baselines/reference/chainedAssignment3.errors.txt index 81f05df13d77c..c86f72aa2c4a0 100644 --- a/tests/baselines/reference/chainedAssignment3.errors.txt +++ b/tests/baselines/reference/chainedAssignment3.errors.txt @@ -1,23 +1,41 @@ +chainedAssignment3.ts(2,5): error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. +chainedAssignment3.ts(6,5): error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor. +chainedAssignment3.ts(11,1): error TS2322: Type 'null' is not assignable to type 'A'. +chainedAssignment3.ts(11,5): error TS2322: Type 'null' is not assignable to type 'B'. +chainedAssignment3.ts(15,1): error TS2322: Type 'null' is not assignable to type 'number'. +chainedAssignment3.ts(15,8): error TS2322: Type 'null' is not assignable to type 'string'. chainedAssignment3.ts(18,1): error TS2741: Property 'value' is missing in type 'A' but required in type 'B'. chainedAssignment3.ts(19,5): error TS2741: Property 'value' is missing in type 'A' but required in type 'B'. -==== chainedAssignment3.ts (2 errors) ==== +==== chainedAssignment3.ts (8 errors) ==== class A { id: number; + ~~ +!!! error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. } class B extends A { value: string; + ~~~~~ +!!! error TS2564: Property 'value' has no initializer and is not definitely assigned in the constructor. } var a: A; var b: B; a = b = null; + ~ +!!! error TS2322: Type 'null' is not assignable to type 'A'. + ~ +!!! error TS2322: Type 'null' is not assignable to type 'B'. a = b = new B(); b = a = new B(); a.id = b.value = null; + ~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'number'. + ~~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'string'. // error cases b = a = new A(); diff --git a/tests/baselines/reference/chainedAssignment3.js b/tests/baselines/reference/chainedAssignment3.js index 43e5729f5622f..56bd95ac816c8 100644 --- a/tests/baselines/reference/chainedAssignment3.js +++ b/tests/baselines/reference/chainedAssignment3.js @@ -25,6 +25,7 @@ a = b = new A(); //// [chainedAssignment3.js] +"use strict"; class A { } class B extends A { diff --git a/tests/baselines/reference/chainedAssignmentChecking.js b/tests/baselines/reference/chainedAssignmentChecking.js index f7dd29154fe25..05c1550064d4f 100644 --- a/tests/baselines/reference/chainedAssignmentChecking.js +++ b/tests/baselines/reference/chainedAssignmentChecking.js @@ -25,6 +25,7 @@ c1 = c2 = c3; // Should be error //// [chainedAssignmentChecking.js] +"use strict"; class X { constructor(z) { this.z = z; diff --git a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js index b4db0fe8242eb..effc23dd08c40 100644 --- a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js +++ b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js @@ -22,6 +22,7 @@ class C extends B { (new Chain(new A)).then(a => new B).then(b => new C).then(c => new B).then(b => new A); //// [chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js] +"use strict"; class Chain { constructor(value) { this.value = value; diff --git a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.js b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.js index 29c0b9d7bc118..428b5ac422c81 100644 --- a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.js +++ b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.js @@ -44,6 +44,7 @@ class Chain2 { } //// [chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.js] +"use strict"; class Chain { constructor(value) { this.value = value; diff --git a/tests/baselines/reference/chainedSpecializationToObjectTypeLiteral.errors.txt b/tests/baselines/reference/chainedSpecializationToObjectTypeLiteral.errors.txt new file mode 100644 index 0000000000000..356f2bdd5e205 --- /dev/null +++ b/tests/baselines/reference/chainedSpecializationToObjectTypeLiteral.errors.txt @@ -0,0 +1,17 @@ +chainedSpecializationToObjectTypeLiteral.ts(9,10): error TS2454: Variable 's' is used before being assigned. + + +==== chainedSpecializationToObjectTypeLiteral.ts (1 errors) ==== + interface Sequence { + each(iterator: (value: T) => void): void; + map(iterator: (value: T) => U): Sequence; + filter(iterator: (value: T) => boolean): Sequence; + groupBy(keySelector: (value: T) => K): Sequence<{ key: K; items: T[]; }>; + } + + var s: Sequence; + var s2 = s.groupBy(s => s.length); + ~ +!!! error TS2454: Variable 's' is used before being assigned. + var s3 = s2.each(x => { x.key /* Type is K, should be number */ }); + \ No newline at end of file diff --git a/tests/baselines/reference/chainedSpecializationToObjectTypeLiteral.js b/tests/baselines/reference/chainedSpecializationToObjectTypeLiteral.js index 91db4982ff52b..0973fd842a567 100644 --- a/tests/baselines/reference/chainedSpecializationToObjectTypeLiteral.js +++ b/tests/baselines/reference/chainedSpecializationToObjectTypeLiteral.js @@ -14,6 +14,7 @@ var s3 = s2.each(x => { x.key /* Type is K, should be number */ }); //// [chainedSpecializationToObjectTypeLiteral.js] +"use strict"; var s; var s2 = s.groupBy(s => s.length); var s3 = s2.each(x => { x.key; /* Type is K, should be number */ }); diff --git a/tests/baselines/reference/checkDestructuringShorthandAssigment.types b/tests/baselines/reference/checkDestructuringShorthandAssigment.types index 705c1b672ceca..5454fb00cb680 100644 --- a/tests/baselines/reference/checkDestructuringShorthandAssigment.types +++ b/tests/baselines/reference/checkDestructuringShorthandAssigment.types @@ -3,8 +3,8 @@ === bug25434.js === // should not crash while checking function Test({ b = '' } = {}) {} ->Test : ({ b }?: { b?: string; }) => void -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Test : ({ b }?: { b?: string | undefined; }) => void +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >b : string > : ^^^^^^ >'' : "" @@ -15,8 +15,8 @@ function Test({ b = '' } = {}) {} Test(({ b = '5' } = {})); >Test(({ b = '5' } = {})) : void > : ^^^^ ->Test : ({ b }?: { b?: string; }) => void -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Test : ({ b }?: { b?: string | undefined; }) => void +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >({ b = '5' } = {}) : {} > : ^^ >{ b = '5' } = {} : {} diff --git a/tests/baselines/reference/checkForObjectTooStrict(target=es2015).js b/tests/baselines/reference/checkForObjectTooStrict(target=es2015).js index a06c49b4ed5f2..3e5c1a0870a30 100644 --- a/tests/baselines/reference/checkForObjectTooStrict(target=es2015).js +++ b/tests/baselines/reference/checkForObjectTooStrict(target=es2015).js @@ -34,6 +34,7 @@ class Baz extends Object { //// [checkForObjectTooStrict.js] +"use strict"; var Foo; (function (Foo) { class Object { diff --git a/tests/baselines/reference/checkForObjectTooStrict(target=es5).js b/tests/baselines/reference/checkForObjectTooStrict(target=es5).js index bf3ec1631135b..a3881beb926b1 100644 --- a/tests/baselines/reference/checkForObjectTooStrict(target=es5).js +++ b/tests/baselines/reference/checkForObjectTooStrict(target=es5).js @@ -34,6 +34,7 @@ class Baz extends Object { //// [checkForObjectTooStrict.js] +"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || diff --git a/tests/baselines/reference/checkInfiniteExpansionTermination.js b/tests/baselines/reference/checkInfiniteExpansionTermination.js index d54c2d76667ae..1c1abe413423f 100644 --- a/tests/baselines/reference/checkInfiniteExpansionTermination.js +++ b/tests/baselines/reference/checkInfiniteExpansionTermination.js @@ -20,6 +20,7 @@ values = values2; //// [checkInfiniteExpansionTermination.js] +"use strict"; // Regression test for #1002 // Before fix this code would cause infinite loop var values; diff --git a/tests/baselines/reference/checkInfiniteExpansionTermination2.js b/tests/baselines/reference/checkInfiniteExpansionTermination2.js index 9726e7840487d..d6e4f32fe4998 100644 --- a/tests/baselines/reference/checkInfiniteExpansionTermination2.js +++ b/tests/baselines/reference/checkInfiniteExpansionTermination2.js @@ -20,6 +20,7 @@ function fn() { //// [checkInfiniteExpansionTermination2.js] +"use strict"; // Regression test for #1002 // Before fix this code would cause infinite loop function fn() { diff --git a/tests/baselines/reference/checkInterfaceBases.js b/tests/baselines/reference/checkInterfaceBases.js index a30f4938c9e6d..812ba5e1cd763 100644 --- a/tests/baselines/reference/checkInterfaceBases.js +++ b/tests/baselines/reference/checkInterfaceBases.js @@ -16,4 +16,5 @@ interface Third extends JQueryEventObjectTest, SecondEvent {} //// [app.js] +"use strict"; /// diff --git a/tests/baselines/reference/checkJsFiles7.types b/tests/baselines/reference/checkJsFiles7.types index de39c9f4f526b..1a18f235e4db7 100644 --- a/tests/baselines/reference/checkJsFiles7.types +++ b/tests/baselines/reference/checkJsFiles7.types @@ -20,18 +20,18 @@ class C { > : ^^^^ this.a = !!this.a; ->this.a = !!this.a : boolean -> : ^^^^^^^ +>this.a = !!this.a : true +> : ^^^^ >this.a : boolean > : ^^^^^^^ >this : this > : ^^^^ >a : boolean > : ^^^^^^^ ->!!this.a : boolean -> : ^^^^^^^ ->!this.a : boolean -> : ^^^^^^^ +>!!this.a : true +> : ^^^^ +>!this.a : false +> : ^^^^^ >this.a : true > : ^^^^ >this : this diff --git a/tests/baselines/reference/checkJsObjectLiteralHasCheckedKeyof.js b/tests/baselines/reference/checkJsObjectLiteralHasCheckedKeyof.js index 19cd46fb0d40b..148f041bff33f 100644 --- a/tests/baselines/reference/checkJsObjectLiteralHasCheckedKeyof.js +++ b/tests/baselines/reference/checkJsObjectLiteralHasCheckedKeyof.js @@ -15,6 +15,7 @@ selected = "z"; // should fail //// [file.js] +"use strict"; // @ts-check const obj = { x: 1, diff --git a/tests/baselines/reference/checkJsObjectLiteralIndexSignatures.js b/tests/baselines/reference/checkJsObjectLiteralIndexSignatures.js index 1cb5b280d0484..573f925b840c9 100644 --- a/tests/baselines/reference/checkJsObjectLiteralIndexSignatures.js +++ b/tests/baselines/reference/checkJsObjectLiteralIndexSignatures.js @@ -15,6 +15,7 @@ stringIndex[s].toFixed(); //// [file.js] +"use strict"; // @ts-check let n = Math.random(); let s = `${n}`; diff --git a/tests/baselines/reference/checkJsTypeDefNoUnusedLocalMarked.errors.txt b/tests/baselines/reference/checkJsTypeDefNoUnusedLocalMarked.errors.txt new file mode 100644 index 0000000000000..c9d7ffc27d80b --- /dev/null +++ b/tests/baselines/reference/checkJsTypeDefNoUnusedLocalMarked.errors.txt @@ -0,0 +1,24 @@ +file.ts(2,5): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. +something.js(5,29): error TS2352: Conversion of type 'undefined' to type 'FooFun' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. + + +==== file.ts (1 errors) ==== + class Foo { + x: number; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. + } + + declare global { + var module: any; // Just here to remove unrelated error from test + } + + export = Foo; +==== something.js (1 errors) ==== + /** @typedef {typeof import("./file")} Foo */ + + /** @typedef {(foo: Foo) => string} FooFun */ + + module.exports = /** @type {FooFun} */(void 0); + ~~~~~~ +!!! error TS2352: Conversion of type 'undefined' to type 'FooFun' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. \ No newline at end of file diff --git a/tests/baselines/reference/checkJsTypeDefNoUnusedLocalMarked.types b/tests/baselines/reference/checkJsTypeDefNoUnusedLocalMarked.types index 9d28bf626388c..eee3fe88f3aa0 100644 --- a/tests/baselines/reference/checkJsTypeDefNoUnusedLocalMarked.types +++ b/tests/baselines/reference/checkJsTypeDefNoUnusedLocalMarked.types @@ -16,6 +16,7 @@ declare global { var module: any; // Just here to remove unrelated error from test >module : any +> : ^^^ } export = Foo; diff --git a/tests/baselines/reference/checkJsdocOnEndOfFile.js b/tests/baselines/reference/checkJsdocOnEndOfFile.js index 2afda1d7ed4ec..082e8f1369c00 100644 --- a/tests/baselines/reference/checkJsdocOnEndOfFile.js +++ b/tests/baselines/reference/checkJsdocOnEndOfFile.js @@ -7,6 +7,7 @@ //// [output.js] +"use strict"; /** * @typedef {Array} Should have error here */ diff --git a/tests/baselines/reference/checkJsdocOptionalParamOrder.js b/tests/baselines/reference/checkJsdocOptionalParamOrder.js index fb8c21dabd77f..e57bdb1c2a729 100644 --- a/tests/baselines/reference/checkJsdocOptionalParamOrder.js +++ b/tests/baselines/reference/checkJsdocOptionalParamOrder.js @@ -11,6 +11,7 @@ function foo(a, b, c) {} //// [0.js] +"use strict"; // @ts-check /** * @param {number} a diff --git a/tests/baselines/reference/checkJsdocOptionalParamOrder.types b/tests/baselines/reference/checkJsdocOptionalParamOrder.types index af93ca4af4201..fd123e08329a9 100644 --- a/tests/baselines/reference/checkJsdocOptionalParamOrder.types +++ b/tests/baselines/reference/checkJsdocOptionalParamOrder.types @@ -12,8 +12,8 @@ function foo(a, b, c) {} > : ^ ^^ ^^ ^^^ ^^ ^^ ^^^^^^^^^ >a : number > : ^^^^^^ ->b : number -> : ^^^^^^ +>b : number | undefined +> : ^^^^^^^^^^^^^^^^^^ >c : number > : ^^^^^^ diff --git a/tests/baselines/reference/checkJsdocParamOnVariableDeclaredFunctionExpression.js b/tests/baselines/reference/checkJsdocParamOnVariableDeclaredFunctionExpression.js index fc3748709e8a5..8d34ba0fe0f48 100644 --- a/tests/baselines/reference/checkJsdocParamOnVariableDeclaredFunctionExpression.js +++ b/tests/baselines/reference/checkJsdocParamOnVariableDeclaredFunctionExpression.js @@ -20,6 +20,7 @@ var one = function (s) { }, two = function (untyped) { }; //// [0.js] +"use strict"; // @ts-check /** * @param {number=} n diff --git a/tests/baselines/reference/checkJsdocParamTag1.js b/tests/baselines/reference/checkJsdocParamTag1.js index 495daf0bcae8d..e13c75af15d64 100644 --- a/tests/baselines/reference/checkJsdocParamTag1.js +++ b/tests/baselines/reference/checkJsdocParamTag1.js @@ -13,6 +13,7 @@ foo(1); foo(1, "hi"); //// [0.js] +"use strict"; // @ts-check /** * @param {number=} n diff --git a/tests/baselines/reference/checkJsdocParamTag1.types b/tests/baselines/reference/checkJsdocParamTag1.types index 22ca3c84b722f..fbccc2c811b11 100644 --- a/tests/baselines/reference/checkJsdocParamTag1.types +++ b/tests/baselines/reference/checkJsdocParamTag1.types @@ -9,10 +9,10 @@ function foo(n, s) {} >foo : (n?: number | undefined, s?: string) => void > : ^ ^^^ ^^^^^^^^^^^ ^^^ ^^^^^^^^^ ->n : number -> : ^^^^^^ ->s : string -> : ^^^^^^ +>n : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>s : string | undefined +> : ^^^^^^^^^^^^^^^^^^ foo(); >foo() : void diff --git a/tests/baselines/reference/checkJsdocReturnTag1.js b/tests/baselines/reference/checkJsdocReturnTag1.js index 128550bf26156..d0ce5259844f0 100644 --- a/tests/baselines/reference/checkJsdocReturnTag1.js +++ b/tests/baselines/reference/checkJsdocReturnTag1.js @@ -25,6 +25,7 @@ function f2() { //// [dummy.js] +"use strict"; // @ts-check /** * @returns {string} This comment is not currently exposed diff --git a/tests/baselines/reference/checkJsdocReturnTag1.types b/tests/baselines/reference/checkJsdocReturnTag1.types index 86d982813fbd9..a229d0a0fea27 100644 --- a/tests/baselines/reference/checkJsdocReturnTag1.types +++ b/tests/baselines/reference/checkJsdocReturnTag1.types @@ -34,8 +34,8 @@ function f2() { > : ^^^^^^ return 5 || "hello"; ->5 || "hello" : "hello" | 5 -> : ^^^^^^^^^^^ +>5 || "hello" : 5 +> : ^ >5 : 5 > : ^ >"hello" : "hello" diff --git a/tests/baselines/reference/checkJsdocReturnTag2.errors.txt b/tests/baselines/reference/checkJsdocReturnTag2.errors.txt index f1a0fab470ea6..cd48d72b0c4be 100644 --- a/tests/baselines/reference/checkJsdocReturnTag2.errors.txt +++ b/tests/baselines/reference/checkJsdocReturnTag2.errors.txt @@ -1,12 +1,10 @@ error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. returns.js(6,5): error TS2322: Type 'number' is not assignable to type 'string'. -returns.js(13,5): error TS2322: Type 'number | boolean' is not assignable to type 'string | number'. - Type 'boolean' is not assignable to type 'string | number'. returns.js(13,12): error TS2872: This kind of expression is always truthy. !!! error TS5101: Option 'outFile' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== returns.js (3 errors) ==== +==== returns.js (2 errors) ==== // @ts-check /** * @returns {string} This comment is not currently exposed @@ -22,9 +20,6 @@ returns.js(13,12): error TS2872: This kind of expression is always truthy. */ function f1() { return 5 || true; - ~~~~~~ -!!! error TS2322: Type 'number | boolean' is not assignable to type 'string | number'. -!!! error TS2322: Type 'boolean' is not assignable to type 'string | number'. ~ !!! error TS2872: This kind of expression is always truthy. } diff --git a/tests/baselines/reference/checkJsdocReturnTag2.js b/tests/baselines/reference/checkJsdocReturnTag2.js index fb39bc68dc450..1fe3bac735cda 100644 --- a/tests/baselines/reference/checkJsdocReturnTag2.js +++ b/tests/baselines/reference/checkJsdocReturnTag2.js @@ -18,6 +18,7 @@ function f1() { //// [dummy.js] +"use strict"; // @ts-check /** * @returns {string} This comment is not currently exposed diff --git a/tests/baselines/reference/checkJsdocReturnTag2.types b/tests/baselines/reference/checkJsdocReturnTag2.types index eb45cf3aad71b..b2ffe5deb99f4 100644 --- a/tests/baselines/reference/checkJsdocReturnTag2.types +++ b/tests/baselines/reference/checkJsdocReturnTag2.types @@ -22,8 +22,8 @@ function f1() { > : ^^^^^^ return 5 || true; ->5 || true : true | 5 -> : ^^^^^^^^ +>5 || true : 5 +> : ^ >5 : 5 > : ^ >true : true diff --git a/tests/baselines/reference/checkJsdocTypeTag1.errors.txt b/tests/baselines/reference/checkJsdocTypeTag1.errors.txt index 9a2afaa049b76..b2b5ebd9937d5 100644 --- a/tests/baselines/reference/checkJsdocTypeTag1.errors.txt +++ b/tests/baselines/reference/checkJsdocTypeTag1.errors.txt @@ -1,7 +1,10 @@ +0.js(17,12): error TS7006: Parameter 'a' implicitly has an 'any' type. +0.js(21,12): error TS7006: Parameter 'a' implicitly has an 'any' type. 0.js(24,12): error TS7014: Function type, which lacks return-type annotation, implicitly has an 'any' return type. +0.js(40,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'props' must be of type 'object', but here has type 'Object'. -==== 0.js (1 errors) ==== +==== 0.js (4 errors) ==== // @ts-check /** @type {String} */ var S = "hello world"; @@ -19,10 +22,14 @@ /** @type {Function} */ const x = (a) => a + 1; + ~ +!!! error TS7006: Parameter 'a' implicitly has an 'any' type. x(1); /** @type {function} */ const y = (a) => a + 1; + ~ +!!! error TS7006: Parameter 'a' implicitly has an 'any' type. y(1); /** @type {function (number)} */ @@ -44,4 +51,7 @@ * @type {Object} */ var props = {}; + ~~~~~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'props' must be of type 'object', but here has type 'Object'. +!!! related TS6203 0.js:35:5: 'props' was also declared here. \ No newline at end of file diff --git a/tests/baselines/reference/checkJsdocTypeTag1.js b/tests/baselines/reference/checkJsdocTypeTag1.js index a154f9d89a479..e8d63e408a91f 100644 --- a/tests/baselines/reference/checkJsdocTypeTag1.js +++ b/tests/baselines/reference/checkJsdocTypeTag1.js @@ -44,6 +44,7 @@ var props = {}; //// [0.js] +"use strict"; // @ts-check /** @type {String} */ var S = "hello world"; diff --git a/tests/baselines/reference/checkJsdocTypeTag1.types b/tests/baselines/reference/checkJsdocTypeTag1.types index 78b5455e241b1..7397eecf13468 100644 --- a/tests/baselines/reference/checkJsdocTypeTag1.types +++ b/tests/baselines/reference/checkJsdocTypeTag1.types @@ -142,8 +142,8 @@ x2(0); * @type {object} */ var props = {}; ->props : any -> : ^^^ +>props : object +> : ^^^^^^ >{} : {} > : ^^ @@ -151,8 +151,8 @@ var props = {}; * @type {Object} */ var props = {}; ->props : any -> : ^^^ +>props : object +> : ^^^^^^ >{} : {} > : ^^ diff --git a/tests/baselines/reference/checkJsdocTypeTag2.js b/tests/baselines/reference/checkJsdocTypeTag2.js index ee542d60a97e7..b245b445c506d 100644 --- a/tests/baselines/reference/checkJsdocTypeTag2.js +++ b/tests/baselines/reference/checkJsdocTypeTag2.js @@ -28,6 +28,7 @@ const x4 = (a) => a + 1; x4(0); //// [0.js] +"use strict"; // @ts-check /** @type {String} */ var S = true; diff --git a/tests/baselines/reference/checkJsdocTypeTag3.types b/tests/baselines/reference/checkJsdocTypeTag3.types index d7155a5766018..3ee119735b394 100644 --- a/tests/baselines/reference/checkJsdocTypeTag3.types +++ b/tests/baselines/reference/checkJsdocTypeTag3.types @@ -3,6 +3,6 @@ === test.js === /** @type {Array} */ var nns; ->nns : number[] -> : ^^^^^^^^ +>nns : (number | null)[] +> : ^^^^^^^^^^^^^^^^^ diff --git a/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment1.js b/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment1.js index ad2d034a27f9a..6e1334cdd5d70 100644 --- a/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment1.js +++ b/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment1.js @@ -18,6 +18,7 @@ a; //// [checkJsdocTypeTagOnExportAssignment1.js] +"use strict"; //// [a.js] "use strict"; /** diff --git a/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment2.js b/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment2.js index cb7d1e31eeabf..af23e8171a83a 100644 --- a/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment2.js +++ b/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment2.js @@ -18,6 +18,7 @@ b; //// [checkJsdocTypeTagOnExportAssignment2.js] +"use strict"; //// [a.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment3.js b/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment3.js index f97a3ac134f9e..438433e620d55 100644 --- a/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment3.js +++ b/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment3.js @@ -20,6 +20,7 @@ a; //// [checkJsdocTypeTagOnExportAssignment3.js] +"use strict"; //// [a.js] "use strict"; /** diff --git a/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment4.js b/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment4.js index 3e280248f4c98..0f223486be07d 100644 --- a/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment4.js +++ b/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment4.js @@ -13,6 +13,7 @@ export default ""; //// [checkJsdocTypeTagOnExportAssignment4.js] +"use strict"; //// [a.js] "use strict"; /** diff --git a/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment5.js b/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment5.js index 88badb94e9166..a1681c3005b61 100644 --- a/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment5.js +++ b/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment5.js @@ -18,6 +18,7 @@ a; //// [checkJsdocTypeTagOnExportAssignment5.js] +"use strict"; //// [a.js] "use strict"; /** diff --git a/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment6.js b/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment6.js index dbdd725c30c6f..8b728db4b8bda 100644 --- a/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment6.js +++ b/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment6.js @@ -18,6 +18,7 @@ a; //// [checkJsdocTypeTagOnExportAssignment6.js] +"use strict"; //// [a.js] "use strict"; /** diff --git a/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment7.js b/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment7.js index c77ce904d2fa2..6404f542a995f 100644 --- a/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment7.js +++ b/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment7.js @@ -20,6 +20,7 @@ a; //// [checkJsdocTypeTagOnExportAssignment7.js] +"use strict"; //// [a.js] "use strict"; /** diff --git a/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment8.js b/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment8.js index b63560b276ed1..5b00e961467ac 100644 --- a/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment8.js +++ b/tests/baselines/reference/checkJsdocTypeTagOnExportAssignment8.js @@ -17,6 +17,7 @@ export default { //// [checkJsdocTypeTagOnExportAssignment8.js] +"use strict"; //// [a.js] "use strict"; /** diff --git a/tests/baselines/reference/checkJsdocTypeTagOnObjectProperty1.js b/tests/baselines/reference/checkJsdocTypeTagOnObjectProperty1.js index 015c24d006fe3..57e5a2c467e35 100644 --- a/tests/baselines/reference/checkJsdocTypeTagOnObjectProperty1.js +++ b/tests/baselines/reference/checkJsdocTypeTagOnObjectProperty1.js @@ -27,6 +27,7 @@ obj.bar1 = "42"; obj.arrowFunc(0); //// [0.js] +"use strict"; // @ts-check var lol = "hello Lol"; const obj = { diff --git a/tests/baselines/reference/checkJsdocTypeTagOnObjectProperty2.js b/tests/baselines/reference/checkJsdocTypeTagOnObjectProperty2.js index a2333e6b998b2..bdec4f70bed72 100644 --- a/tests/baselines/reference/checkJsdocTypeTagOnObjectProperty2.js +++ b/tests/baselines/reference/checkJsdocTypeTagOnObjectProperty2.js @@ -25,6 +25,7 @@ var s = obj.method1(0); var s1 = obj.method2("0"); //// [0.js] +"use strict"; // @ts-check var lol; const obj = { diff --git a/tests/baselines/reference/checkJsdocTypedefInParamTag1.js b/tests/baselines/reference/checkJsdocTypedefInParamTag1.js index 15c7e79d6f7bb..8a6f8f5462b1d 100644 --- a/tests/baselines/reference/checkJsdocTypedefInParamTag1.js +++ b/tests/baselines/reference/checkJsdocTypedefInParamTag1.js @@ -46,6 +46,7 @@ foo2({x: 'abc'}); //// [0.js] +"use strict"; // @ts-check /** * @typedef {Object} Opts diff --git a/tests/baselines/reference/checkJsdocTypedefOnlySourceFile.js b/tests/baselines/reference/checkJsdocTypedefOnlySourceFile.js index 76a2b24725d0b..121c3b518226b 100644 --- a/tests/baselines/reference/checkJsdocTypedefOnlySourceFile.js +++ b/tests/baselines/reference/checkJsdocTypedefOnlySourceFile.js @@ -15,6 +15,7 @@ const myString = 'str'; //// [0.js] +"use strict"; // @ts-check var exports = {}; /** diff --git a/tests/baselines/reference/checkJsxChildrenProperty10.errors.txt b/tests/baselines/reference/checkJsxChildrenProperty10.errors.txt new file mode 100644 index 0000000000000..28b6a68f000b9 --- /dev/null +++ b/tests/baselines/reference/checkJsxChildrenProperty10.errors.txt @@ -0,0 +1,28 @@ +file.tsx(12,2): error TS2564: Property 'props' has no initializer and is not definitely assigned in the constructor. + + +==== file.tsx (1 errors) ==== + declare namespace JSX { + interface Element { } + interface ElementAttributesProperty { props: {} } + interface IntrinsicElements { + div: any; + h2: any; + h1: any; + } + } + + class Button { + props: {} + ~~~~~ +!!! error TS2564: Property 'props' has no initializer and is not definitely assigned in the constructor. + render() { + return (
My Button
) + } + } + + // OK + let k1 =

Hello

world

; + let k2 =

Hello

{(user: any) =>

{user.name}

}
; + let k3 =
{1} {"That is a number"}
; + let k4 = ; \ No newline at end of file diff --git a/tests/baselines/reference/checkJsxChildrenProperty10.js b/tests/baselines/reference/checkJsxChildrenProperty10.js index 71f47b108f1b7..0ec86b68d0f22 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty10.js +++ b/tests/baselines/reference/checkJsxChildrenProperty10.js @@ -25,6 +25,7 @@ let k3 =
{1} {"That is a number"}
; let k4 = ; //// [file.jsx] +"use strict"; class Button { render() { return (
My Button
); diff --git a/tests/baselines/reference/checkJsxChildrenProperty10.types b/tests/baselines/reference/checkJsxChildrenProperty10.types index 5c89aaf80b123..f8116c7c7b5b0 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty10.types +++ b/tests/baselines/reference/checkJsxChildrenProperty10.types @@ -10,12 +10,15 @@ declare namespace JSX { interface IntrinsicElements { div: any; >div : any +> : ^^^ h2: any; >h2 : any +> : ^^^ h1: any; >h1 : any +> : ^^^ } } @@ -82,11 +85,13 @@ let k2 =

Hello

{(user: any) =>

{user.name}

}
; >(user: any) =>

{user.name}

: (user: any) => JSX.Element > : ^ ^^ ^^^^^^^^^^^^^^^^ >user : any +> : ^^^ >

{user.name}

: JSX.Element > : ^^^^^^^^^^^ >h2 : any > : ^^^ >user.name : any +> : ^^^ >user : any > : ^^^ >name : any diff --git a/tests/baselines/reference/checkJsxChildrenProperty11.errors.txt b/tests/baselines/reference/checkJsxChildrenProperty11.errors.txt new file mode 100644 index 0000000000000..28b6a68f000b9 --- /dev/null +++ b/tests/baselines/reference/checkJsxChildrenProperty11.errors.txt @@ -0,0 +1,28 @@ +file.tsx(12,2): error TS2564: Property 'props' has no initializer and is not definitely assigned in the constructor. + + +==== file.tsx (1 errors) ==== + declare namespace JSX { + interface Element { } + interface ElementAttributesProperty { props: {} } + interface IntrinsicElements { + div: any; + h2: any; + h1: any; + } + } + + class Button { + props: {} + ~~~~~ +!!! error TS2564: Property 'props' has no initializer and is not definitely assigned in the constructor. + render() { + return (
My Button
) + } + } + + // OK + let k1 =

Hello

world

; + let k2 =

Hello

{(user: any) =>

{user.name}

}
; + let k3 =
{1} {"That is a number"}
; + let k4 = ; \ No newline at end of file diff --git a/tests/baselines/reference/checkJsxChildrenProperty11.js b/tests/baselines/reference/checkJsxChildrenProperty11.js index d56ee32096b51..87efcf13fec01 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty11.js +++ b/tests/baselines/reference/checkJsxChildrenProperty11.js @@ -25,6 +25,7 @@ let k3 =
{1} {"That is a number"}
; let k4 = ; //// [file.jsx] +"use strict"; class Button { render() { return (
My Button
); diff --git a/tests/baselines/reference/checkJsxChildrenProperty11.types b/tests/baselines/reference/checkJsxChildrenProperty11.types index 8f1d25c7f9019..becc0a436e6d6 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty11.types +++ b/tests/baselines/reference/checkJsxChildrenProperty11.types @@ -10,12 +10,15 @@ declare namespace JSX { interface IntrinsicElements { div: any; >div : any +> : ^^^ h2: any; >h2 : any +> : ^^^ h1: any; >h1 : any +> : ^^^ } } @@ -82,11 +85,13 @@ let k2 =

Hello

{(user: any) =>

{user.name}

}
; >(user: any) =>

{user.name}

: (user: any) => JSX.Element > : ^ ^^ ^^^^^^^^^^^^^^^^ >user : any +> : ^^^ >

{user.name}

: JSX.Element > : ^^^^^^^^^^^ >h2 : any > : ^^^ >user.name : any +> : ^^^ >user : any > : ^^^ >name : any diff --git a/tests/baselines/reference/checkJsxChildrenProperty12.errors.txt b/tests/baselines/reference/checkJsxChildrenProperty12.errors.txt new file mode 100644 index 0000000000000..c0acaffc06a0b --- /dev/null +++ b/tests/baselines/reference/checkJsxChildrenProperty12.errors.txt @@ -0,0 +1,40 @@ +file.tsx(14,7): error TS2454: Variable 'condition' is used before being assigned. + + +==== file.tsx (1 errors) ==== + /// + + import React = require('react'); + + interface ButtonProp { + a: number, + b: string, + children: Button; + } + + class Button extends React.Component { + render() { + let condition: boolean; + if (condition) { + ~~~~~~~~~ +!!! error TS2454: Variable 'condition' is used before being assigned. + return + } + else { + return ( +
Hello World
+
); + } + } + } + + interface InnerButtonProp { + a: number + } + + class InnerButton extends React.Component { + render() { + return (); + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/checkJsxChildrenProperty3.types b/tests/baselines/reference/checkJsxChildrenProperty3.types index ec5fac460425d..8ed6c5331d92d 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty3.types +++ b/tests/baselines/reference/checkJsxChildrenProperty3.types @@ -34,12 +34,12 @@ class FetchUser extends React.Component { > : ^^^^^^^^^^^^^^^^^^^^^^ render() { ->render : () => JSX.Element -> : ^^^^^^^^^^^^^^^^^ +>render : () => JSX.Element | null +> : ^^^^^^^^^^^^^^^^^^^^^^^^ return this.state ->this.state ? this.props.children(this.state.result) : null : JSX.Element -> : ^^^^^^^^^^^ +>this.state ? this.props.children(this.state.result) : null : JSX.Element | null +> : ^^^^^^^^^^^^^^^^^^ >this.state : any >this : this > : ^^^^ @@ -49,16 +49,16 @@ class FetchUser extends React.Component { ? this.props.children(this.state.result) >this.props.children(this.state.result) : JSX.Element > : ^^^^^^^^^^^ ->this.props.children : ((user: IUser) => JSX.Element) & React.ReactNode -> : ^^ ^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^ +>this.props.children : ((user: IUser) => JSX.Element) & (React.ReactNode | undefined) +> : ^^ ^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >this.props : IFetchUserProps & { children?: React.ReactNode; } > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >this : this > : ^^^^ >props : IFetchUserProps & { children?: React.ReactNode; } > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->children : ((user: IUser) => JSX.Element) & React.ReactNode -> : ^^ ^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^ +>children : ((user: IUser) => JSX.Element) & (React.ReactNode | undefined) +> : ^^ ^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >this.state.result : any >this.state : any > : ^^^ diff --git a/tests/baselines/reference/checkJsxChildrenProperty4.types b/tests/baselines/reference/checkJsxChildrenProperty4.types index 2881a1a0d6712..d12b1ae5788a1 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty4.types +++ b/tests/baselines/reference/checkJsxChildrenProperty4.types @@ -34,12 +34,12 @@ class FetchUser extends React.Component { > : ^^^^^^^^^^^^^^^^^^^^^^ render() { ->render : () => JSX.Element -> : ^^^^^^^^^^^^^^^^^ +>render : () => JSX.Element | null +> : ^^^^^^^^^^^^^^^^^^^^^^^^ return this.state ->this.state ? this.props.children(this.state.result) : null : JSX.Element -> : ^^^^^^^^^^^ +>this.state ? this.props.children(this.state.result) : null : JSX.Element | null +> : ^^^^^^^^^^^^^^^^^^ >this.state : any > : ^^^ >this : this @@ -50,16 +50,16 @@ class FetchUser extends React.Component { ? this.props.children(this.state.result) >this.props.children(this.state.result) : JSX.Element > : ^^^^^^^^^^^ ->this.props.children : ((user: IUser) => JSX.Element) & React.ReactNode -> : ^^ ^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^ +>this.props.children : ((user: IUser) => JSX.Element) & (React.ReactNode | undefined) +> : ^^ ^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >this.props : IFetchUserProps & { children?: React.ReactNode; } > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >this : this > : ^^^^ >props : IFetchUserProps & { children?: React.ReactNode; } > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->children : ((user: IUser) => JSX.Element) & React.ReactNode -> : ^^ ^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^ +>children : ((user: IUser) => JSX.Element) & (React.ReactNode | undefined) +> : ^^ ^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >this.state.result : any > : ^^^ >this.state : any diff --git a/tests/baselines/reference/checkJsxGenericTagHasCorrectInferences.errors.txt b/tests/baselines/reference/checkJsxGenericTagHasCorrectInferences.errors.txt index 7b7808b7d2291..ca35bfde322d1 100644 --- a/tests/baselines/reference/checkJsxGenericTagHasCorrectInferences.errors.txt +++ b/tests/baselines/reference/checkJsxGenericTagHasCorrectInferences.errors.txt @@ -22,4 +22,4 @@ file.tsx(14,54): error TS2322: Type '(a: { x: string; }) => string' is not assig !!! error TS2322: Type '(a: { x: string; }) => string' is not assignable to type '((a: { x: string; }) => string) & ((cur: { x: string; }) => { x: string; })'. !!! error TS2322: Type '(a: { x: string; }) => string' is not assignable to type '(cur: { x: string; }) => { x: string; }'. !!! error TS2322: Type 'string' is not assignable to type '{ x: string; }'. -!!! related TS6500 file.tsx:14:54: The expected type comes from property 'nextValues' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes string; }, { x: string; }>> & { initialValues: { x: string; }; nextValues: (a: { x: string; }) => string; } & BaseProps<{ x: string; }> & { children?: ReactNode; }' \ No newline at end of file +!!! related TS6500 file.tsx:14:54: The expected type comes from property 'nextValues' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes string; }, { x: string; }>> & { initialValues: { x: string; }; nextValues: (a: { x: string; }) => string; } & BaseProps<{ x: string; }> & { children?: ReactNode | undefined; }' \ No newline at end of file diff --git a/tests/baselines/reference/checkJsxNamespaceNamesQuestionableForms.js b/tests/baselines/reference/checkJsxNamespaceNamesQuestionableForms.js index 091e48d9d981d..2b046156c35d5 100644 --- a/tests/baselines/reference/checkJsxNamespaceNamesQuestionableForms.js +++ b/tests/baselines/reference/checkJsxNamespaceNamesQuestionableForms.js @@ -16,6 +16,7 @@ declare namespace JSX { ; //// [checkJsxNamespaceNamesQuestionableForms.jsx] +"use strict"; ; ; x > ; diff --git a/tests/baselines/reference/checkMergedGlobalUMDSymbol.js b/tests/baselines/reference/checkMergedGlobalUMDSymbol.js index da256d6972157..445efab3d8717 100644 --- a/tests/baselines/reference/checkMergedGlobalUMDSymbol.js +++ b/tests/baselines/reference/checkMergedGlobalUMDSymbol.js @@ -19,4 +19,5 @@ const m = THREE //// [test.js] +"use strict"; const m = THREE; diff --git a/tests/baselines/reference/checkSpecialPropertyAssignments.types b/tests/baselines/reference/checkSpecialPropertyAssignments.types index 76d5181901d99..bb054f43ac294 100644 --- a/tests/baselines/reference/checkSpecialPropertyAssignments.types +++ b/tests/baselines/reference/checkSpecialPropertyAssignments.types @@ -27,8 +27,8 @@ A.B = class { var x = []; >x : string[] > : ^^^^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ /** @type {number[]} */ var y; diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.js index 62eb1bbd5656d..c432e53b1e199 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.js @@ -13,6 +13,7 @@ class Derived extends Based { } //// [checkSuperCallBeforeThisAccessing1.js] +"use strict"; class Based { } class Derived extends Based { diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing2.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing2.js index 72d8b72ca609c..679c47fbd00f6 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing2.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing2.js @@ -13,6 +13,7 @@ class Derived extends Based { } //// [checkSuperCallBeforeThisAccessing2.js] +"use strict"; class Based { } class Derived extends Based { diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.js index 5330f477c69a4..3d369f6b7a916 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.js @@ -18,6 +18,7 @@ class Derived extends Based { } //// [checkSuperCallBeforeThisAccessing3.js] +"use strict"; class Based { } class Derived extends Based { diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing4.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing4.js index f9bf1567fb4c6..09406126e1148 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing4.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing4.js @@ -22,6 +22,7 @@ class Derived extends Based { } //// [checkSuperCallBeforeThisAccessing4.js] +"use strict"; class Based { } class Derived extends Based { diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.errors.txt b/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.errors.txt index b1cd4dd330c33..fb270abf6fdea 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.errors.txt +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.errors.txt @@ -1,8 +1,11 @@ +checkSuperCallBeforeThisAccessing5.ts(1,27): error TS7019: Rest parameter 'arg' implicitly has an 'any[]' type. checkSuperCallBeforeThisAccessing5.ts(5,15): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. -==== checkSuperCallBeforeThisAccessing5.ts (1 errors) ==== +==== checkSuperCallBeforeThisAccessing5.ts (2 errors) ==== class Based { constructor(...arg) { } } + ~~~~~~ +!!! error TS7019: Rest parameter 'arg' implicitly has an 'any[]' type. class Derived extends Based { public x!: number; constructor() { diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.js index 0c616a8bd28f0..253bb9683af47 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.js @@ -10,6 +10,7 @@ class Derived extends Based { } //// [checkSuperCallBeforeThisAccessing5.js] +"use strict"; class Based { constructor(...arg) { } } diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing6.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing6.js index 0939adc895fb2..b769937eab932 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing6.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing6.js @@ -13,6 +13,7 @@ class Super extends Base { } //// [checkSuperCallBeforeThisAccessing6.js] +"use strict"; class Base { constructor(...arg) { } diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing7.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing7.js index f26d900fecc56..1cb5a9aeea21a 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing7.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing7.js @@ -12,6 +12,7 @@ class Super extends Base { } //// [checkSuperCallBeforeThisAccessing7.js] +"use strict"; class Base { constructor(func) { } diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing8.errors.txt b/tests/baselines/reference/checkSuperCallBeforeThisAccessing8.errors.txt index 2ba688bb224de..f5be361c64ffc 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing8.errors.txt +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing8.errors.txt @@ -1,9 +1,12 @@ +checkSuperCallBeforeThisAccessing8.ts(2,17): error TS7019: Rest parameter 'arg' implicitly has an 'any[]' type. checkSuperCallBeforeThisAccessing8.ts(7,20): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. -==== checkSuperCallBeforeThisAccessing8.ts (1 errors) ==== +==== checkSuperCallBeforeThisAccessing8.ts (2 errors) ==== class Base { constructor(...arg) { + ~~~~~~ +!!! error TS7019: Rest parameter 'arg' implicitly has an 'any[]' type. } } class Super extends Base { diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing8.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing8.js index b1d48da42421a..e4a64bbbea4eb 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing8.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing8.js @@ -13,6 +13,7 @@ class Super extends Base { } //// [checkSuperCallBeforeThisAccessing8.js] +"use strict"; class Base { constructor(...arg) { } diff --git a/tests/baselines/reference/checkSwitchStatementIfCaseTypeIsString.js b/tests/baselines/reference/checkSwitchStatementIfCaseTypeIsString.js index 87e599f570769..607aba19632a1 100644 --- a/tests/baselines/reference/checkSwitchStatementIfCaseTypeIsString.js +++ b/tests/baselines/reference/checkSwitchStatementIfCaseTypeIsString.js @@ -14,6 +14,7 @@ class A { } //// [checkSwitchStatementIfCaseTypeIsString.js] +"use strict"; class A { doIt(x) { x.forEach((v) => { diff --git a/tests/baselines/reference/checkTypePredicateForRedundantProperties.js b/tests/baselines/reference/checkTypePredicateForRedundantProperties.js index 9ff549b780937..fe0f37fd7ecee 100644 --- a/tests/baselines/reference/checkTypePredicateForRedundantProperties.js +++ b/tests/baselines/reference/checkTypePredicateForRedundantProperties.js @@ -7,6 +7,7 @@ function addProp2(x: any): x is { a: string; a: string; } { //// [checkTypePredicateForRedundantProperties.js] +"use strict"; function addProp2(x) { return true; } diff --git a/tests/baselines/reference/circularConstrainedMappedTypeNoCrash.js b/tests/baselines/reference/circularConstrainedMappedTypeNoCrash.js index 3836cd531b021..5edecd08149d5 100644 --- a/tests/baselines/reference/circularConstrainedMappedTypeNoCrash.js +++ b/tests/baselines/reference/circularConstrainedMappedTypeNoCrash.js @@ -6,3 +6,4 @@ type Loop> = { }; //// [circularConstrainedMappedTypeNoCrash.js] +"use strict"; diff --git a/tests/baselines/reference/circularConstraintYieldsAppropriateError.errors.txt b/tests/baselines/reference/circularConstraintYieldsAppropriateError.errors.txt index 0c1bc885d18d0..9ae3e848859b3 100644 --- a/tests/baselines/reference/circularConstraintYieldsAppropriateError.errors.txt +++ b/tests/baselines/reference/circularConstraintYieldsAppropriateError.errors.txt @@ -1,20 +1,29 @@ +circularConstraintYieldsAppropriateError.ts(3,5): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. +circularConstraintYieldsAppropriateError.ts(7,5): error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. circularConstraintYieldsAppropriateError.ts(10,7): error TS2310: Type 'Foo' recursively references itself as a base type. +circularConstraintYieldsAppropriateError.ts(11,5): error TS2564: Property 'someProp' has no initializer and is not definitely assigned in the constructor. -==== circularConstraintYieldsAppropriateError.ts (1 errors) ==== +==== circularConstraintYieldsAppropriateError.ts (4 errors) ==== // https://github.com/Microsoft/TypeScript/issues/16861 class BaseType { bar: T + ~~~ +!!! error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. } class NextType extends BaseType { baz: string; + ~~~ +!!! error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. } class Foo extends NextType { ~~~ !!! error TS2310: Type 'Foo' recursively references itself as a base type. someProp: { + ~~~~~~~~ +!!! error TS2564: Property 'someProp' has no initializer and is not definitely assigned in the constructor. test: true } } diff --git a/tests/baselines/reference/circularConstraintYieldsAppropriateError.js b/tests/baselines/reference/circularConstraintYieldsAppropriateError.js index e10b008766011..7e2b7ae4a825f 100644 --- a/tests/baselines/reference/circularConstraintYieldsAppropriateError.js +++ b/tests/baselines/reference/circularConstraintYieldsAppropriateError.js @@ -20,6 +20,7 @@ const foo = new Foo(); foo.bar.test //// [circularConstraintYieldsAppropriateError.js] +"use strict"; // https://github.com/Microsoft/TypeScript/issues/16861 class BaseType { } diff --git a/tests/baselines/reference/circularGetAccessor(noimplicitany=false).js b/tests/baselines/reference/circularGetAccessor(noimplicitany=false).js index 01c8bc80b1f23..1544dc79b926a 100644 --- a/tests/baselines/reference/circularGetAccessor(noimplicitany=false).js +++ b/tests/baselines/reference/circularGetAccessor(noimplicitany=false).js @@ -7,3 +7,4 @@ declare class C { //// [circularGetAccessor.js] +"use strict"; diff --git a/tests/baselines/reference/circularGetAccessor(noimplicitany=true).js b/tests/baselines/reference/circularGetAccessor(noimplicitany=true).js index 01c8bc80b1f23..1544dc79b926a 100644 --- a/tests/baselines/reference/circularGetAccessor(noimplicitany=true).js +++ b/tests/baselines/reference/circularGetAccessor(noimplicitany=true).js @@ -7,3 +7,4 @@ declare class C { //// [circularGetAccessor.js] +"use strict"; diff --git a/tests/baselines/reference/circularImportAlias.errors.txt b/tests/baselines/reference/circularImportAlias.errors.txt index efd6164599aaa..1f0783288ada4 100644 --- a/tests/baselines/reference/circularImportAlias.errors.txt +++ b/tests/baselines/reference/circularImportAlias.errors.txt @@ -1,7 +1,9 @@ circularImportAlias.ts(5,30): error TS2449: Class 'C' used before its declaration. +circularImportAlias.ts(6,9): error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. +circularImportAlias.ts(11,22): error TS2564: Property 'name' has no initializer and is not definitely assigned in the constructor. -==== circularImportAlias.ts (1 errors) ==== +==== circularImportAlias.ts (3 errors) ==== // expected no error namespace B { @@ -11,11 +13,15 @@ circularImportAlias.ts(5,30): error TS2449: Class 'C' used before its declaratio !!! error TS2449: Class 'C' used before its declaration. !!! related TS2728 circularImportAlias.ts:11:18: 'C' is declared here. id: number; + ~~ +!!! error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. } } namespace A { export class C { name: string } + ~~~~ +!!! error TS2564: Property 'name' has no initializer and is not definitely assigned in the constructor. export import b = B; } diff --git a/tests/baselines/reference/circularImportAlias.js b/tests/baselines/reference/circularImportAlias.js index 4f54af1d75e36..078225c7a1f26 100644 --- a/tests/baselines/reference/circularImportAlias.js +++ b/tests/baselines/reference/circularImportAlias.js @@ -22,6 +22,7 @@ var c = new B.a.C(); //// [circularImportAlias.js] +"use strict"; // expected no error var B; (function (B) { diff --git a/tests/baselines/reference/circularIndexedAccessErrors.errors.txt b/tests/baselines/reference/circularIndexedAccessErrors.errors.txt index 9f70bf2b4cc80..fb39c766dfad9 100644 --- a/tests/baselines/reference/circularIndexedAccessErrors.errors.txt +++ b/tests/baselines/reference/circularIndexedAccessErrors.errors.txt @@ -2,11 +2,14 @@ circularIndexedAccessErrors.ts(2,5): error TS2502: 'x' is referenced directly or circularIndexedAccessErrors.ts(11,11): error TS2589: Type instantiation is excessively deep and possibly infinite. circularIndexedAccessErrors.ts(18,5): error TS2502: 'x' is referenced directly or indirectly in its own type annotation. circularIndexedAccessErrors.ts(22,5): error TS2502: 'x' is referenced directly or indirectly in its own type annotation. +circularIndexedAccessErrors.ts(26,5): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. +circularIndexedAccessErrors.ts(27,5): error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. +circularIndexedAccessErrors.ts(28,5): error TS2564: Property 'z' has no initializer and is not definitely assigned in the constructor. circularIndexedAccessErrors.ts(37,24): error TS2313: Type parameter 'T' has a circular constraint. circularIndexedAccessErrors.ts(37,30): error TS2536: Type '"hello"' cannot be used to index type 'T'. -==== circularIndexedAccessErrors.ts (6 errors) ==== +==== circularIndexedAccessErrors.ts (9 errors) ==== type T1 = { x: T1["x"]; // Error ~ @@ -41,8 +44,14 @@ circularIndexedAccessErrors.ts(37,30): error TS2536: Type '"hello"' cannot be us class C2 { x: this["y"]; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. y: this["z"]; + ~ +!!! error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. z: this["x"]; + ~ +!!! error TS2564: Property 'z' has no initializer and is not definitely assigned in the constructor. } // Repro from #12627 diff --git a/tests/baselines/reference/circularIndexedAccessErrors.js b/tests/baselines/reference/circularIndexedAccessErrors.js index 9348e8e6496c9..df87b6e1d1dc2 100644 --- a/tests/baselines/reference/circularIndexedAccessErrors.js +++ b/tests/baselines/reference/circularIndexedAccessErrors.js @@ -42,6 +42,7 @@ function foo() { //// [circularIndexedAccessErrors.js] +"use strict"; let x2x = x2.x; class C1 { } diff --git a/tests/baselines/reference/circularInferredTypeOfVariable.js b/tests/baselines/reference/circularInferredTypeOfVariable.js index f046127fa47eb..29d713ccd9481 100644 --- a/tests/baselines/reference/circularInferredTypeOfVariable.js +++ b/tests/baselines/reference/circularInferredTypeOfVariable.js @@ -21,6 +21,7 @@ }); //// [circularInferredTypeOfVariable.js] +"use strict"; // Repro from #14428 var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } @@ -31,7 +32,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -(() => __awaiter(this, void 0, void 0, function* () { +(() => __awaiter(void 0, void 0, void 0, function* () { function foo(p) { return []; } diff --git a/tests/baselines/reference/circularInferredTypeOfVariable.types b/tests/baselines/reference/circularInferredTypeOfVariable.types index aac6c61fd0cf1..8930698b15839 100644 --- a/tests/baselines/reference/circularInferredTypeOfVariable.types +++ b/tests/baselines/reference/circularInferredTypeOfVariable.types @@ -16,8 +16,8 @@ > : ^^^^^^^^ return []; ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ } function bar(p: string[]): string[] { @@ -27,15 +27,15 @@ > : ^^^^^^^^ return []; ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ } let a1: string[] | undefined = []; ->a1 : string[] -> : ^^^^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>a1 : string[] | undefined +> : ^^^^^^^^^^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ while (true) { >true : true @@ -56,8 +56,8 @@ a1 = await bar(a2); >a1 = await bar(a2) : string[] > : ^^^^^^^^ ->a1 : string[] -> : ^^^^^^^^ +>a1 : string[] | undefined +> : ^^^^^^^^^^^^^^^^^^^^ >await bar(a2) : string[] > : ^^^^^^^^ >bar(a2) : string[] diff --git a/tests/baselines/reference/circularInstantiationExpression.js b/tests/baselines/reference/circularInstantiationExpression.js index 74d428a9f9547..49146b90d2a6e 100644 --- a/tests/baselines/reference/circularInstantiationExpression.js +++ b/tests/baselines/reference/circularInstantiationExpression.js @@ -6,6 +6,7 @@ foo(""); //// [circularInstantiationExpression.js] +"use strict"; foo(""); diff --git a/tests/baselines/reference/circularModuleImports.js b/tests/baselines/reference/circularModuleImports.js index 129feb9cbd247..dc9b50c096abe 100644 --- a/tests/baselines/reference/circularModuleImports.js +++ b/tests/baselines/reference/circularModuleImports.js @@ -13,3 +13,4 @@ namespace M //// [circularModuleImports.js] +"use strict"; diff --git a/tests/baselines/reference/circularObjectLiteralAccessors(target=es2015).js b/tests/baselines/reference/circularObjectLiteralAccessors(target=es2015).js index d1a534e989a87..17414cb754bdf 100644 --- a/tests/baselines/reference/circularObjectLiteralAccessors(target=es2015).js +++ b/tests/baselines/reference/circularObjectLiteralAccessors(target=es2015).js @@ -16,6 +16,7 @@ const a = { }; //// [circularObjectLiteralAccessors.js] +"use strict"; // Repro from #6000 const a = { b: { diff --git a/tests/baselines/reference/circularObjectLiteralAccessors(target=es5).js b/tests/baselines/reference/circularObjectLiteralAccessors(target=es5).js index 339fa570e7172..87a64ed4abb51 100644 --- a/tests/baselines/reference/circularObjectLiteralAccessors(target=es5).js +++ b/tests/baselines/reference/circularObjectLiteralAccessors(target=es5).js @@ -16,6 +16,7 @@ const a = { }; //// [circularObjectLiteralAccessors.js] +"use strict"; // Repro from #6000 var a = { b: { diff --git a/tests/baselines/reference/circularOptionalityRemoval.js b/tests/baselines/reference/circularOptionalityRemoval.js index f470a455404ea..7bf1d3b63c0a7 100644 --- a/tests/baselines/reference/circularOptionalityRemoval.js +++ b/tests/baselines/reference/circularOptionalityRemoval.js @@ -8,6 +8,7 @@ function fn1(x: number | undefined = x > 0 ? x : 0) { } function fn2(x?: string = someCondition ? 'value1' : x) { } //// [circularOptionalityRemoval.js] +"use strict"; // Constructed repro function fn1(x = x > 0 ? x : 0) { } // Report from user diff --git a/tests/baselines/reference/circularReference.errors.txt b/tests/baselines/reference/circularReference.errors.txt index 47db18323aa25..71237db7c985c 100644 --- a/tests/baselines/reference/circularReference.errors.txt +++ b/tests/baselines/reference/circularReference.errors.txt @@ -1,14 +1,18 @@ +foo1.ts(5,3): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. foo1.ts(9,12): error TS2339: Property 'x' does not exist on type 'C1'. +foo2.ts(5,3): error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. foo2.ts(8,12): error TS2339: Property 'y' does not exist on type 'C1'. foo2.ts(13,8): error TS2339: Property 'x' does not exist on type 'C1'. -==== foo2.ts (2 errors) ==== +==== foo2.ts (3 errors) ==== import foo1 = require('./foo1'); export namespace M1 { export class C1 { m1: foo1.M1.C1; y: number + ~ +!!! error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. constructor(){ this.m1 = new foo1.M1.C1(); this.m1.y = 10; // Error @@ -25,12 +29,14 @@ foo2.ts(13,8): error TS2339: Property 'x' does not exist on type 'C1'. } } -==== foo1.ts (1 errors) ==== +==== foo1.ts (2 errors) ==== import foo2 = require('./foo2'); export namespace M1 { export class C1 { m1: foo2.M1.C1; x: number; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. constructor(){ this.m1 = new foo2.M1.C1(); this.m1.y = 10; // OK diff --git a/tests/baselines/reference/circularTypeAliasForUnionWithClass.errors.txt b/tests/baselines/reference/circularTypeAliasForUnionWithClass.errors.txt new file mode 100644 index 0000000000000..9c2df779839a3 --- /dev/null +++ b/tests/baselines/reference/circularTypeAliasForUnionWithClass.errors.txt @@ -0,0 +1,24 @@ +circularTypeAliasForUnionWithClass.ts(4,5): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. + + +==== circularTypeAliasForUnionWithClass.ts (1 errors) ==== + var v0: T0; + type T0 = string | I0; + class I0 { + x: T0; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. + } + + var v3: T3; + type T3 = string | I3; + class I3 { + [x: number]: T3; + } + + var v4: T4; + type T4 = string | I4; + class I4 { + [x: string]: T4; + } + \ No newline at end of file diff --git a/tests/baselines/reference/circularTypeAliasForUnionWithClass.js b/tests/baselines/reference/circularTypeAliasForUnionWithClass.js index 6828fe833009b..15ac4accb7117 100644 --- a/tests/baselines/reference/circularTypeAliasForUnionWithClass.js +++ b/tests/baselines/reference/circularTypeAliasForUnionWithClass.js @@ -21,6 +21,7 @@ class I4 { //// [circularTypeAliasForUnionWithClass.js] +"use strict"; var v0; class I0 { } diff --git a/tests/baselines/reference/circularTypeAliasForUnionWithInterface.js b/tests/baselines/reference/circularTypeAliasForUnionWithInterface.js index 4bf1f2297eb61..454427ebd63f2 100644 --- a/tests/baselines/reference/circularTypeAliasForUnionWithInterface.js +++ b/tests/baselines/reference/circularTypeAliasForUnionWithInterface.js @@ -33,6 +33,7 @@ interface I4 { //// [circularTypeAliasForUnionWithInterface.js] +"use strict"; var v0; var v1; var v2; diff --git a/tests/baselines/reference/circularTypeofWithFunctionModule.js b/tests/baselines/reference/circularTypeofWithFunctionModule.js index 86b631f15dcd4..c35f1604d0200 100644 --- a/tests/baselines/reference/circularTypeofWithFunctionModule.js +++ b/tests/baselines/reference/circularTypeofWithFunctionModule.js @@ -15,6 +15,7 @@ namespace maker { //// [circularTypeofWithFunctionModule.js] +"use strict"; // Repro from #6072 class Foo { } diff --git a/tests/baselines/reference/circularTypeofWithVarOrFunc.js b/tests/baselines/reference/circularTypeofWithVarOrFunc.js index f6425e7fbb322..7501b260a2f9d 100644 --- a/tests/baselines/reference/circularTypeofWithVarOrFunc.js +++ b/tests/baselines/reference/circularTypeofWithVarOrFunc.js @@ -30,6 +30,7 @@ function f(): R2 { return 0; } //// [circularTypeofWithVarOrFunc.js] +"use strict"; var varOfAliasedType1; var varOfAliasedType2; function func() { return null; } diff --git a/tests/baselines/reference/circularlyReferentialInterfaceAccessNoCrash.js b/tests/baselines/reference/circularlyReferentialInterfaceAccessNoCrash.js index 2cad6d7fb4748..02e1dd650f457 100644 --- a/tests/baselines/reference/circularlyReferentialInterfaceAccessNoCrash.js +++ b/tests/baselines/reference/circularlyReferentialInterfaceAccessNoCrash.js @@ -14,3 +14,4 @@ type TupleElem = [['list', TupleElem[0][0]]]; //// [circularlyReferentialInterfaceAccessNoCrash.js] +"use strict"; diff --git a/tests/baselines/reference/class2.js b/tests/baselines/reference/class2.js index 64545eb83a742..f38d80554583d 100644 --- a/tests/baselines/reference/class2.js +++ b/tests/baselines/reference/class2.js @@ -4,6 +4,7 @@ class foo { constructor() { static f = 3; } } //// [class2.js] +"use strict"; class foo { constructor() { } } diff --git a/tests/baselines/reference/classAbstractAccessor(target=es2015).js b/tests/baselines/reference/classAbstractAccessor(target=es2015).js index 0ef7362e9606c..4f50bf417c76d 100644 --- a/tests/baselines/reference/classAbstractAccessor(target=es2015).js +++ b/tests/baselines/reference/classAbstractAccessor(target=es2015).js @@ -10,6 +10,7 @@ abstract class A { //// [classAbstractAccessor.js] +"use strict"; class A { get aa() { return 1; } // error set bb(x) { } // error diff --git a/tests/baselines/reference/classAbstractAccessor(target=es5).js b/tests/baselines/reference/classAbstractAccessor(target=es5).js index 37cd54edf0e1a..ee3ef95f7a5a7 100644 --- a/tests/baselines/reference/classAbstractAccessor(target=es5).js +++ b/tests/baselines/reference/classAbstractAccessor(target=es5).js @@ -10,6 +10,7 @@ abstract class A { //// [classAbstractAccessor.js] +"use strict"; var A = /** @class */ (function () { function A() { } diff --git a/tests/baselines/reference/classAbstractAsIdentifier.js b/tests/baselines/reference/classAbstractAsIdentifier.js index 61fe8b9b7b1fd..56d693ead576c 100644 --- a/tests/baselines/reference/classAbstractAsIdentifier.js +++ b/tests/baselines/reference/classAbstractAsIdentifier.js @@ -8,6 +8,7 @@ class abstract { new abstract; //// [classAbstractAsIdentifier.js] +"use strict"; class abstract { foo() { return 1; } } diff --git a/tests/baselines/reference/classAbstractAssignabilityConstructorFunction.js b/tests/baselines/reference/classAbstractAssignabilityConstructorFunction.js index 6f31bcdd28379..f41817a13a4a2 100644 --- a/tests/baselines/reference/classAbstractAssignabilityConstructorFunction.js +++ b/tests/baselines/reference/classAbstractAssignabilityConstructorFunction.js @@ -11,6 +11,7 @@ AAA = A; // error. AAA = "asdf"; //// [classAbstractAssignabilityConstructorFunction.js] +"use strict"; class A { } // var AA: typeof A; diff --git a/tests/baselines/reference/classAbstractClinterfaceAssignability.errors.txt b/tests/baselines/reference/classAbstractClinterfaceAssignability.errors.txt index 1e20f9c1d95d1..c544d39784b9a 100644 --- a/tests/baselines/reference/classAbstractClinterfaceAssignability.errors.txt +++ b/tests/baselines/reference/classAbstractClinterfaceAssignability.errors.txt @@ -1,8 +1,9 @@ +classAbstractClinterfaceAssignability.ts(15,5): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. classAbstractClinterfaceAssignability.ts(23,1): error TS2322: Type 'typeof A' is not assignable to type 'IConstructor'. Cannot assign an abstract constructor type to a non-abstract constructor type. -==== classAbstractClinterfaceAssignability.ts (1 errors) ==== +==== classAbstractClinterfaceAssignability.ts (2 errors) ==== interface I { x: number; } @@ -18,6 +19,8 @@ classAbstractClinterfaceAssignability.ts(23,1): error TS2322: Type 'typeof A' is abstract class A { x: number; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. static y: number; } diff --git a/tests/baselines/reference/classAbstractClinterfaceAssignability.js b/tests/baselines/reference/classAbstractClinterfaceAssignability.js index 5561d0a3c1bb9..a0536501af985 100644 --- a/tests/baselines/reference/classAbstractClinterfaceAssignability.js +++ b/tests/baselines/reference/classAbstractClinterfaceAssignability.js @@ -26,6 +26,7 @@ declare var AAA: typeof I; AAA = A; //// [classAbstractClinterfaceAssignability.js] +"use strict"; class A { } AA = I; diff --git a/tests/baselines/reference/classAbstractConstructor.js b/tests/baselines/reference/classAbstractConstructor.js index 63e61bdfcaae8..d081eb0336189 100644 --- a/tests/baselines/reference/classAbstractConstructor.js +++ b/tests/baselines/reference/classAbstractConstructor.js @@ -6,6 +6,7 @@ abstract class A { } //// [classAbstractConstructor.js] +"use strict"; class A { constructor() { } } diff --git a/tests/baselines/reference/classAbstractConstructorAssignability.js b/tests/baselines/reference/classAbstractConstructorAssignability.js index 16ea77e8bd7f3..f739e397fe34e 100644 --- a/tests/baselines/reference/classAbstractConstructorAssignability.js +++ b/tests/baselines/reference/classAbstractConstructorAssignability.js @@ -16,6 +16,7 @@ new BB; new CC; //// [classAbstractConstructorAssignability.js] +"use strict"; class A { } class B extends A { diff --git a/tests/baselines/reference/classAbstractCrashedOnce.js b/tests/baselines/reference/classAbstractCrashedOnce.js index 524e88aa39d51..eeb3d1c210caa 100644 --- a/tests/baselines/reference/classAbstractCrashedOnce.js +++ b/tests/baselines/reference/classAbstractCrashedOnce.js @@ -13,6 +13,7 @@ class bar extends foo { var x = new bar(); //// [classAbstractCrashedOnce.js] +"use strict"; class foo { } class bar extends foo { diff --git a/tests/baselines/reference/classAbstractExtends.js b/tests/baselines/reference/classAbstractExtends.js index 86878c2d2598f..7d9dd73e1de3e 100644 --- a/tests/baselines/reference/classAbstractExtends.js +++ b/tests/baselines/reference/classAbstractExtends.js @@ -18,6 +18,7 @@ class E extends B { } //// [classAbstractExtends.js] +"use strict"; class A { foo() { } } diff --git a/tests/baselines/reference/classAbstractFactoryFunction.js b/tests/baselines/reference/classAbstractFactoryFunction.js index 65b418440f3d1..3d0116fe58568 100644 --- a/tests/baselines/reference/classAbstractFactoryFunction.js +++ b/tests/baselines/reference/classAbstractFactoryFunction.js @@ -19,6 +19,7 @@ NewB(A); NewB(B); //// [classAbstractFactoryFunction.js] +"use strict"; class A { } class B extends A { diff --git a/tests/baselines/reference/classAbstractGeneric.js b/tests/baselines/reference/classAbstractGeneric.js index bf2f7607a4c7d..d52ed131915c7 100644 --- a/tests/baselines/reference/classAbstractGeneric.js +++ b/tests/baselines/reference/classAbstractGeneric.js @@ -28,6 +28,7 @@ class G extends A { } //// [classAbstractGeneric.js] +"use strict"; class A { } class B extends A { diff --git a/tests/baselines/reference/classAbstractImportInstantiation.js b/tests/baselines/reference/classAbstractImportInstantiation.js index 73b8f4d61f183..a12b04fb4f678 100644 --- a/tests/baselines/reference/classAbstractImportInstantiation.js +++ b/tests/baselines/reference/classAbstractImportInstantiation.js @@ -13,6 +13,7 @@ new myA; //// [classAbstractImportInstantiation.js] +"use strict"; var M; (function (M) { class A { diff --git a/tests/baselines/reference/classAbstractInAModule.js b/tests/baselines/reference/classAbstractInAModule.js index fc40bdcdac9ba..a565dfee84841 100644 --- a/tests/baselines/reference/classAbstractInAModule.js +++ b/tests/baselines/reference/classAbstractInAModule.js @@ -10,6 +10,7 @@ new M.A; new M.B; //// [classAbstractInAModule.js] +"use strict"; var M; (function (M) { class A { diff --git a/tests/baselines/reference/classAbstractInheritance1.js b/tests/baselines/reference/classAbstractInheritance1.js index e6ef15e6c1eac..59fee0073e734 100644 --- a/tests/baselines/reference/classAbstractInheritance1.js +++ b/tests/baselines/reference/classAbstractInheritance1.js @@ -24,6 +24,7 @@ class FF extends CC {} abstract class GG extends CC {} //// [classAbstractInheritance1.js] +"use strict"; class A { } class B extends A { diff --git a/tests/baselines/reference/classAbstractInheritance2.js b/tests/baselines/reference/classAbstractInheritance2.js index 7011e0fe7b961..7ea9d3611718b 100644 --- a/tests/baselines/reference/classAbstractInheritance2.js +++ b/tests/baselines/reference/classAbstractInheritance2.js @@ -15,6 +15,7 @@ const C = class extends A {} //// [classAbstractInheritance2.js] +"use strict"; class A { } class B extends A { diff --git a/tests/baselines/reference/classAbstractInstantiations1.js b/tests/baselines/reference/classAbstractInstantiations1.js index 1fabf478e9634..a90f3741e2178 100644 --- a/tests/baselines/reference/classAbstractInstantiations1.js +++ b/tests/baselines/reference/classAbstractInstantiations1.js @@ -26,6 +26,7 @@ c = new B; //// [classAbstractInstantiations1.js] +"use strict"; // // Calling new with (non)abstract classes. // diff --git a/tests/baselines/reference/classAbstractInstantiations2.errors.txt b/tests/baselines/reference/classAbstractInstantiations2.errors.txt index e07d75144f239..0f13a01ba6c23 100644 --- a/tests/baselines/reference/classAbstractInstantiations2.errors.txt +++ b/tests/baselines/reference/classAbstractInstantiations2.errors.txt @@ -5,12 +5,13 @@ classAbstractInstantiations2.ts(17,5): error TS2511: Cannot create an instance o classAbstractInstantiations2.ts(21,1): error TS2511: Cannot create an instance of an abstract class. classAbstractInstantiations2.ts(23,15): error TS2449: Class 'C' used before its declaration. classAbstractInstantiations2.ts(26,7): error TS2515: Non-abstract class 'C' does not implement inherited abstract member bar from class 'B'. +classAbstractInstantiations2.ts(42,5): error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. classAbstractInstantiations2.ts(46,5): error TS2391: Function implementation is missing or not immediately following the declaration. classAbstractInstantiations2.ts(46,5): error TS2512: Overload signatures must all be abstract or non-abstract. classAbstractInstantiations2.ts(50,5): error TS1244: Abstract methods can only appear within an abstract class. -==== classAbstractInstantiations2.ts (9 errors) ==== +==== classAbstractInstantiations2.ts (10 errors) ==== class A { // ... } @@ -67,6 +68,8 @@ classAbstractInstantiations2.ts(50,5): error TS1244: Abstract methods can only a abstract qux(x : number) : string; abstract qux() : number; y : number; + ~ +!!! error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. abstract quz(x : number, y : string) : boolean; // error -- declarations must be adjacent abstract nom(): boolean; diff --git a/tests/baselines/reference/classAbstractInstantiations2.js b/tests/baselines/reference/classAbstractInstantiations2.js index 16d13aed569f4..3f99a77c3d435 100644 --- a/tests/baselines/reference/classAbstractInstantiations2.js +++ b/tests/baselines/reference/classAbstractInstantiations2.js @@ -54,6 +54,7 @@ class H { // error -- not declared abstract } //// [classAbstractInstantiations2.js] +"use strict"; class A { } class B { diff --git a/tests/baselines/reference/classAbstractMergedDeclaration.js b/tests/baselines/reference/classAbstractMergedDeclaration.js index 10481dd293ef2..ddeecc91f0275 100644 --- a/tests/baselines/reference/classAbstractMergedDeclaration.js +++ b/tests/baselines/reference/classAbstractMergedDeclaration.js @@ -43,6 +43,7 @@ new DCC1; new DCC2; //// [classAbstractMergedDeclaration.js] +"use strict"; class CM { } class MC { diff --git a/tests/baselines/reference/classAbstractMethodInNonAbstractClass.js b/tests/baselines/reference/classAbstractMethodInNonAbstractClass.js index 758a12dd16db5..1bee1629e95b0 100644 --- a/tests/baselines/reference/classAbstractMethodInNonAbstractClass.js +++ b/tests/baselines/reference/classAbstractMethodInNonAbstractClass.js @@ -10,6 +10,7 @@ class B { } //// [classAbstractMethodInNonAbstractClass.js] +"use strict"; class A { } class B { diff --git a/tests/baselines/reference/classAbstractMethodWithImplementation.js b/tests/baselines/reference/classAbstractMethodWithImplementation.js index b5989989402a8..acf9eee626453 100644 --- a/tests/baselines/reference/classAbstractMethodWithImplementation.js +++ b/tests/baselines/reference/classAbstractMethodWithImplementation.js @@ -6,6 +6,7 @@ abstract class A { } //// [classAbstractMethodWithImplementation.js] +"use strict"; class A { foo() { } } diff --git a/tests/baselines/reference/classAbstractMixedWithModifiers.js b/tests/baselines/reference/classAbstractMixedWithModifiers.js index d48a7f547fadf..a6fdfb4de0283 100644 --- a/tests/baselines/reference/classAbstractMixedWithModifiers.js +++ b/tests/baselines/reference/classAbstractMixedWithModifiers.js @@ -21,5 +21,6 @@ abstract class A { //// [classAbstractMixedWithModifiers.js] +"use strict"; class A { } diff --git a/tests/baselines/reference/classAbstractOverloads.js b/tests/baselines/reference/classAbstractOverloads.js index 98fa1e578caa5..71a8a2319a706 100644 --- a/tests/baselines/reference/classAbstractOverloads.js +++ b/tests/baselines/reference/classAbstractOverloads.js @@ -27,6 +27,7 @@ abstract class B { } //// [classAbstractOverloads.js] +"use strict"; class A { baz() { } } diff --git a/tests/baselines/reference/classAbstractOverrideWithAbstract.js b/tests/baselines/reference/classAbstractOverrideWithAbstract.js index 22b4ca664f03e..7bb4c422b875c 100644 --- a/tests/baselines/reference/classAbstractOverrideWithAbstract.js +++ b/tests/baselines/reference/classAbstractOverrideWithAbstract.js @@ -26,6 +26,7 @@ class DD extends BB { } //// [classAbstractOverrideWithAbstract.js] +"use strict"; class A { foo() { } } diff --git a/tests/baselines/reference/classAbstractProperties.js b/tests/baselines/reference/classAbstractProperties.js index cd4d0f226c753..e3a856c1c315a 100644 --- a/tests/baselines/reference/classAbstractProperties.js +++ b/tests/baselines/reference/classAbstractProperties.js @@ -16,5 +16,6 @@ abstract class A { } //// [classAbstractProperties.js] +"use strict"; class A { } diff --git a/tests/baselines/reference/classAbstractSingleLineDecl.js b/tests/baselines/reference/classAbstractSingleLineDecl.js index 4439891de8d14..543037b24ed79 100644 --- a/tests/baselines/reference/classAbstractSingleLineDecl.js +++ b/tests/baselines/reference/classAbstractSingleLineDecl.js @@ -15,6 +15,7 @@ new B; new C; //// [classAbstractSingleLineDecl.js] +"use strict"; class A { } abstract; diff --git a/tests/baselines/reference/classAbstractSuperCalls.js b/tests/baselines/reference/classAbstractSuperCalls.js index 6712117fb04c4..3600775bade07 100644 --- a/tests/baselines/reference/classAbstractSuperCalls.js +++ b/tests/baselines/reference/classAbstractSuperCalls.js @@ -29,6 +29,7 @@ abstract class BB extends AA { //// [classAbstractSuperCalls.js] +"use strict"; class A { foo() { return 1; } } diff --git a/tests/baselines/reference/classAbstractUsingAbstractMethod1.js b/tests/baselines/reference/classAbstractUsingAbstractMethod1.js index 76d44ec4821dd..9d4d39902e9af 100644 --- a/tests/baselines/reference/classAbstractUsingAbstractMethod1.js +++ b/tests/baselines/reference/classAbstractUsingAbstractMethod1.js @@ -20,6 +20,7 @@ a = new C; // error, cannot instantiate abstract class. a.foo(); //// [classAbstractUsingAbstractMethod1.js] +"use strict"; class A { } class B extends A { diff --git a/tests/baselines/reference/classAbstractUsingAbstractMethods2.js b/tests/baselines/reference/classAbstractUsingAbstractMethods2.js index cf759fc90ed3f..bc4b89b32a660 100644 --- a/tests/baselines/reference/classAbstractUsingAbstractMethods2.js +++ b/tests/baselines/reference/classAbstractUsingAbstractMethods2.js @@ -30,6 +30,7 @@ class DD extends AA { } //// [classAbstractUsingAbstractMethods2.js] +"use strict"; class A { } class B extends A { diff --git a/tests/baselines/reference/classAbstractWithInterface.js b/tests/baselines/reference/classAbstractWithInterface.js index d7e8c0042c200..e360c1780f028 100644 --- a/tests/baselines/reference/classAbstractWithInterface.js +++ b/tests/baselines/reference/classAbstractWithInterface.js @@ -4,3 +4,4 @@ abstract interface I {} //// [classAbstractWithInterface.js] +"use strict"; diff --git a/tests/baselines/reference/classAndInterfaceMergeConflictingMembers.js b/tests/baselines/reference/classAndInterfaceMergeConflictingMembers.js index 64dea62aff45b..6ba0ca0eb6917 100644 --- a/tests/baselines/reference/classAndInterfaceMergeConflictingMembers.js +++ b/tests/baselines/reference/classAndInterfaceMergeConflictingMembers.js @@ -26,3 +26,4 @@ interface C3 { } //// [classAndInterfaceMergeConflictingMembers.js] +"use strict"; diff --git a/tests/baselines/reference/classAndInterfaceWithSameName.errors.txt b/tests/baselines/reference/classAndInterfaceWithSameName.errors.txt new file mode 100644 index 0000000000000..d0d0e5c0a9a67 --- /dev/null +++ b/tests/baselines/reference/classAndInterfaceWithSameName.errors.txt @@ -0,0 +1,21 @@ +classAndInterfaceWithSameName.ts(1,11): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. +classAndInterfaceWithSameName.ts(6,9): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. + + +==== classAndInterfaceWithSameName.ts (2 errors) ==== + class C { foo: string; } + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. + interface C { foo: string; } + + namespace M { + class D { + bar: string; + ~~~ +!!! error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. + } + + interface D { + bar: string; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/classAndInterfaceWithSameName.js b/tests/baselines/reference/classAndInterfaceWithSameName.js index afc352132e142..4957060cd798b 100644 --- a/tests/baselines/reference/classAndInterfaceWithSameName.js +++ b/tests/baselines/reference/classAndInterfaceWithSameName.js @@ -15,6 +15,7 @@ namespace M { } //// [classAndInterfaceWithSameName.js] +"use strict"; class C { } var M; diff --git a/tests/baselines/reference/classAndVariableWithSameName.errors.txt b/tests/baselines/reference/classAndVariableWithSameName.errors.txt index 0ff07f40811fb..6b8635f9d5f2f 100644 --- a/tests/baselines/reference/classAndVariableWithSameName.errors.txt +++ b/tests/baselines/reference/classAndVariableWithSameName.errors.txt @@ -1,13 +1,17 @@ classAndVariableWithSameName.ts(1,7): error TS2300: Duplicate identifier 'C'. +classAndVariableWithSameName.ts(1,11): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. classAndVariableWithSameName.ts(2,5): error TS2300: Duplicate identifier 'C'. classAndVariableWithSameName.ts(5,11): error TS2300: Duplicate identifier 'D'. +classAndVariableWithSameName.ts(6,9): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. classAndVariableWithSameName.ts(9,9): error TS2300: Duplicate identifier 'D'. -==== classAndVariableWithSameName.ts (4 errors) ==== +==== classAndVariableWithSameName.ts (6 errors) ==== class C { foo: string; } // error ~ !!! error TS2300: Duplicate identifier 'C'. + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. var C = ''; // error ~ !!! error TS2300: Duplicate identifier 'C'. @@ -17,6 +21,8 @@ classAndVariableWithSameName.ts(9,9): error TS2300: Duplicate identifier 'D'. ~ !!! error TS2300: Duplicate identifier 'D'. bar: string; + ~~~ +!!! error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. } var D = 1; // error diff --git a/tests/baselines/reference/classAndVariableWithSameName.js b/tests/baselines/reference/classAndVariableWithSameName.js index 3d075e297de86..c808f8d42bd78 100644 --- a/tests/baselines/reference/classAndVariableWithSameName.js +++ b/tests/baselines/reference/classAndVariableWithSameName.js @@ -13,6 +13,7 @@ namespace M { } //// [classAndVariableWithSameName.js] +"use strict"; class C { } // error var C = ''; // error diff --git a/tests/baselines/reference/classAppearsToHaveMembersOfObject.errors.txt b/tests/baselines/reference/classAppearsToHaveMembersOfObject.errors.txt new file mode 100644 index 0000000000000..b1bdb6795e463 --- /dev/null +++ b/tests/baselines/reference/classAppearsToHaveMembersOfObject.errors.txt @@ -0,0 +1,26 @@ +classAppearsToHaveMembersOfObject.ts(1,11): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. +classAppearsToHaveMembersOfObject.ts(4,9): error TS2454: Variable 'c' is used before being assigned. +classAppearsToHaveMembersOfObject.ts(5,10): error TS2454: Variable 'c' is used before being assigned. +classAppearsToHaveMembersOfObject.ts(6,17): error TS2454: Variable 'c' is used before being assigned. +classAppearsToHaveMembersOfObject.ts(7,14): error TS2454: Variable 'c' is used before being assigned. + + +==== classAppearsToHaveMembersOfObject.ts (5 errors) ==== + class C { foo: string; } + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. + + var c: C; + var r = c.toString(); + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var r2 = c.hasOwnProperty(''); + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var o: Object = c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var o2: {} = c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + \ No newline at end of file diff --git a/tests/baselines/reference/classAppearsToHaveMembersOfObject.js b/tests/baselines/reference/classAppearsToHaveMembersOfObject.js index 5212cbac165ca..a70c575bffca8 100644 --- a/tests/baselines/reference/classAppearsToHaveMembersOfObject.js +++ b/tests/baselines/reference/classAppearsToHaveMembersOfObject.js @@ -11,6 +11,7 @@ var o2: {} = c; //// [classAppearsToHaveMembersOfObject.js] +"use strict"; class C { } var c; diff --git a/tests/baselines/reference/classBlockScoping.js b/tests/baselines/reference/classBlockScoping.js index 3e25553015fef..bb81f40746cb0 100644 --- a/tests/baselines/reference/classBlockScoping.js +++ b/tests/baselines/reference/classBlockScoping.js @@ -36,6 +36,7 @@ function f(b: boolean) { } //// [classBlockScoping.js] +"use strict"; function f(b) { var _a; let Foo; diff --git a/tests/baselines/reference/classBodyWithStatements.js b/tests/baselines/reference/classBodyWithStatements.js index 9615a753d7fe0..39b728ebf2999 100644 --- a/tests/baselines/reference/classBodyWithStatements.js +++ b/tests/baselines/reference/classBodyWithStatements.js @@ -16,6 +16,7 @@ class C3 { } //// [classBodyWithStatements.js] +"use strict"; class C { } var x = 1; diff --git a/tests/baselines/reference/classCanExtendConstructorFunction.errors.txt b/tests/baselines/reference/classCanExtendConstructorFunction.errors.txt index d7a29da097bae..a381e6d45c310 100644 --- a/tests/baselines/reference/classCanExtendConstructorFunction.errors.txt +++ b/tests/baselines/reference/classCanExtendConstructorFunction.errors.txt @@ -5,13 +5,14 @@ first.js(31,5): error TS2416: Property 'load' in type 'Sql' is not assignable to first.js(47,24): error TS2507: Type '(numberEaten: number) => void' is not a constructor function type. generic.js(19,19): error TS2554: Expected 1 arguments, but got 0. generic.js(20,32): error TS2345: Argument of type 'number' is not assignable to parameter of type '{ claim: "ignorant" | "malicious"; }'. +second.ts(5,5): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. second.ts(8,25): error TS2507: Type '(numberEaten: number) => void' is not a constructor function type. second.ts(14,7): error TS2417: Class static side 'typeof Conestoga' incorrectly extends base class static side 'typeof Wagon'. Types of property 'circle' are incompatible. Type '(others: (typeof Wagon)[]) => number' is not assignable to type '(wagons?: Wagon[] | undefined) => number'. Types of parameters 'others' and 'wagons' are incompatible. - Type 'Wagon[]' is not assignable to type '(typeof Wagon)[]'. - Property 'circle' is missing in type 'Wagon' but required in type 'typeof Wagon'. + Type 'Wagon[] | undefined' is not assignable to type '(typeof Wagon)[]'. + Type 'undefined' is not assignable to type '(typeof Wagon)[]'. second.ts(17,15): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. @@ -75,12 +76,14 @@ second.ts(17,15): error TS2345: Argument of type 'string' is not assignable to p } -==== second.ts (3 errors) ==== +==== second.ts (4 errors) ==== /** * @constructor */ function Dragon(numberEaten: number) { this.numberEaten = numberEaten + ~~~~ +!!! error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. } // error! class Firedrake extends Dragon { @@ -97,9 +100,8 @@ second.ts(17,15): error TS2345: Argument of type 'string' is not assignable to p !!! error TS2417: Types of property 'circle' are incompatible. !!! error TS2417: Type '(others: (typeof Wagon)[]) => number' is not assignable to type '(wagons?: Wagon[] | undefined) => number'. !!! error TS2417: Types of parameters 'others' and 'wagons' are incompatible. -!!! error TS2417: Type 'Wagon[]' is not assignable to type '(typeof Wagon)[]'. -!!! error TS2417: Property 'circle' is missing in type 'Wagon' but required in type 'typeof Wagon'. -!!! related TS2728 first.js:9:1: 'circle' is declared here. +!!! error TS2417: Type 'Wagon[] | undefined' is not assignable to type '(typeof Wagon)[]'. +!!! error TS2417: Type 'undefined' is not assignable to type '(typeof Wagon)[]'. constructor(public drunkOO: true) { // error: wrong type super('nope'); diff --git a/tests/baselines/reference/classCanExtendConstructorFunction.types b/tests/baselines/reference/classCanExtendConstructorFunction.types index a95d604aedf16..589dbcffd255b 100644 --- a/tests/baselines/reference/classCanExtendConstructorFunction.types +++ b/tests/baselines/reference/classCanExtendConstructorFunction.types @@ -35,14 +35,14 @@ Wagon.circle = function (wagons) { > : ^ ^^^ ^^^^^^^^^^^^^^^^^^^^ >function (wagons) { return wagons ? wagons.length : 3.14;} : (wagons?: Wagon[] | undefined) => number > : ^ ^^^ ^^^^^^^^^^^^^^^^^^^^ ->wagons : Wagon[] -> : ^^^^^^^ +>wagons : Wagon[] | undefined +> : ^^^^^^^^^^^^^^^^^^^ return wagons ? wagons.length : 3.14; >wagons ? wagons.length : 3.14 : number > : ^^^^^^ ->wagons : Wagon[] -> : ^^^^^^^ +>wagons : Wagon[] | undefined +> : ^^^^^^^^^^^^^^^^^^^ >wagons.length : number > : ^^^^^^ >wagons : Wagon[] @@ -68,8 +68,8 @@ Wagon.prototype.load = function (supplies) { > : ^^^ >function (supplies) {} : (supplies?: any[] | undefined) => void > : ^ ^^^ ^^^^^^^^^^^^^^^^^^ ->supplies : any[] -> : ^^^^^ +>supplies : any[] | undefined +> : ^^^^^^^^^^^^^^^^^ } /** @param {*[]=} supplies - Yep, still a great type */ Wagon.prototype.weight = supplies => supplies ? supplies.length : -1 @@ -87,12 +87,12 @@ Wagon.prototype.weight = supplies => supplies ? supplies.length : -1 > : ^^^ >supplies => supplies ? supplies.length : -1 : (supplies?: any[] | undefined) => number > : ^ ^^^ ^^^^^^^^^^^^^^^^^^^^ ->supplies : any[] -> : ^^^^^ +>supplies : any[] | undefined +> : ^^^^^^^^^^^^^^^^^ >supplies ? supplies.length : -1 : number > : ^^^^^^ ->supplies : any[] -> : ^^^^^ +>supplies : any[] | undefined +> : ^^^^^^^^^^^^^^^^^ >supplies.length : number > : ^^^^^^ >supplies : any[] diff --git a/tests/baselines/reference/classCannotExtendVar.js b/tests/baselines/reference/classCannotExtendVar.js index b752b46ab7f10..c8dbf0749d156 100644 --- a/tests/baselines/reference/classCannotExtendVar.js +++ b/tests/baselines/reference/classCannotExtendVar.js @@ -10,6 +10,7 @@ class Markup { //// [classCannotExtendVar.js] +"use strict"; var Markup; class Markup { constructor() { diff --git a/tests/baselines/reference/classConstructorAccessibility.js b/tests/baselines/reference/classConstructorAccessibility.js index b7e198afa21b0..06a2f6286d869 100644 --- a/tests/baselines/reference/classConstructorAccessibility.js +++ b/tests/baselines/reference/classConstructorAccessibility.js @@ -37,6 +37,7 @@ namespace Generic { //// [classConstructorAccessibility.js] +"use strict"; class C { constructor(x) { this.x = x; diff --git a/tests/baselines/reference/classConstructorAccessibility2.js b/tests/baselines/reference/classConstructorAccessibility2.js index c8e084a344a76..bcef066b1d33a 100644 --- a/tests/baselines/reference/classConstructorAccessibility2.js +++ b/tests/baselines/reference/classConstructorAccessibility2.js @@ -48,6 +48,7 @@ var dc = new DerivedC(1); //// [classConstructorAccessibility2.js] +"use strict"; class BaseA { constructor(x) { this.x = x; diff --git a/tests/baselines/reference/classConstructorAccessibility3.js b/tests/baselines/reference/classConstructorAccessibility3.js index 57af48ad85e75..bb0bab36318ce 100644 --- a/tests/baselines/reference/classConstructorAccessibility3.js +++ b/tests/baselines/reference/classConstructorAccessibility3.js @@ -36,6 +36,7 @@ c = Bar; c = Baz; //// [classConstructorAccessibility3.js] +"use strict"; class Foo { constructor(x) { this.x = x; diff --git a/tests/baselines/reference/classConstructorAccessibility4.js b/tests/baselines/reference/classConstructorAccessibility4.js index 4ee762915fbb3..2a92882638806 100644 --- a/tests/baselines/reference/classConstructorAccessibility4.js +++ b/tests/baselines/reference/classConstructorAccessibility4.js @@ -32,6 +32,7 @@ class D { } //// [classConstructorAccessibility4.js] +"use strict"; class A { constructor() { } method() { diff --git a/tests/baselines/reference/classConstructorAccessibility5.js b/tests/baselines/reference/classConstructorAccessibility5.js index d19d8de34697b..e1c5f17b590d0 100644 --- a/tests/baselines/reference/classConstructorAccessibility5.js +++ b/tests/baselines/reference/classConstructorAccessibility5.js @@ -14,6 +14,7 @@ class Unrelated { //// [classConstructorAccessibility5.js] +"use strict"; class Base { constructor() { } } diff --git a/tests/baselines/reference/classConstructorOverloadsAccessibility.js b/tests/baselines/reference/classConstructorOverloadsAccessibility.js index a008887421a8e..b869994b8a624 100644 --- a/tests/baselines/reference/classConstructorOverloadsAccessibility.js +++ b/tests/baselines/reference/classConstructorOverloadsAccessibility.js @@ -35,6 +35,7 @@ class D { } //// [classConstructorOverloadsAccessibility.js] +"use strict"; class A { constructor() { } diff --git a/tests/baselines/reference/classConstructorParametersAccessibility.js b/tests/baselines/reference/classConstructorParametersAccessibility.js index 39d38db495c61..3f666ac2bc248 100644 --- a/tests/baselines/reference/classConstructorParametersAccessibility.js +++ b/tests/baselines/reference/classConstructorParametersAccessibility.js @@ -29,6 +29,7 @@ class Derived extends C3 { //// [classConstructorParametersAccessibility.js] +"use strict"; class C1 { constructor(x) { this.x = x; diff --git a/tests/baselines/reference/classConstructorParametersAccessibility2.js b/tests/baselines/reference/classConstructorParametersAccessibility2.js index 9cc012a117574..5fa4e884ff0f8 100644 --- a/tests/baselines/reference/classConstructorParametersAccessibility2.js +++ b/tests/baselines/reference/classConstructorParametersAccessibility2.js @@ -29,6 +29,7 @@ class Derived extends C3 { //// [classConstructorParametersAccessibility2.js] +"use strict"; class C1 { constructor(x) { this.x = x; diff --git a/tests/baselines/reference/classConstructorParametersAccessibility2.types b/tests/baselines/reference/classConstructorParametersAccessibility2.types index 88f388992d967..b3e12014c6815 100644 --- a/tests/baselines/reference/classConstructorParametersAccessibility2.types +++ b/tests/baselines/reference/classConstructorParametersAccessibility2.types @@ -6,20 +6,20 @@ class C1 { > : ^^ constructor(public x?: number) { } ->x : number -> : ^^^^^^ +>x : number | undefined +> : ^^^^^^^^^^^^^^^^^^ } declare var c1: C1; >c1 : C1 > : ^^ c1.x // OK ->c1.x : number -> : ^^^^^^ +>c1.x : number | undefined +> : ^^^^^^^^^^^^^^^^^^ >c1 : C1 > : ^^ ->x : number -> : ^^^^^^ +>x : number | undefined +> : ^^^^^^^^^^^^^^^^^^ class C2 { @@ -27,20 +27,20 @@ class C2 { > : ^^ constructor(private p?: number) { } ->p : number -> : ^^^^^^ +>p : number | undefined +> : ^^^^^^^^^^^^^^^^^^ } declare var c2: C2; >c2 : C2 > : ^^ c2.p // private, error ->c2.p : number -> : ^^^^^^ +>c2.p : number | undefined +> : ^^^^^^^^^^^^^^^^^^ >c2 : C2 > : ^^ ->p : number -> : ^^^^^^ +>p : number | undefined +> : ^^^^^^^^^^^^^^^^^^ class C3 { @@ -48,20 +48,20 @@ class C3 { > : ^^ constructor(protected p?: number) { } ->p : number -> : ^^^^^^ +>p : number | undefined +> : ^^^^^^^^^^^^^^^^^^ } declare var c3: C3; >c3 : C3 > : ^^ c3.p // protected, error ->c3.p : number -> : ^^^^^^ +>c3.p : number | undefined +> : ^^^^^^^^^^^^^^^^^^ >c3 : C3 > : ^^ ->p : number -> : ^^^^^^ +>p : number | undefined +> : ^^^^^^^^^^^^^^^^^^ class Derived extends C3 { >Derived : Derived @@ -82,12 +82,12 @@ class Derived extends C3 { > : ^^^^^^ this.p; // OK ->this.p : number -> : ^^^^^^ +>this.p : number | undefined +> : ^^^^^^^^^^^^^^^^^^ >this : this > : ^^^^ ->p : number -> : ^^^^^^ +>p : number | undefined +> : ^^^^^^^^^^^^^^^^^^ } } diff --git a/tests/baselines/reference/classConstructorParametersAccessibility3.errors.txt b/tests/baselines/reference/classConstructorParametersAccessibility3.errors.txt new file mode 100644 index 0000000000000..68c2e46eb2c59 --- /dev/null +++ b/tests/baselines/reference/classConstructorParametersAccessibility3.errors.txt @@ -0,0 +1,19 @@ +classConstructorParametersAccessibility3.ts(13,1): error TS2454: Variable 'd' is used before being assigned. + + +==== classConstructorParametersAccessibility3.ts (1 errors) ==== + class Base { + constructor(protected p: number) { } + } + + class Derived extends Base { + constructor(public p: number) { + super(p); + this.p; // OK + } + } + + var d: Derived; + d.p; // public, OK + ~ +!!! error TS2454: Variable 'd' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/classConstructorParametersAccessibility3.js b/tests/baselines/reference/classConstructorParametersAccessibility3.js index 6bf623149b64f..ca4b62b0d31dc 100644 --- a/tests/baselines/reference/classConstructorParametersAccessibility3.js +++ b/tests/baselines/reference/classConstructorParametersAccessibility3.js @@ -16,6 +16,7 @@ var d: Derived; d.p; // public, OK //// [classConstructorParametersAccessibility3.js] +"use strict"; class Base { constructor(p) { this.p = p; diff --git a/tests/baselines/reference/classDeclarationBlockScoping1.js b/tests/baselines/reference/classDeclarationBlockScoping1.js index 1f1dae0d9f1f8..5075ac61aa02e 100644 --- a/tests/baselines/reference/classDeclarationBlockScoping1.js +++ b/tests/baselines/reference/classDeclarationBlockScoping1.js @@ -10,6 +10,7 @@ class C { } //// [classDeclarationBlockScoping1.js] +"use strict"; class C { } { diff --git a/tests/baselines/reference/classDeclarationBlockScoping2.js b/tests/baselines/reference/classDeclarationBlockScoping2.js index 61455f27c0125..33d33b3292ac8 100644 --- a/tests/baselines/reference/classDeclarationBlockScoping2.js +++ b/tests/baselines/reference/classDeclarationBlockScoping2.js @@ -12,6 +12,7 @@ function f() { } //// [classDeclarationBlockScoping2.js] +"use strict"; function f() { class C { } diff --git a/tests/baselines/reference/classDeclarationCheckUsedBeforeDefinitionInFunctionDeclaration.js b/tests/baselines/reference/classDeclarationCheckUsedBeforeDefinitionInFunctionDeclaration.js index ab4b9feeb1d84..649912a597031 100644 --- a/tests/baselines/reference/classDeclarationCheckUsedBeforeDefinitionInFunctionDeclaration.js +++ b/tests/baselines/reference/classDeclarationCheckUsedBeforeDefinitionInFunctionDeclaration.js @@ -7,6 +7,7 @@ function f() { class C2 { } //// [classDeclarationCheckUsedBeforeDefinitionInFunctionDeclaration.js] +"use strict"; function f() { new C2(); // OK } diff --git a/tests/baselines/reference/classDeclarationCheckUsedBeforeDefinitionInItself.js b/tests/baselines/reference/classDeclarationCheckUsedBeforeDefinitionInItself.js index 6c6bd9f843b2b..1c8bf0c8fe0b7 100644 --- a/tests/baselines/reference/classDeclarationCheckUsedBeforeDefinitionInItself.js +++ b/tests/baselines/reference/classDeclarationCheckUsedBeforeDefinitionInItself.js @@ -6,6 +6,7 @@ class C3 { } //// [classDeclarationCheckUsedBeforeDefinitionInItself.js] +"use strict"; class C3 { } C3.intance = new C3(); // ok diff --git a/tests/baselines/reference/classDeclarationLoop.js b/tests/baselines/reference/classDeclarationLoop.js index 7fde0a2bfa98c..f6af5fd08abf3 100644 --- a/tests/baselines/reference/classDeclarationLoop.js +++ b/tests/baselines/reference/classDeclarationLoop.js @@ -11,6 +11,7 @@ for (let i = 0; i < 10; ++i) { //// [classDeclarationLoop.js] +"use strict"; const arr = []; for (let i = 0; i < 10; ++i) { class C { diff --git a/tests/baselines/reference/classDeclarationLoop.types b/tests/baselines/reference/classDeclarationLoop.types index 042730f013ca3..f162d9208d831 100644 --- a/tests/baselines/reference/classDeclarationLoop.types +++ b/tests/baselines/reference/classDeclarationLoop.types @@ -4,8 +4,8 @@ const arr = []; >arr : any[] > : ^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ for (let i = 0; i < 10; ++i) { >i : number diff --git a/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js index 06230aa9865ce..f7504ec058ae4 100644 --- a/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js +++ b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js @@ -14,6 +14,7 @@ namespace M { } //// [classDeclarationMergedInModuleWithContinuation.js] +"use strict"; var M; (function (M) { class N { diff --git a/tests/baselines/reference/classDeclarationShouldBeOutOfScopeInComputedNames.js b/tests/baselines/reference/classDeclarationShouldBeOutOfScopeInComputedNames.js index 3b2b5020194d0..3d5b2a7f8e9a2 100644 --- a/tests/baselines/reference/classDeclarationShouldBeOutOfScopeInComputedNames.js +++ b/tests/baselines/reference/classDeclarationShouldBeOutOfScopeInComputedNames.js @@ -13,6 +13,7 @@ class A { //// [classDeclarationShouldBeOutOfScopeInComputedNames.js] +"use strict"; var _a, _b; class A { constructor() { diff --git a/tests/baselines/reference/classDeclaredBeforeClassFactory.js b/tests/baselines/reference/classDeclaredBeforeClassFactory.js index 324c9ff434602..2384b7a07f373 100644 --- a/tests/baselines/reference/classDeclaredBeforeClassFactory.js +++ b/tests/baselines/reference/classDeclaredBeforeClassFactory.js @@ -10,6 +10,7 @@ function makeBaseClass() { //// [classDeclaredBeforeClassFactory.js] +"use strict"; // Should be OK due to hoisting class Derived extends makeBaseClass() { } diff --git a/tests/baselines/reference/classDoesNotDependOnBaseTypes.errors.txt b/tests/baselines/reference/classDoesNotDependOnBaseTypes.errors.txt new file mode 100644 index 0000000000000..55f24f7f43ed3 --- /dev/null +++ b/tests/baselines/reference/classDoesNotDependOnBaseTypes.errors.txt @@ -0,0 +1,30 @@ +classDoesNotDependOnBaseTypes.ts(9,12): error TS2454: Variable 'x' is used before being assigned. +classDoesNotDependOnBaseTypes.ts(10,5): error TS2454: Variable 'x' is used before being assigned. +classDoesNotDependOnBaseTypes.ts(10,5): error TS2542: Index signature in type 'StringTree' only permits reading. +classDoesNotDependOnBaseTypes.ts(11,5): error TS2454: Variable 'x' is used before being assigned. +classDoesNotDependOnBaseTypes.ts(11,5): error TS2542: Index signature in type 'StringTree' only permits reading. + + +==== classDoesNotDependOnBaseTypes.ts (5 errors) ==== + type StringTree = string | StringTreeCollection; + class StringTreeCollectionBase { + [n: number]: StringTree; + } + + class StringTreeCollection extends StringTreeCollectionBase { } + + var x: StringTree; + if (typeof x !== "string") { + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + x[0] = ""; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + ~~~~ +!!! error TS2542: Index signature in type 'StringTree' only permits reading. + x[0] = new StringTreeCollection; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + ~~~~ +!!! error TS2542: Index signature in type 'StringTree' only permits reading. + } \ No newline at end of file diff --git a/tests/baselines/reference/classDoesNotDependOnBaseTypes.js b/tests/baselines/reference/classDoesNotDependOnBaseTypes.js index d73e0483b67f2..213550cae3d94 100644 --- a/tests/baselines/reference/classDoesNotDependOnBaseTypes.js +++ b/tests/baselines/reference/classDoesNotDependOnBaseTypes.js @@ -15,6 +15,7 @@ if (typeof x !== "string") { } //// [classDoesNotDependOnBaseTypes.js] +"use strict"; class StringTreeCollectionBase { } class StringTreeCollection extends StringTreeCollectionBase { diff --git a/tests/baselines/reference/classDoesNotDependOnBaseTypes.types b/tests/baselines/reference/classDoesNotDependOnBaseTypes.types index e07994949a15b..828b5deac5616 100644 --- a/tests/baselines/reference/classDoesNotDependOnBaseTypes.types +++ b/tests/baselines/reference/classDoesNotDependOnBaseTypes.types @@ -39,8 +39,8 @@ if (typeof x !== "string") { > : ^^ >x[0] : StringTree > : ^^^^^^^^^^ ->x : StringTreeCollection -> : ^^^^^^^^^^^^^^^^^^^^ +>x : StringTree +> : ^^^^^^^^^^ >0 : 0 > : ^ >"" : "" @@ -51,8 +51,8 @@ if (typeof x !== "string") { > : ^^^^^^^^^^^^^^^^^^^^ >x[0] : StringTree > : ^^^^^^^^^^ ->x : StringTreeCollection -> : ^^^^^^^^^^^^^^^^^^^^ +>x : StringTree +> : ^^^^^^^^^^ >0 : 0 > : ^ >new StringTreeCollection : StringTreeCollection diff --git a/tests/baselines/reference/classDoesNotDependOnPrivateMember.errors.txt b/tests/baselines/reference/classDoesNotDependOnPrivateMember.errors.txt new file mode 100644 index 0000000000000..50846e33579dd --- /dev/null +++ b/tests/baselines/reference/classDoesNotDependOnPrivateMember.errors.txt @@ -0,0 +1,12 @@ +classDoesNotDependOnPrivateMember.ts(4,17): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. + + +==== classDoesNotDependOnPrivateMember.ts (1 errors) ==== + namespace M { + interface I { } + export class C { + private x: I; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/classDoesNotDependOnPrivateMember.js b/tests/baselines/reference/classDoesNotDependOnPrivateMember.js index d2ce422abc426..b18cdac8cc83e 100644 --- a/tests/baselines/reference/classDoesNotDependOnPrivateMember.js +++ b/tests/baselines/reference/classDoesNotDependOnPrivateMember.js @@ -9,6 +9,7 @@ namespace M { } //// [classDoesNotDependOnPrivateMember.js] +"use strict"; var M; (function (M) { class C { diff --git a/tests/baselines/reference/classExpression.js b/tests/baselines/reference/classExpression.js index 8dbf1927876b2..e17a4077e7c82 100644 --- a/tests/baselines/reference/classExpression.js +++ b/tests/baselines/reference/classExpression.js @@ -15,6 +15,7 @@ namespace M { } //// [classExpression.js] +"use strict"; var x = class C { }; var y = { diff --git a/tests/baselines/reference/classExpression1.js b/tests/baselines/reference/classExpression1.js index 0b03664ccbff6..4c0b4df8e64ac 100644 --- a/tests/baselines/reference/classExpression1.js +++ b/tests/baselines/reference/classExpression1.js @@ -4,5 +4,6 @@ var v = class C {}; //// [classExpression1.js] +"use strict"; var v = class C { }; diff --git a/tests/baselines/reference/classExpression2.js b/tests/baselines/reference/classExpression2.js index 0633147bf93fd..7db59dd12a7f8 100644 --- a/tests/baselines/reference/classExpression2.js +++ b/tests/baselines/reference/classExpression2.js @@ -5,6 +5,7 @@ class D { } var v = class C extends D {}; //// [classExpression2.js] +"use strict"; class D { } var v = class C extends D { diff --git a/tests/baselines/reference/classExpression3.js b/tests/baselines/reference/classExpression3.js index 389ac0dd81151..43846c50eea13 100644 --- a/tests/baselines/reference/classExpression3.js +++ b/tests/baselines/reference/classExpression3.js @@ -9,6 +9,7 @@ c.c; //// [classExpression3.js] +"use strict"; let C = class extends class extends class { constructor() { this.a = 1; diff --git a/tests/baselines/reference/classExpression4.js b/tests/baselines/reference/classExpression4.js index ea5c87c385fa7..d3c543dff6804 100644 --- a/tests/baselines/reference/classExpression4.js +++ b/tests/baselines/reference/classExpression4.js @@ -10,6 +10,7 @@ let x = (new C).foo(); //// [classExpression4.js] +"use strict"; let C = class { foo() { return new C(); diff --git a/tests/baselines/reference/classExpression5.js b/tests/baselines/reference/classExpression5.js index 4a1936f83235e..d5339771ef519 100644 --- a/tests/baselines/reference/classExpression5.js +++ b/tests/baselines/reference/classExpression5.js @@ -8,6 +8,7 @@ new class { }().hi(); //// [classExpression5.js] +"use strict"; new class { hi() { return "Hi!"; diff --git a/tests/baselines/reference/classExpressionAssignment.js b/tests/baselines/reference/classExpressionAssignment.js index 1e05c00487510..c9186c55c9d2b 100644 --- a/tests/baselines/reference/classExpressionAssignment.js +++ b/tests/baselines/reference/classExpressionAssignment.js @@ -10,6 +10,7 @@ const A: {new(): A} = class {} //// [classExpressionAssignment.js] +"use strict"; // This is invalid const A = class { }; diff --git a/tests/baselines/reference/classExpressionES61.js b/tests/baselines/reference/classExpressionES61.js index 6a7e8ff690d1e..2bfaadef3563c 100644 --- a/tests/baselines/reference/classExpressionES61.js +++ b/tests/baselines/reference/classExpressionES61.js @@ -4,5 +4,6 @@ var v = class C {}; //// [classExpressionES61.js] +"use strict"; var v = class C { }; diff --git a/tests/baselines/reference/classExpressionES62.js b/tests/baselines/reference/classExpressionES62.js index 5795a83af7b42..1630a50236fda 100644 --- a/tests/baselines/reference/classExpressionES62.js +++ b/tests/baselines/reference/classExpressionES62.js @@ -5,6 +5,7 @@ class D { } var v = class C extends D {}; //// [classExpressionES62.js] +"use strict"; class D { } var v = class C extends D { diff --git a/tests/baselines/reference/classExpressionES63.js b/tests/baselines/reference/classExpressionES63.js index d7c33ae2219ff..09b3d455a7a48 100644 --- a/tests/baselines/reference/classExpressionES63.js +++ b/tests/baselines/reference/classExpressionES63.js @@ -9,6 +9,7 @@ c.c; //// [classExpressionES63.js] +"use strict"; let C = class extends class extends class { constructor() { this.a = 1; diff --git a/tests/baselines/reference/classExpressionExtendingAbstractClass.js b/tests/baselines/reference/classExpressionExtendingAbstractClass.js index 27dce55b2c81e..80bb3fa24f26e 100644 --- a/tests/baselines/reference/classExpressionExtendingAbstractClass.js +++ b/tests/baselines/reference/classExpressionExtendingAbstractClass.js @@ -11,6 +11,7 @@ var C = class extends A { // no error reported! //// [classExpressionExtendingAbstractClass.js] +"use strict"; class A { } var C = class extends A { diff --git a/tests/baselines/reference/classExpressionInClassStaticDeclarations.js b/tests/baselines/reference/classExpressionInClassStaticDeclarations.js index c62ddba1e988b..fabf7638fd32b 100644 --- a/tests/baselines/reference/classExpressionInClassStaticDeclarations.js +++ b/tests/baselines/reference/classExpressionInClassStaticDeclarations.js @@ -6,6 +6,7 @@ class C { } //// [classExpressionInClassStaticDeclarations.js] +"use strict"; class C { } C.D = class extends C { diff --git a/tests/baselines/reference/classExpressionLoop.js b/tests/baselines/reference/classExpressionLoop.js index 993f8421d5ab6..e433add4915cc 100644 --- a/tests/baselines/reference/classExpressionLoop.js +++ b/tests/baselines/reference/classExpressionLoop.js @@ -10,6 +10,7 @@ for (let i = 0; i < 10; ++i) { //// [classExpressionLoop.js] +"use strict"; let arr = []; for (let i = 0; i < 10; ++i) { arr.push(class C { diff --git a/tests/baselines/reference/classExpressionLoop.types b/tests/baselines/reference/classExpressionLoop.types index 2688185cc56c0..4c8a046b312df 100644 --- a/tests/baselines/reference/classExpressionLoop.types +++ b/tests/baselines/reference/classExpressionLoop.types @@ -4,8 +4,8 @@ let arr = []; >arr : any[] > : ^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ for (let i = 0; i < 10; ++i) { >i : number diff --git a/tests/baselines/reference/classExpressionTest1.errors.txt b/tests/baselines/reference/classExpressionTest1.errors.txt new file mode 100644 index 0000000000000..b972d9cbc1450 --- /dev/null +++ b/tests/baselines/reference/classExpressionTest1.errors.txt @@ -0,0 +1,21 @@ +classExpressionTest1.ts(6,22): error TS2454: Variable 't' is used before being assigned. +classExpressionTest1.ts(6,25): error TS2454: Variable 'x' is used before being assigned. + + +==== classExpressionTest1.ts (2 errors) ==== + function M() { + class C { + f() { + var t: T; + var x: X; + return { t, x }; + ~ +!!! error TS2454: Variable 't' is used before being assigned. + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + } + } + + var v = new C(); + return v.f(); + } \ No newline at end of file diff --git a/tests/baselines/reference/classExpressionTest1.js b/tests/baselines/reference/classExpressionTest1.js index 46129b1543b6a..bdd96c20b34c7 100644 --- a/tests/baselines/reference/classExpressionTest1.js +++ b/tests/baselines/reference/classExpressionTest1.js @@ -15,6 +15,7 @@ function M() { } //// [classExpressionTest1.js] +"use strict"; function M() { class C { f() { diff --git a/tests/baselines/reference/classExpressionTest2.errors.txt b/tests/baselines/reference/classExpressionTest2.errors.txt new file mode 100644 index 0000000000000..c0a91bfc013cd --- /dev/null +++ b/tests/baselines/reference/classExpressionTest2.errors.txt @@ -0,0 +1,21 @@ +classExpressionTest2.ts(6,22): error TS2454: Variable 't' is used before being assigned. +classExpressionTest2.ts(6,25): error TS2454: Variable 'x' is used before being assigned. + + +==== classExpressionTest2.ts (2 errors) ==== + function M() { + var m = class C { + f() { + var t: T; + var x: X; + return { t, x }; + ~ +!!! error TS2454: Variable 't' is used before being assigned. + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + } + } + + var v = new m(); + return v.f(); + } \ No newline at end of file diff --git a/tests/baselines/reference/classExpressionTest2.js b/tests/baselines/reference/classExpressionTest2.js index aff2a679ca07a..250737a78ca76 100644 --- a/tests/baselines/reference/classExpressionTest2.js +++ b/tests/baselines/reference/classExpressionTest2.js @@ -15,6 +15,7 @@ function M() { } //// [classExpressionTest2.js] +"use strict"; function M() { var m = class C { f() { diff --git a/tests/baselines/reference/classExpressionWithDecorator1.js b/tests/baselines/reference/classExpressionWithDecorator1.js index 729cad873dba5..5a52cb27c7653 100644 --- a/tests/baselines/reference/classExpressionWithDecorator1.js +++ b/tests/baselines/reference/classExpressionWithDecorator1.js @@ -4,6 +4,7 @@ var v = @decorate class C { static p = 1 }; //// [classExpressionWithDecorator1.js] +"use strict"; var _a; var v = (_a = class C { }, diff --git a/tests/baselines/reference/classExpressionWithResolutionOfNamespaceOfSameName01.errors.txt b/tests/baselines/reference/classExpressionWithResolutionOfNamespaceOfSameName01.errors.txt new file mode 100644 index 0000000000000..d1d21f90f455b --- /dev/null +++ b/tests/baselines/reference/classExpressionWithResolutionOfNamespaceOfSameName01.errors.txt @@ -0,0 +1,14 @@ +classExpressionWithResolutionOfNamespaceOfSameName01.ts(7,5): error TS2564: Property 'prop' has no initializer and is not definitely assigned in the constructor. + + +==== classExpressionWithResolutionOfNamespaceOfSameName01.ts (1 errors) ==== + namespace C { + export interface type { + } + } + + var x = class C { + prop: C.type; + ~~~~ +!!! error TS2564: Property 'prop' has no initializer and is not definitely assigned in the constructor. + } \ No newline at end of file diff --git a/tests/baselines/reference/classExpressionWithResolutionOfNamespaceOfSameName01.js b/tests/baselines/reference/classExpressionWithResolutionOfNamespaceOfSameName01.js index e139e7b4c96f9..c30224608462f 100644 --- a/tests/baselines/reference/classExpressionWithResolutionOfNamespaceOfSameName01.js +++ b/tests/baselines/reference/classExpressionWithResolutionOfNamespaceOfSameName01.js @@ -11,5 +11,6 @@ var x = class C { } //// [classExpressionWithResolutionOfNamespaceOfSameName01.js] +"use strict"; var x = class C { }; diff --git a/tests/baselines/reference/classExpressionWithStaticProperties1.js b/tests/baselines/reference/classExpressionWithStaticProperties1.js index e116fb4f733ff..2fe1c55969190 100644 --- a/tests/baselines/reference/classExpressionWithStaticProperties1.js +++ b/tests/baselines/reference/classExpressionWithStaticProperties1.js @@ -8,6 +8,7 @@ var v = class C { }; //// [classExpressionWithStaticProperties1.js] +"use strict"; var _a; var v = (_a = class C { }, diff --git a/tests/baselines/reference/classExpressionWithStaticProperties2(target=es2015).js b/tests/baselines/reference/classExpressionWithStaticProperties2(target=es2015).js index 120631521cd13..2824dbac93d4e 100644 --- a/tests/baselines/reference/classExpressionWithStaticProperties2(target=es2015).js +++ b/tests/baselines/reference/classExpressionWithStaticProperties2(target=es2015).js @@ -11,6 +11,7 @@ var v = class C { }; //// [classExpressionWithStaticProperties2.js] +"use strict"; var _a; var v = (_a = class C { }, diff --git a/tests/baselines/reference/classExpressionWithStaticProperties2(target=es5).js b/tests/baselines/reference/classExpressionWithStaticProperties2(target=es5).js index 5421f1ff2ab9d..7e6a66e0673f4 100644 --- a/tests/baselines/reference/classExpressionWithStaticProperties2(target=es5).js +++ b/tests/baselines/reference/classExpressionWithStaticProperties2(target=es5).js @@ -11,6 +11,7 @@ var v = class C { }; //// [classExpressionWithStaticProperties2.js] +"use strict"; var _a; var v = (_a = /** @class */ (function () { function C() { diff --git a/tests/baselines/reference/classExpressionWithStaticProperties3(target=es2015).js b/tests/baselines/reference/classExpressionWithStaticProperties3(target=es2015).js index b2a29fb88857f..252e3a9c8a8e7 100644 --- a/tests/baselines/reference/classExpressionWithStaticProperties3(target=es2015).js +++ b/tests/baselines/reference/classExpressionWithStaticProperties3(target=es2015).js @@ -12,6 +12,7 @@ for (let i = 0; i < 3; i++) { arr.forEach(C => console.log(C.y())); //// [classExpressionWithStaticProperties3.js] +"use strict"; var _a; const arr = []; for (let i = 0; i < 3; i++) { diff --git a/tests/baselines/reference/classExpressionWithStaticProperties3(target=es2015).types b/tests/baselines/reference/classExpressionWithStaticProperties3(target=es2015).types index df8f6807c5362..a0733c7a89fa0 100644 --- a/tests/baselines/reference/classExpressionWithStaticProperties3(target=es2015).types +++ b/tests/baselines/reference/classExpressionWithStaticProperties3(target=es2015).types @@ -9,8 +9,8 @@ const arr: {y(): number}[] = []; > : ^^^^^^^ ^^^^^ >y : () => number > : ^^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ for (let i = 0; i < 3; i++) { >i : number diff --git a/tests/baselines/reference/classExpressionWithStaticProperties3(target=es5).js b/tests/baselines/reference/classExpressionWithStaticProperties3(target=es5).js index 66adc741efc8c..f288c4fee7048 100644 --- a/tests/baselines/reference/classExpressionWithStaticProperties3(target=es5).js +++ b/tests/baselines/reference/classExpressionWithStaticProperties3(target=es5).js @@ -12,6 +12,7 @@ for (let i = 0; i < 3; i++) { arr.forEach(C => console.log(C.y())); //// [classExpressionWithStaticProperties3.js] +"use strict"; var arr = []; var _loop_1 = function (i) { var _a = void 0; diff --git a/tests/baselines/reference/classExpressionWithStaticProperties3(target=es5).types b/tests/baselines/reference/classExpressionWithStaticProperties3(target=es5).types index c2e5edc1ae011..afc83a262c4db 100644 --- a/tests/baselines/reference/classExpressionWithStaticProperties3(target=es5).types +++ b/tests/baselines/reference/classExpressionWithStaticProperties3(target=es5).types @@ -10,8 +10,8 @@ const arr: {y(): number}[] = []; > : ^^^^^^^ ^^^^^ >y : () => number > : ^^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ for (let i = 0; i < 3; i++) { >i : number diff --git a/tests/baselines/reference/classExpressionWithStaticPropertiesES61.js b/tests/baselines/reference/classExpressionWithStaticPropertiesES61.js index a1f92fd1c9f1d..6ef3a68b6b806 100644 --- a/tests/baselines/reference/classExpressionWithStaticPropertiesES61.js +++ b/tests/baselines/reference/classExpressionWithStaticPropertiesES61.js @@ -8,6 +8,7 @@ var v = class C { }; //// [classExpressionWithStaticPropertiesES61.js] +"use strict"; var _a; var v = (_a = class C { }, diff --git a/tests/baselines/reference/classExpressionWithStaticPropertiesES62.js b/tests/baselines/reference/classExpressionWithStaticPropertiesES62.js index 18aad7005ffc1..0ec443bd055d5 100644 --- a/tests/baselines/reference/classExpressionWithStaticPropertiesES62.js +++ b/tests/baselines/reference/classExpressionWithStaticPropertiesES62.js @@ -11,6 +11,7 @@ var v = class C { }; //// [classExpressionWithStaticPropertiesES62.js] +"use strict"; var _a; var v = (_a = class C { }, diff --git a/tests/baselines/reference/classExpressionWithStaticPropertiesES63.js b/tests/baselines/reference/classExpressionWithStaticPropertiesES63.js index 6591b9b7c88e4..7b7bebd6bfdf1 100644 --- a/tests/baselines/reference/classExpressionWithStaticPropertiesES63.js +++ b/tests/baselines/reference/classExpressionWithStaticPropertiesES63.js @@ -12,6 +12,7 @@ for (let i = 0; i < 3; i++) { arr.forEach(C => console.log(C.y())); //// [classExpressionWithStaticPropertiesES63.js] +"use strict"; var _a; const arr = []; for (let i = 0; i < 3; i++) { diff --git a/tests/baselines/reference/classExpressionWithStaticPropertiesES63.types b/tests/baselines/reference/classExpressionWithStaticPropertiesES63.types index a858afeffb6dc..c02a48c905527 100644 --- a/tests/baselines/reference/classExpressionWithStaticPropertiesES63.types +++ b/tests/baselines/reference/classExpressionWithStaticPropertiesES63.types @@ -9,8 +9,8 @@ const arr: {y(): number}[] = []; > : ^^^^^^^ ^^^^^ >y : () => number > : ^^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ for (let i = 0; i < 3; i++) { >i : number diff --git a/tests/baselines/reference/classExpressionWithStaticPropertiesES64.js b/tests/baselines/reference/classExpressionWithStaticPropertiesES64.js index 88f076da29b46..c0726ed89f390 100644 --- a/tests/baselines/reference/classExpressionWithStaticPropertiesES64.js +++ b/tests/baselines/reference/classExpressionWithStaticPropertiesES64.js @@ -5,6 +5,7 @@ //// [classExpressionWithStaticPropertiesES64.js] +"use strict"; var _a; (_a = class { }, diff --git a/tests/baselines/reference/classExpressions.errors.txt b/tests/baselines/reference/classExpressions.errors.txt new file mode 100644 index 0000000000000..0e7f06cae8e78 --- /dev/null +++ b/tests/baselines/reference/classExpressions.errors.txt @@ -0,0 +1,14 @@ +classExpressions.ts(3,5): error TS2564: Property 'prop' has no initializer and is not definitely assigned in the constructor. + + +==== classExpressions.ts (1 errors) ==== + interface A {} + let x = class B implements A { + prop: number; + ~~~~ +!!! error TS2564: Property 'prop' has no initializer and is not definitely assigned in the constructor. + onStart(): void { + } + func = () => { + } + }; \ No newline at end of file diff --git a/tests/baselines/reference/classExpressions.js b/tests/baselines/reference/classExpressions.js index 8c75445f83745..7dac58c5f7fa9 100644 --- a/tests/baselines/reference/classExpressions.js +++ b/tests/baselines/reference/classExpressions.js @@ -11,6 +11,7 @@ let x = class B implements A { }; //// [classExpressions.js] +"use strict"; let x = class B { constructor() { this.func = () => { diff --git a/tests/baselines/reference/classExtendingAny.errors.txt b/tests/baselines/reference/classExtendingAny.errors.txt new file mode 100644 index 0000000000000..0c6b8a5a59123 --- /dev/null +++ b/tests/baselines/reference/classExtendingAny.errors.txt @@ -0,0 +1,38 @@ +a.ts(3,5): error TS2564: Property 'payload' has no initializer and is not definitely assigned in the constructor. + + +==== a.ts (1 errors) ==== + declare var Err: any + class A extends Err { + payload: string + ~~~~~~~ +!!! error TS2564: Property 'payload' has no initializer and is not definitely assigned in the constructor. + constructor() { + super(1,2,3,3,4,56) + super.unknown + super['unknown'] + } + process() { + return this.payload + "!"; + } + } + + var o = { + m() { + super.unknown + } + } +==== b.js (0 errors) ==== + class B extends Err { + constructor() { + super() + this.wat = 12 + } + f() { + this.wat + this.wit + this['wot'] + super.alsoBad + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/classExtendingAny.types b/tests/baselines/reference/classExtendingAny.types index d0e7b65620f69..9a4c18bec6b54 100644 --- a/tests/baselines/reference/classExtendingAny.types +++ b/tests/baselines/reference/classExtendingAny.types @@ -3,11 +3,13 @@ === a.ts === declare var Err: any >Err : any +> : ^^^ class A extends Err { >A : A > : ^ >Err : any +> : ^^^ payload: string >payload : string @@ -18,6 +20,7 @@ class A extends Err { >super(1,2,3,3,4,56) : void > : ^^^^ >super : any +> : ^^^ >1 : 1 > : ^ >2 : 2 @@ -33,6 +36,7 @@ class A extends Err { super.unknown >super.unknown : any +> : ^^^ >super : any > : ^^^ >unknown : any @@ -40,7 +44,9 @@ class A extends Err { super['unknown'] >super['unknown'] : any +> : ^^^ >super : any +> : ^^^ >'unknown' : "unknown" > : ^^^^^^^^^ } @@ -74,6 +80,7 @@ var o = { super.unknown >super.unknown : any +> : ^^^ >super : any > : ^^^ >unknown : any @@ -85,17 +92,20 @@ class B extends Err { >B : B > : ^ >Err : any +> : ^^^ constructor() { super() >super() : void > : ^^^^ >super : any +> : ^^^ this.wat = 12 >this.wat = 12 : 12 > : ^^ >this.wat : any +> : ^^^ >this : this > : ^^^^ >wat : any @@ -117,6 +127,7 @@ class B extends Err { this.wit >this.wit : any +> : ^^^ >this : this > : ^^^^ >wit : any @@ -124,6 +135,7 @@ class B extends Err { this['wot'] >this['wot'] : any +> : ^^^ >this : this > : ^^^^ >'wot' : "wot" @@ -131,6 +143,7 @@ class B extends Err { super.alsoBad >super.alsoBad : any +> : ^^^ >super : any > : ^^^ >alsoBad : any diff --git a/tests/baselines/reference/classExtendingBuiltinType.js b/tests/baselines/reference/classExtendingBuiltinType.js index 6d6a5a793f318..de5fe9b9d4105 100644 --- a/tests/baselines/reference/classExtendingBuiltinType.js +++ b/tests/baselines/reference/classExtendingBuiltinType.js @@ -14,6 +14,7 @@ class C10 extends Array { } //// [classExtendingBuiltinType.js] +"use strict"; class C1 extends Object { } class C2 extends Function { diff --git a/tests/baselines/reference/classExtendingClass.errors.txt b/tests/baselines/reference/classExtendingClass.errors.txt new file mode 100644 index 0000000000000..8f5e84e6a6ebf --- /dev/null +++ b/tests/baselines/reference/classExtendingClass.errors.txt @@ -0,0 +1,64 @@ +classExtendingClass.ts(2,5): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. +classExtendingClass.ts(8,5): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. +classExtendingClass.ts(12,9): error TS2454: Variable 'd' is used before being assigned. +classExtendingClass.ts(13,10): error TS2454: Variable 'd' is used before being assigned. +classExtendingClass.ts(14,10): error TS2454: Variable 'd' is used before being assigned. +classExtendingClass.ts(18,5): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. +classExtendingClass.ts(24,5): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. +classExtendingClass.ts(28,10): error TS2454: Variable 'd2' is used before being assigned. +classExtendingClass.ts(29,10): error TS2454: Variable 'd2' is used before being assigned. +classExtendingClass.ts(30,10): error TS2454: Variable 'd2' is used before being assigned. + + +==== classExtendingClass.ts (10 errors) ==== + class C { + foo: string; + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. + thing() { } + static other() { } + } + + class D extends C { + bar: string; + ~~~ +!!! error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. + } + + var d: D; + var r = d.foo; + ~ +!!! error TS2454: Variable 'd' is used before being assigned. + var r2 = d.bar; + ~ +!!! error TS2454: Variable 'd' is used before being assigned. + var r3 = d.thing(); + ~ +!!! error TS2454: Variable 'd' is used before being assigned. + var r4 = D.other(); + + class C2 { + foo: T; + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. + thing(x: T) { } + static other(x: T) { } + } + + class D2 extends C2 { + bar: string; + ~~~ +!!! error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. + } + + var d2: D2; + var r5 = d2.foo; + ~~ +!!! error TS2454: Variable 'd2' is used before being assigned. + var r6 = d2.bar; + ~~ +!!! error TS2454: Variable 'd2' is used before being assigned. + var r7 = d2.thing(''); + ~~ +!!! error TS2454: Variable 'd2' is used before being assigned. + var r8 = D2.other(1); \ No newline at end of file diff --git a/tests/baselines/reference/classExtendingClass.js b/tests/baselines/reference/classExtendingClass.js index 1e189fd012184..26466a6813eb3 100644 --- a/tests/baselines/reference/classExtendingClass.js +++ b/tests/baselines/reference/classExtendingClass.js @@ -34,6 +34,7 @@ var r7 = d2.thing(''); var r8 = D2.other(1); //// [classExtendingClass.js] +"use strict"; class C { thing() { } static other() { } diff --git a/tests/baselines/reference/classExtendingClassLikeType.js b/tests/baselines/reference/classExtendingClassLikeType.js index d771977db4867..19e5b225d5f44 100644 --- a/tests/baselines/reference/classExtendingClassLikeType.js +++ b/tests/baselines/reference/classExtendingClassLikeType.js @@ -61,6 +61,7 @@ class D5 extends getBadBase() { //// [classExtendingClassLikeType.js] +"use strict"; // Error, no Base constructor function class D0 extends Base { } diff --git a/tests/baselines/reference/classExtendingNonConstructor.errors.txt b/tests/baselines/reference/classExtendingNonConstructor.errors.txt index c5e5f1124ba5d..e931f048e60cc 100644 --- a/tests/baselines/reference/classExtendingNonConstructor.errors.txt +++ b/tests/baselines/reference/classExtendingNonConstructor.errors.txt @@ -1,17 +1,21 @@ +classExtendingNonConstructor.ts(4,5): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. classExtendingNonConstructor.ts(7,18): error TS2507: Type 'undefined' is not a constructor function type. classExtendingNonConstructor.ts(8,18): error TS2507: Type 'true' is not a constructor function type. classExtendingNonConstructor.ts(9,18): error TS2507: Type 'false' is not a constructor function type. classExtendingNonConstructor.ts(10,18): error TS2507: Type '42' is not a constructor function type. classExtendingNonConstructor.ts(11,18): error TS2507: Type '"hello"' is not a constructor function type. +classExtendingNonConstructor.ts(12,18): error TS2454: Variable 'x' is used before being assigned. classExtendingNonConstructor.ts(12,18): error TS2507: Type '{}' is not a constructor function type. classExtendingNonConstructor.ts(13,18): error TS2507: Type '() => void' is not a constructor function type. -==== classExtendingNonConstructor.ts (7 errors) ==== +==== classExtendingNonConstructor.ts (9 errors) ==== var x: {}; function foo() { this.x = 1; + ~~~~ +!!! error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. } class C1 extends undefined { } @@ -31,6 +35,8 @@ classExtendingNonConstructor.ts(13,18): error TS2507: Type '() => void' is not a !!! error TS2507: Type '"hello"' is not a constructor function type. class C6 extends x { } ~ +!!! error TS2454: Variable 'x' is used before being assigned. + ~ !!! error TS2507: Type '{}' is not a constructor function type. class C7 extends foo { } ~~~ diff --git a/tests/baselines/reference/classExtendingNonConstructor.js b/tests/baselines/reference/classExtendingNonConstructor.js index ce7f9a61e3029..723b5fa3f5d6f 100644 --- a/tests/baselines/reference/classExtendingNonConstructor.js +++ b/tests/baselines/reference/classExtendingNonConstructor.js @@ -17,6 +17,7 @@ class C7 extends foo { } //// [classExtendingNonConstructor.js] +"use strict"; var x; function foo() { this.x = 1; diff --git a/tests/baselines/reference/classExtendingNull.js b/tests/baselines/reference/classExtendingNull.js index dbbfe04fe099e..0b6c38aa2699a 100644 --- a/tests/baselines/reference/classExtendingNull.js +++ b/tests/baselines/reference/classExtendingNull.js @@ -7,6 +7,7 @@ class C3 extends null { x = 1; } class C4 extends (null) { x = 1; } //// [classExtendingNull.js] +"use strict"; class C1 extends null { } class C2 extends (null) { diff --git a/tests/baselines/reference/classExtendingOptionalChain.js b/tests/baselines/reference/classExtendingOptionalChain.js index 3746951fea6ca..5d934c734e112 100644 --- a/tests/baselines/reference/classExtendingOptionalChain.js +++ b/tests/baselines/reference/classExtendingOptionalChain.js @@ -13,6 +13,7 @@ class C2 implements A?.B {} //// [classExtendingOptionalChain.js] +"use strict"; var A; (function (A) { class B { diff --git a/tests/baselines/reference/classExtendingPrimitive.js b/tests/baselines/reference/classExtendingPrimitive.js index 9e44e86e77bc1..33920f3d093ea 100644 --- a/tests/baselines/reference/classExtendingPrimitive.js +++ b/tests/baselines/reference/classExtendingPrimitive.js @@ -26,6 +26,7 @@ const C14 = class C extends boolean { } //// [classExtendingPrimitive.js] +"use strict"; // classes cannot extend primitives class C extends number { } diff --git a/tests/baselines/reference/classExtendingPrimitive2.js b/tests/baselines/reference/classExtendingPrimitive2.js index 90d94b9778e7f..3dd4113e8cd85 100644 --- a/tests/baselines/reference/classExtendingPrimitive2.js +++ b/tests/baselines/reference/classExtendingPrimitive2.js @@ -7,6 +7,7 @@ class C4a extends void {} class C5a extends null { } //// [classExtendingPrimitive2.js] +"use strict"; // classes cannot extend primitives class C4a extends { } diff --git a/tests/baselines/reference/classExtendingQualifiedName.js b/tests/baselines/reference/classExtendingQualifiedName.js index ea085b11a5ca6..3a0ac2e8963e5 100644 --- a/tests/baselines/reference/classExtendingQualifiedName.js +++ b/tests/baselines/reference/classExtendingQualifiedName.js @@ -10,6 +10,7 @@ namespace M { } //// [classExtendingQualifiedName.js] +"use strict"; var M; (function (M) { class C { diff --git a/tests/baselines/reference/classExtendingQualifiedName2.js b/tests/baselines/reference/classExtendingQualifiedName2.js index 5e9d1b37bca37..e2aeeb9b3f317 100644 --- a/tests/baselines/reference/classExtendingQualifiedName2.js +++ b/tests/baselines/reference/classExtendingQualifiedName2.js @@ -10,6 +10,7 @@ namespace M { } //// [classExtendingQualifiedName2.js] +"use strict"; var M; (function (M) { class C { diff --git a/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.errors.txt b/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.errors.txt index 05e2d691c8c43..a4db16a505dbc 100644 --- a/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.errors.txt +++ b/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.errors.txt @@ -1,9 +1,13 @@ +classExtendsClauseClassMergedWithModuleNotReferingConstructor.ts(2,5): error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. classExtendsClauseClassMergedWithModuleNotReferingConstructor.ts(10,21): error TS2507: Type 'number' is not a constructor function type. +classExtendsClauseClassMergedWithModuleNotReferingConstructor.ts(11,9): error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. -==== classExtendsClauseClassMergedWithModuleNotReferingConstructor.ts (1 errors) ==== +==== classExtendsClauseClassMergedWithModuleNotReferingConstructor.ts (3 errors) ==== class A { a: number; + ~ +!!! error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. } namespace A { export var v: string; @@ -15,5 +19,7 @@ classExtendsClauseClassMergedWithModuleNotReferingConstructor.ts(10,21): error T ~ !!! error TS2507: Type 'number' is not a constructor function type. b: string; + ~ +!!! error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. } } \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js b/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js index 40367cbf346d4..77cb16b6024ac 100644 --- a/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js +++ b/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js @@ -16,6 +16,7 @@ namespace Foo { } //// [classExtendsClauseClassMergedWithModuleNotReferingConstructor.js] +"use strict"; class A { } (function (A) { diff --git a/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.errors.txt b/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.errors.txt index 88be78ebff37f..05f76a16e5bb0 100644 --- a/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.errors.txt +++ b/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.errors.txt @@ -1,12 +1,18 @@ +classExtendsClauseClassNotReferringConstructor.ts(1,11): error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. classExtendsClauseClassNotReferringConstructor.ts(4,21): error TS2507: Type 'number' is not a constructor function type. +classExtendsClauseClassNotReferringConstructor.ts(4,25): error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. -==== classExtendsClauseClassNotReferringConstructor.ts (1 errors) ==== +==== classExtendsClauseClassNotReferringConstructor.ts (3 errors) ==== class A { a: number; } + ~ +!!! error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. namespace Foo { var A = 1; class B extends A { b: string; } ~ !!! error TS2507: Type 'number' is not a constructor function type. + ~ +!!! error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. } \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.js b/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.js index c6e5a6a88cee5..209d59bc7aed3 100644 --- a/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.js +++ b/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.js @@ -9,6 +9,7 @@ namespace Foo { //// [classExtendsClauseClassNotReferringConstructor.js] +"use strict"; class A { } var Foo; diff --git a/tests/baselines/reference/classExtendsEveryObjectType.errors.txt b/tests/baselines/reference/classExtendsEveryObjectType.errors.txt index f983e46d8d66d..905bcc8a5443f 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType.errors.txt +++ b/tests/baselines/reference/classExtendsEveryObjectType.errors.txt @@ -5,7 +5,7 @@ classExtendsEveryObjectType.ts(6,31): error TS1005: ',' expected. classExtendsEveryObjectType.ts(8,18): error TS2507: Type '{ foo: string; }' is not a constructor function type. classExtendsEveryObjectType.ts(11,18): error TS2507: Type 'typeof M' is not a constructor function type. classExtendsEveryObjectType.ts(14,18): error TS2507: Type '() => void' is not a constructor function type. -classExtendsEveryObjectType.ts(16,18): error TS2507: Type 'undefined[]' is not a constructor function type. +classExtendsEveryObjectType.ts(16,18): error TS2507: Type 'never[]' is not a constructor function type. ==== classExtendsEveryObjectType.ts (8 errors) ==== @@ -40,4 +40,4 @@ classExtendsEveryObjectType.ts(16,18): error TS2507: Type 'undefined[]' is not a class C6 extends []{ } // error ~~ -!!! error TS2507: Type 'undefined[]' is not a constructor function type. \ No newline at end of file +!!! error TS2507: Type 'never[]' is not a constructor function type. \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsEveryObjectType.js b/tests/baselines/reference/classExtendsEveryObjectType.js index c6cc17448bc84..ac7c74d4424d8 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType.js +++ b/tests/baselines/reference/classExtendsEveryObjectType.js @@ -19,6 +19,7 @@ class C5 extends foo { } // error class C6 extends []{ } // error //// [classExtendsEveryObjectType.js] +"use strict"; class C extends I { } // error class C2 extends { foo: string } { diff --git a/tests/baselines/reference/classExtendsEveryObjectType.types b/tests/baselines/reference/classExtendsEveryObjectType.types index 9c5622ab92741..315cef67fea4c 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType.types +++ b/tests/baselines/reference/classExtendsEveryObjectType.types @@ -61,6 +61,6 @@ class C5 extends foo { } // error class C6 extends []{ } // error >C6 : C6 > : ^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ diff --git a/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt b/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt index 93be4126b3f40..3402e82cfe7c0 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt +++ b/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt @@ -1,7 +1,7 @@ classExtendsEveryObjectType2.ts(1,18): error TS2507: Type '{ foo: any; }' is not a constructor function type. classExtendsEveryObjectType2.ts(1,25): error TS2693: 'string' only refers to a type, but is being used as a value here. classExtendsEveryObjectType2.ts(1,31): error TS1005: ',' expected. -classExtendsEveryObjectType2.ts(3,18): error TS2507: Type 'undefined[]' is not a constructor function type. +classExtendsEveryObjectType2.ts(3,18): error TS2507: Type 'never[]' is not a constructor function type. ==== classExtendsEveryObjectType2.ts (4 errors) ==== @@ -15,4 +15,4 @@ classExtendsEveryObjectType2.ts(3,18): error TS2507: Type 'undefined[]' is not a class C6 extends []{ } // error ~~ -!!! error TS2507: Type 'undefined[]' is not a constructor function type. \ No newline at end of file +!!! error TS2507: Type 'never[]' is not a constructor function type. \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsEveryObjectType2.js b/tests/baselines/reference/classExtendsEveryObjectType2.js index bcf68b212e029..198e3e9c93ed7 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType2.js +++ b/tests/baselines/reference/classExtendsEveryObjectType2.js @@ -6,6 +6,7 @@ class C2 extends { foo: string; } { } // error class C6 extends []{ } // error //// [classExtendsEveryObjectType2.js] +"use strict"; class C2 extends { foo: string } { } // error class C6 extends [] { diff --git a/tests/baselines/reference/classExtendsEveryObjectType2.types b/tests/baselines/reference/classExtendsEveryObjectType2.types index 9f70b3a11ccf1..177a068483acd 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType2.types +++ b/tests/baselines/reference/classExtendsEveryObjectType2.types @@ -14,6 +14,6 @@ class C2 extends { foo: string; } { } // error class C6 extends []{ } // error >C6 : C6 > : ^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ diff --git a/tests/baselines/reference/classExtendsInterface.js b/tests/baselines/reference/classExtendsInterface.js index 767eee251c82c..074fcb2bb26a6 100644 --- a/tests/baselines/reference/classExtendsInterface.js +++ b/tests/baselines/reference/classExtendsInterface.js @@ -11,6 +11,7 @@ class B2 implements Comparable2 {} //// [classExtendsInterface.js] +"use strict"; class A extends Comparable { } class B { diff --git a/tests/baselines/reference/classExtendsInterfaceInExpression.errors.txt b/tests/baselines/reference/classExtendsInterfaceInExpression.errors.txt index c3dbe32284913..ffc317046eabb 100644 --- a/tests/baselines/reference/classExtendsInterfaceInExpression.errors.txt +++ b/tests/baselines/reference/classExtendsInterfaceInExpression.errors.txt @@ -1,11 +1,14 @@ +classExtendsInterfaceInExpression.ts(4,3): error TS2322: Type 'null' is not assignable to type 'new () => Object'. classExtendsInterfaceInExpression.ts(7,25): error TS2693: 'A' only refers to a type, but is being used as a value here. -==== classExtendsInterfaceInExpression.ts (1 errors) ==== +==== classExtendsInterfaceInExpression.ts (2 errors) ==== interface A {} function factory(a: any): {new(): Object} { return null; + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'new () => Object'. } class C extends factory(A) {} diff --git a/tests/baselines/reference/classExtendsInterfaceInExpression.js b/tests/baselines/reference/classExtendsInterfaceInExpression.js index 3ec5e9c61e62f..174faf1dbdcf5 100644 --- a/tests/baselines/reference/classExtendsInterfaceInExpression.js +++ b/tests/baselines/reference/classExtendsInterfaceInExpression.js @@ -11,6 +11,7 @@ class C extends factory(A) {} //// [classExtendsInterfaceInExpression.js] +"use strict"; function factory(a) { return null; } diff --git a/tests/baselines/reference/classExtendsInterfaceInModule.js b/tests/baselines/reference/classExtendsInterfaceInModule.js index 1535f8ef06ea2..73a08bafe91c7 100644 --- a/tests/baselines/reference/classExtendsInterfaceInModule.js +++ b/tests/baselines/reference/classExtendsInterfaceInModule.js @@ -18,6 +18,7 @@ class D extends Mod.Nested.I {} //// [classExtendsInterfaceInModule.js] +"use strict"; class C1 extends M.I1 { } class C2 extends M.I2 { diff --git a/tests/baselines/reference/classExtendsInterfaceThatExtendsClassWithPrivates1.js b/tests/baselines/reference/classExtendsInterfaceThatExtendsClassWithPrivates1.js index b385d1340c021..355bf57b0c3a3 100644 --- a/tests/baselines/reference/classExtendsInterfaceThatExtendsClassWithPrivates1.js +++ b/tests/baselines/reference/classExtendsInterfaceThatExtendsClassWithPrivates1.js @@ -17,6 +17,7 @@ class D2 implements I { } //// [classExtendsInterfaceThatExtendsClassWithPrivates1.js] +"use strict"; class C { constructor() { this.x = 1; diff --git a/tests/baselines/reference/classExtendsInterface_not.js b/tests/baselines/reference/classExtendsInterface_not.js index ac6528cec1d4d..912e4346eda65 100644 --- a/tests/baselines/reference/classExtendsInterface_not.js +++ b/tests/baselines/reference/classExtendsInterface_not.js @@ -5,5 +5,6 @@ class C extends "".bogus {} //// [classExtendsInterface_not.js] +"use strict"; class C extends "".bogus { } diff --git a/tests/baselines/reference/classExtendsItself.js b/tests/baselines/reference/classExtendsItself.js index b66ce23fe2887..3294b841ac845 100644 --- a/tests/baselines/reference/classExtendsItself.js +++ b/tests/baselines/reference/classExtendsItself.js @@ -8,6 +8,7 @@ class D extends D { } // error class E extends E { } // error //// [classExtendsItself.js] +"use strict"; class C extends C { } // error class D extends D { diff --git a/tests/baselines/reference/classExtendsItselfIndirectly.errors.txt b/tests/baselines/reference/classExtendsItselfIndirectly.errors.txt index 503ce50ba3cdb..a93fbb8ae8978 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly.errors.txt +++ b/tests/baselines/reference/classExtendsItselfIndirectly.errors.txt @@ -1,28 +1,40 @@ classExtendsItselfIndirectly.ts(1,7): error TS2506: 'C' is referenced directly or indirectly in its own base expression. classExtendsItselfIndirectly.ts(1,17): error TS2449: Class 'E' used before its declaration. +classExtendsItselfIndirectly.ts(1,21): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. classExtendsItselfIndirectly.ts(3,7): error TS2506: 'D' is referenced directly or indirectly in its own base expression. +classExtendsItselfIndirectly.ts(3,21): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. classExtendsItselfIndirectly.ts(5,7): error TS2506: 'E' is referenced directly or indirectly in its own base expression. +classExtendsItselfIndirectly.ts(5,21): error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. classExtendsItselfIndirectly.ts(7,7): error TS2506: 'C2' is referenced directly or indirectly in its own base expression. classExtendsItselfIndirectly.ts(7,21): error TS2449: Class 'E2' used before its declaration. +classExtendsItselfIndirectly.ts(7,29): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. classExtendsItselfIndirectly.ts(9,7): error TS2506: 'D2' is referenced directly or indirectly in its own base expression. +classExtendsItselfIndirectly.ts(9,29): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. classExtendsItselfIndirectly.ts(11,7): error TS2506: 'E2' is referenced directly or indirectly in its own base expression. +classExtendsItselfIndirectly.ts(11,29): error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. -==== classExtendsItselfIndirectly.ts (8 errors) ==== +==== classExtendsItselfIndirectly.ts (14 errors) ==== class C extends E { foo: string; } // error ~ !!! error TS2506: 'C' is referenced directly or indirectly in its own base expression. ~ !!! error TS2449: Class 'E' used before its declaration. !!! related TS2728 classExtendsItselfIndirectly.ts:5:7: 'E' is declared here. + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. class D extends C { bar: string; } ~ !!! error TS2506: 'D' is referenced directly or indirectly in its own base expression. + ~~~ +!!! error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. class E extends D { baz: number; } ~ !!! error TS2506: 'E' is referenced directly or indirectly in its own base expression. + ~~~ +!!! error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. class C2 extends E2 { foo: T; } // error ~~ @@ -30,11 +42,17 @@ classExtendsItselfIndirectly.ts(11,7): error TS2506: 'E2' is referenced directly ~~ !!! error TS2449: Class 'E2' used before its declaration. !!! related TS2728 classExtendsItselfIndirectly.ts:11:7: 'E2' is declared here. + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. class D2 extends C2 { bar: T; } ~~ !!! error TS2506: 'D2' is referenced directly or indirectly in its own base expression. + ~~~ +!!! error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. class E2 extends D2 { baz: T; } ~~ -!!! error TS2506: 'E2' is referenced directly or indirectly in its own base expression. \ No newline at end of file +!!! error TS2506: 'E2' is referenced directly or indirectly in its own base expression. + ~~~ +!!! error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsItselfIndirectly.js b/tests/baselines/reference/classExtendsItselfIndirectly.js index d64b8549b33cb..682e4fd9b79f5 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly.js +++ b/tests/baselines/reference/classExtendsItselfIndirectly.js @@ -14,6 +14,7 @@ class D2 extends C2 { bar: T; } class E2 extends D2 { baz: T; } //// [classExtendsItselfIndirectly.js] +"use strict"; class C extends E { } // error class D extends C { diff --git a/tests/baselines/reference/classExtendsItselfIndirectly2.errors.txt b/tests/baselines/reference/classExtendsItselfIndirectly2.errors.txt index dce63be85fe17..3545b0844182d 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly2.errors.txt +++ b/tests/baselines/reference/classExtendsItselfIndirectly2.errors.txt @@ -1,25 +1,35 @@ classExtendsItselfIndirectly2.ts(1,7): error TS2506: 'C' is referenced directly or indirectly in its own base expression. classExtendsItselfIndirectly2.ts(1,19): error TS2449: Class 'E' used before its declaration. +classExtendsItselfIndirectly2.ts(1,23): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. classExtendsItselfIndirectly2.ts(4,18): error TS2506: 'D' is referenced directly or indirectly in its own base expression. +classExtendsItselfIndirectly2.ts(4,32): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. classExtendsItselfIndirectly2.ts(9,18): error TS2506: 'E' is referenced directly or indirectly in its own base expression. +classExtendsItselfIndirectly2.ts(9,34): error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. classExtendsItselfIndirectly2.ts(13,11): error TS2506: 'C2' is referenced directly or indirectly in its own base expression. classExtendsItselfIndirectly2.ts(13,27): error TS2449: Class 'E2' used before its declaration. +classExtendsItselfIndirectly2.ts(13,35): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. classExtendsItselfIndirectly2.ts(16,22): error TS2506: 'D2' is referenced directly or indirectly in its own base expression. +classExtendsItselfIndirectly2.ts(16,44): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. classExtendsItselfIndirectly2.ts(20,22): error TS2506: 'E2' is referenced directly or indirectly in its own base expression. +classExtendsItselfIndirectly2.ts(20,46): error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. -==== classExtendsItselfIndirectly2.ts (8 errors) ==== +==== classExtendsItselfIndirectly2.ts (14 errors) ==== class C extends N.E { foo: string; } // error ~ !!! error TS2506: 'C' is referenced directly or indirectly in its own base expression. ~ !!! error TS2449: Class 'E' used before its declaration. !!! related TS2728 classExtendsItselfIndirectly2.ts:9:18: 'E' is declared here. + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. namespace M { export class D extends C { bar: string; } ~ !!! error TS2506: 'D' is referenced directly or indirectly in its own base expression. + ~~~ +!!! error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. } @@ -27,6 +37,8 @@ classExtendsItselfIndirectly2.ts(20,22): error TS2506: 'E2' is referenced direct export class E extends M.D { baz: number; } ~ !!! error TS2506: 'E' is referenced directly or indirectly in its own base expression. + ~~~ +!!! error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. } namespace O { @@ -36,16 +48,22 @@ classExtendsItselfIndirectly2.ts(20,22): error TS2506: 'E2' is referenced direct ~~ !!! error TS2449: Class 'E2' used before its declaration. !!! related TS2728 classExtendsItselfIndirectly2.ts:20:22: 'E2' is declared here. + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. namespace P { export class D2 extends C2 { bar: T; } ~~ !!! error TS2506: 'D2' is referenced directly or indirectly in its own base expression. + ~~~ +!!! error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. } namespace Q { export class E2 extends P.D2 { baz: T; } ~~ !!! error TS2506: 'E2' is referenced directly or indirectly in its own base expression. + ~~~ +!!! error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. } } \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsItselfIndirectly2.js b/tests/baselines/reference/classExtendsItselfIndirectly2.js index d0bf88d845385..7a0acfd5f1c8e 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly2.js +++ b/tests/baselines/reference/classExtendsItselfIndirectly2.js @@ -25,6 +25,7 @@ namespace O { } //// [classExtendsItselfIndirectly2.js] +"use strict"; class C extends N.E { } // error var M; diff --git a/tests/baselines/reference/classExtendsItselfIndirectly3.errors.txt b/tests/baselines/reference/classExtendsItselfIndirectly3.errors.txt index ca06986e3983b..7d0b88a2cf993 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly3.errors.txt +++ b/tests/baselines/reference/classExtendsItselfIndirectly3.errors.txt @@ -1,37 +1,55 @@ classExtendsItselfIndirectly_file1.ts(1,7): error TS2506: 'C' is referenced directly or indirectly in its own base expression. +classExtendsItselfIndirectly_file1.ts(1,21): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. classExtendsItselfIndirectly_file2.ts(1,7): error TS2506: 'D' is referenced directly or indirectly in its own base expression. +classExtendsItselfIndirectly_file2.ts(1,21): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. classExtendsItselfIndirectly_file3.ts(1,7): error TS2506: 'E' is referenced directly or indirectly in its own base expression. +classExtendsItselfIndirectly_file3.ts(1,21): error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. classExtendsItselfIndirectly_file4.ts(1,7): error TS2506: 'C2' is referenced directly or indirectly in its own base expression. +classExtendsItselfIndirectly_file4.ts(1,29): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. classExtendsItselfIndirectly_file5.ts(1,7): error TS2506: 'D2' is referenced directly or indirectly in its own base expression. +classExtendsItselfIndirectly_file5.ts(1,29): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. classExtendsItselfIndirectly_file6.ts(1,7): error TS2506: 'E2' is referenced directly or indirectly in its own base expression. +classExtendsItselfIndirectly_file6.ts(1,29): error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. -==== classExtendsItselfIndirectly_file1.ts (1 errors) ==== +==== classExtendsItselfIndirectly_file1.ts (2 errors) ==== class C extends E { foo: string; } // error ~ !!! error TS2506: 'C' is referenced directly or indirectly in its own base expression. + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. -==== classExtendsItselfIndirectly_file2.ts (1 errors) ==== +==== classExtendsItselfIndirectly_file2.ts (2 errors) ==== class D extends C { bar: string; } ~ !!! error TS2506: 'D' is referenced directly or indirectly in its own base expression. + ~~~ +!!! error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. -==== classExtendsItselfIndirectly_file3.ts (1 errors) ==== +==== classExtendsItselfIndirectly_file3.ts (2 errors) ==== class E extends D { baz: number; } ~ !!! error TS2506: 'E' is referenced directly or indirectly in its own base expression. + ~~~ +!!! error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. -==== classExtendsItselfIndirectly_file4.ts (1 errors) ==== +==== classExtendsItselfIndirectly_file4.ts (2 errors) ==== class C2 extends E2 { foo: T; } // error ~~ !!! error TS2506: 'C2' is referenced directly or indirectly in its own base expression. + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. -==== classExtendsItselfIndirectly_file5.ts (1 errors) ==== +==== classExtendsItselfIndirectly_file5.ts (2 errors) ==== class D2 extends C2 { bar: T; } ~~ !!! error TS2506: 'D2' is referenced directly or indirectly in its own base expression. + ~~~ +!!! error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. -==== classExtendsItselfIndirectly_file6.ts (1 errors) ==== +==== classExtendsItselfIndirectly_file6.ts (2 errors) ==== class E2 extends D2 { baz: T; } ~~ -!!! error TS2506: 'E2' is referenced directly or indirectly in its own base expression. \ No newline at end of file +!!! error TS2506: 'E2' is referenced directly or indirectly in its own base expression. + ~~~ +!!! error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsItselfIndirectly3.js b/tests/baselines/reference/classExtendsItselfIndirectly3.js index 8aa8c13876c1f..2612451fd4bca 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly3.js +++ b/tests/baselines/reference/classExtendsItselfIndirectly3.js @@ -19,20 +19,26 @@ class D2 extends C2 { bar: T; } class E2 extends D2 { baz: T; } //// [classExtendsItselfIndirectly_file1.js] +"use strict"; class C extends E { } // error //// [classExtendsItselfIndirectly_file2.js] +"use strict"; class D extends C { } //// [classExtendsItselfIndirectly_file3.js] +"use strict"; class E extends D { } //// [classExtendsItselfIndirectly_file4.js] +"use strict"; class C2 extends E2 { } // error //// [classExtendsItselfIndirectly_file5.js] +"use strict"; class D2 extends C2 { } //// [classExtendsItselfIndirectly_file6.js] +"use strict"; class E2 extends D2 { } diff --git a/tests/baselines/reference/classExtendsMultipleBaseClasses.js b/tests/baselines/reference/classExtendsMultipleBaseClasses.js index 4b730691b04f8..63278bf0f86dd 100644 --- a/tests/baselines/reference/classExtendsMultipleBaseClasses.js +++ b/tests/baselines/reference/classExtendsMultipleBaseClasses.js @@ -6,6 +6,7 @@ class B { } class C extends A,B { } //// [classExtendsMultipleBaseClasses.js] +"use strict"; class A { } class B { diff --git a/tests/baselines/reference/classExtendsNull.js b/tests/baselines/reference/classExtendsNull.js index a8aadcc93a725..e9f011af0bdaa 100644 --- a/tests/baselines/reference/classExtendsNull.js +++ b/tests/baselines/reference/classExtendsNull.js @@ -15,6 +15,7 @@ class D extends null { } //// [classExtendsNull.js] +"use strict"; class C extends null { constructor() { super(); diff --git a/tests/baselines/reference/classExtendsShadowedConstructorFunction.errors.txt b/tests/baselines/reference/classExtendsShadowedConstructorFunction.errors.txt index 06acb6aa99e50..d53a2eff99a02 100644 --- a/tests/baselines/reference/classExtendsShadowedConstructorFunction.errors.txt +++ b/tests/baselines/reference/classExtendsShadowedConstructorFunction.errors.txt @@ -1,8 +1,12 @@ +classExtendsShadowedConstructorFunction.ts(1,11): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. classExtendsShadowedConstructorFunction.ts(5,21): error TS2507: Type 'number' is not a constructor function type. +classExtendsShadowedConstructorFunction.ts(6,9): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. -==== classExtendsShadowedConstructorFunction.ts (1 errors) ==== +==== classExtendsShadowedConstructorFunction.ts (3 errors) ==== class C { foo: string; } + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. namespace M { var C = 1; @@ -10,5 +14,7 @@ classExtendsShadowedConstructorFunction.ts(5,21): error TS2507: Type 'number' is ~ !!! error TS2507: Type 'number' is not a constructor function type. bar: string; + ~~~ +!!! error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. } } \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsShadowedConstructorFunction.js b/tests/baselines/reference/classExtendsShadowedConstructorFunction.js index 4e2fcab8db060..1ed561c13de4b 100644 --- a/tests/baselines/reference/classExtendsShadowedConstructorFunction.js +++ b/tests/baselines/reference/classExtendsShadowedConstructorFunction.js @@ -11,6 +11,7 @@ namespace M { } //// [classExtendsShadowedConstructorFunction.js] +"use strict"; class C { } var M; diff --git a/tests/baselines/reference/classExtendsValidConstructorFunction.js b/tests/baselines/reference/classExtendsValidConstructorFunction.js index d149620bde6d0..4ad82dadc274e 100644 --- a/tests/baselines/reference/classExtendsValidConstructorFunction.js +++ b/tests/baselines/reference/classExtendsValidConstructorFunction.js @@ -8,6 +8,7 @@ var x = new foo(); // can be used as a constructor function class C extends foo { } // error, cannot extend it though //// [classExtendsValidConstructorFunction.js] +"use strict"; function foo() { } var x = new foo(); // can be used as a constructor function class C extends foo { diff --git a/tests/baselines/reference/classExtensionNameOutput.js b/tests/baselines/reference/classExtensionNameOutput.js index 5fac2701d3a3b..fc012196ce30b 100644 --- a/tests/baselines/reference/classExtensionNameOutput.js +++ b/tests/baselines/reference/classExtensionNameOutput.js @@ -11,6 +11,7 @@ if (true) { } //// [classExtensionNameOutput.js] +"use strict"; class A { } if (true) { diff --git a/tests/baselines/reference/classFieldSuperAccessible.js b/tests/baselines/reference/classFieldSuperAccessible.js index d7ba25a981dea..105a8f0dd917f 100644 --- a/tests/baselines/reference/classFieldSuperAccessible.js +++ b/tests/baselines/reference/classFieldSuperAccessible.js @@ -28,6 +28,7 @@ class E extends D { //// [classFieldSuperAccessible.js] +"use strict"; class A extends class Expr { } { static { diff --git a/tests/baselines/reference/classFieldSuperNotAccessible.js b/tests/baselines/reference/classFieldSuperNotAccessible.js index c8949774834e8..b05a052b861b1 100644 --- a/tests/baselines/reference/classFieldSuperNotAccessible.js +++ b/tests/baselines/reference/classFieldSuperNotAccessible.js @@ -14,6 +14,7 @@ new T2().f() //// [classFieldSuperNotAccessible.js] +"use strict"; class T { field = () => { }; } diff --git a/tests/baselines/reference/classFunctionMerging.js b/tests/baselines/reference/classFunctionMerging.js index e3fc9201b5212..74c7926d4f37f 100644 --- a/tests/baselines/reference/classFunctionMerging.js +++ b/tests/baselines/reference/classFunctionMerging.js @@ -15,5 +15,6 @@ const a = new Foo(""); const b = Foo(12); //// [classFunctionMerging.js] +"use strict"; const a = new Foo(""); const b = Foo(12); diff --git a/tests/baselines/reference/classFunctionMerging2.js b/tests/baselines/reference/classFunctionMerging2.js index b08d7e71cc628..4d2cd7ffc52cc 100644 --- a/tests/baselines/reference/classFunctionMerging2.js +++ b/tests/baselines/reference/classFunctionMerging2.js @@ -16,5 +16,6 @@ let b = new B("Hey") console.log(b.a) //// [classFunctionMerging2.js] +"use strict"; let b = new B("Hey"); console.log(b.a); diff --git a/tests/baselines/reference/classHeritageWithTrailingSeparator.errors.txt b/tests/baselines/reference/classHeritageWithTrailingSeparator.errors.txt index b24ee86d78c5f..5bc5e685720ae 100644 --- a/tests/baselines/reference/classHeritageWithTrailingSeparator.errors.txt +++ b/tests/baselines/reference/classHeritageWithTrailingSeparator.errors.txt @@ -1,8 +1,11 @@ +classHeritageWithTrailingSeparator.ts(1,11): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. classHeritageWithTrailingSeparator.ts(2,18): error TS1009: Trailing comma not allowed. -==== classHeritageWithTrailingSeparator.ts (1 errors) ==== +==== classHeritageWithTrailingSeparator.ts (2 errors) ==== class C { foo: number } + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. class D extends C, { ~ !!! error TS1009: Trailing comma not allowed. diff --git a/tests/baselines/reference/classHeritageWithTrailingSeparator.js b/tests/baselines/reference/classHeritageWithTrailingSeparator.js index ff1b1f3917faa..b2151f7686bfd 100644 --- a/tests/baselines/reference/classHeritageWithTrailingSeparator.js +++ b/tests/baselines/reference/classHeritageWithTrailingSeparator.js @@ -6,6 +6,7 @@ class D extends C, { } //// [classHeritageWithTrailingSeparator.js] +"use strict"; class C { } class D extends C { diff --git a/tests/baselines/reference/classImplementingInterfaceIndexer.js b/tests/baselines/reference/classImplementingInterfaceIndexer.js index 94756bfd788c7..d9da19910535b 100644 --- a/tests/baselines/reference/classImplementingInterfaceIndexer.js +++ b/tests/baselines/reference/classImplementingInterfaceIndexer.js @@ -9,5 +9,6 @@ class A implements I { } //// [classImplementingInterfaceIndexer.js] +"use strict"; class A { } diff --git a/tests/baselines/reference/classImplementsClass1.js b/tests/baselines/reference/classImplementsClass1.js index a3b8cf3304898..8b78234b57cfb 100644 --- a/tests/baselines/reference/classImplementsClass1.js +++ b/tests/baselines/reference/classImplementsClass1.js @@ -5,6 +5,7 @@ class A { } class C implements A { } //// [classImplementsClass1.js] +"use strict"; class A { } class C { diff --git a/tests/baselines/reference/classImplementsClass2.js b/tests/baselines/reference/classImplementsClass2.js index 1d3e95b5041fa..7be573753abd7 100644 --- a/tests/baselines/reference/classImplementsClass2.js +++ b/tests/baselines/reference/classImplementsClass2.js @@ -16,6 +16,7 @@ c = c2; c2 = c; //// [classImplementsClass2.js] +"use strict"; class A { foo() { return 1; } } diff --git a/tests/baselines/reference/classImplementsClass3.errors.txt b/tests/baselines/reference/classImplementsClass3.errors.txt new file mode 100644 index 0000000000000..4e0acaa2339b4 --- /dev/null +++ b/tests/baselines/reference/classImplementsClass3.errors.txt @@ -0,0 +1,20 @@ +classImplementsClass3.ts(13,5): error TS2454: Variable 'c2' is used before being assigned. + + +==== classImplementsClass3.ts (1 errors) ==== + class A { foo(): number { return 1; } } + class C implements A { + foo() { + return 1; + } + } + + class C2 extends A {} + + // no errors + var c: C; + var c2: C2; + c = c2; + ~~ +!!! error TS2454: Variable 'c2' is used before being assigned. + c2 = c; \ No newline at end of file diff --git a/tests/baselines/reference/classImplementsClass3.js b/tests/baselines/reference/classImplementsClass3.js index 731cd24908281..78cdc247abe6d 100644 --- a/tests/baselines/reference/classImplementsClass3.js +++ b/tests/baselines/reference/classImplementsClass3.js @@ -17,6 +17,7 @@ c = c2; c2 = c; //// [classImplementsClass3.js] +"use strict"; class A { foo() { return 1; } } diff --git a/tests/baselines/reference/classImplementsClass4.js b/tests/baselines/reference/classImplementsClass4.js index 72d3604db88e3..0467a55435f27 100644 --- a/tests/baselines/reference/classImplementsClass4.js +++ b/tests/baselines/reference/classImplementsClass4.js @@ -19,6 +19,7 @@ c = c2; c2 = c; //// [classImplementsClass4.js] +"use strict"; class A { constructor() { this.x = 1; diff --git a/tests/baselines/reference/classImplementsClass5.js b/tests/baselines/reference/classImplementsClass5.js index 21502af85a45b..a944dd4441640 100644 --- a/tests/baselines/reference/classImplementsClass5.js +++ b/tests/baselines/reference/classImplementsClass5.js @@ -20,6 +20,7 @@ c = c2; c2 = c; //// [classImplementsClass5.js] +"use strict"; class A { constructor() { this.x = 1; diff --git a/tests/baselines/reference/classImplementsClass6.js b/tests/baselines/reference/classImplementsClass6.js index 09bd171a6c610..5d61e7a9de5fa 100644 --- a/tests/baselines/reference/classImplementsClass6.js +++ b/tests/baselines/reference/classImplementsClass6.js @@ -24,6 +24,7 @@ c.bar(); // error c2.bar(); // should error //// [classImplementsClass6.js] +"use strict"; class A { static bar() { return ""; diff --git a/tests/baselines/reference/classImplementsClass7.errors.txt b/tests/baselines/reference/classImplementsClass7.errors.txt index c78a8f7106bfd..f7464fc74106b 100644 --- a/tests/baselines/reference/classImplementsClass7.errors.txt +++ b/tests/baselines/reference/classImplementsClass7.errors.txt @@ -1,10 +1,13 @@ +classImplementsClass7.ts(2,13): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. classImplementsClass7.ts(5,7): error TS2720: Class 'B' incorrectly implements class 'A'. Did you mean to extend 'A' and inherit its members as a subclass? Property 'x' is missing in type 'B' but required in type 'A'. -==== classImplementsClass7.ts (1 errors) ==== +==== classImplementsClass7.ts (2 errors) ==== class A { private x: number; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. } class B implements A {} diff --git a/tests/baselines/reference/classImplementsClass7.js b/tests/baselines/reference/classImplementsClass7.js index 738c9a39db0bc..e0c7a08a5587f 100644 --- a/tests/baselines/reference/classImplementsClass7.js +++ b/tests/baselines/reference/classImplementsClass7.js @@ -9,6 +9,7 @@ class B implements A {} //// [classImplementsClass7.js] +"use strict"; class A { } class B { diff --git a/tests/baselines/reference/classImplementsImportedInterface.js b/tests/baselines/reference/classImplementsImportedInterface.js index 5101481e359f2..2c6925206e95c 100644 --- a/tests/baselines/reference/classImplementsImportedInterface.js +++ b/tests/baselines/reference/classImplementsImportedInterface.js @@ -15,6 +15,7 @@ namespace M2 { } //// [classImplementsImportedInterface.js] +"use strict"; var M2; (function (M2) { class C { diff --git a/tests/baselines/reference/classImplementsMergedClassInterface.errors.txt b/tests/baselines/reference/classImplementsMergedClassInterface.errors.txt index 43df1a6e84362..31adf6ce32e46 100644 --- a/tests/baselines/reference/classImplementsMergedClassInterface.errors.txt +++ b/tests/baselines/reference/classImplementsMergedClassInterface.errors.txt @@ -2,11 +2,15 @@ classImplementsMergedClassInterface.ts(9,7): error TS2720: Class 'C2' incorrectl Type 'C2' is missing the following properties from type 'C1': x, y classImplementsMergedClassInterface.ts(12,7): error TS2720: Class 'C3' incorrectly implements class 'C1'. Did you mean to extend 'C1' and inherit its members as a subclass? Property 'y' is missing in type 'C3' but required in type 'C1'. +classImplementsMergedClassInterface.ts(13,5): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. classImplementsMergedClassInterface.ts(16,7): error TS2720: Class 'C4' incorrectly implements class 'C1'. Did you mean to extend 'C1' and inherit its members as a subclass? Property 'x' is missing in type 'C4' but required in type 'C1'. +classImplementsMergedClassInterface.ts(17,5): error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. +classImplementsMergedClassInterface.ts(21,5): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. +classImplementsMergedClassInterface.ts(22,5): error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. -==== classImplementsMergedClassInterface.ts (3 errors) ==== +==== classImplementsMergedClassInterface.ts (7 errors) ==== declare class C1 { x : number; } @@ -27,6 +31,8 @@ classImplementsMergedClassInterface.ts(16,7): error TS2720: Class 'C4' incorrect !!! error TS2720: Property 'y' is missing in type 'C3' but required in type 'C1'. !!! related TS2728 classImplementsMergedClassInterface.ts:6:5: 'y' is declared here. x : number; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. } class C4 implements C1 { // error -- missing x @@ -35,9 +41,15 @@ classImplementsMergedClassInterface.ts(16,7): error TS2720: Class 'C4' incorrect !!! error TS2720: Property 'x' is missing in type 'C4' but required in type 'C1'. !!! related TS2728 classImplementsMergedClassInterface.ts:2:5: 'x' is declared here. y : number; + ~ +!!! error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. } class C5 implements C1 { // okay x : number; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. y : number; + ~ +!!! error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. } \ No newline at end of file diff --git a/tests/baselines/reference/classImplementsMergedClassInterface.js b/tests/baselines/reference/classImplementsMergedClassInterface.js index 02a226cc3c7ee..6b0f5254fb694 100644 --- a/tests/baselines/reference/classImplementsMergedClassInterface.js +++ b/tests/baselines/reference/classImplementsMergedClassInterface.js @@ -26,6 +26,7 @@ class C5 implements C1 { // okay } //// [classImplementsMergedClassInterface.js] +"use strict"; class C2 { } class C3 { diff --git a/tests/baselines/reference/classImplementsPrimitive.js b/tests/baselines/reference/classImplementsPrimitive.js index ce6e66a4a0252..33b4a93319c1d 100644 --- a/tests/baselines/reference/classImplementsPrimitive.js +++ b/tests/baselines/reference/classImplementsPrimitive.js @@ -17,6 +17,7 @@ const C9 = class C implements boolean { } //// [classImplementsPrimitive.js] +"use strict"; // classes cannot implement primitives class C { } diff --git a/tests/baselines/reference/classInConvertedLoopES5(target=es2015).js b/tests/baselines/reference/classInConvertedLoopES5(target=es2015).js index eecf7fe99422a..36dfd4f64c503 100644 --- a/tests/baselines/reference/classInConvertedLoopES5(target=es2015).js +++ b/tests/baselines/reference/classInConvertedLoopES5(target=es2015).js @@ -12,6 +12,7 @@ for (const row of ['1', '2', '3', '4', '5']) { } //// [classInConvertedLoopES5.js] +"use strict"; const classesByRow = {}; for (const row of ['1', '2', '3', '4', '5']) { class RowClass { diff --git a/tests/baselines/reference/classInConvertedLoopES5(target=es5).js b/tests/baselines/reference/classInConvertedLoopES5(target=es5).js index 60698bd23bd78..d96fd3f60951d 100644 --- a/tests/baselines/reference/classInConvertedLoopES5(target=es5).js +++ b/tests/baselines/reference/classInConvertedLoopES5(target=es5).js @@ -12,6 +12,7 @@ for (const row of ['1', '2', '3', '4', '5']) { } //// [classInConvertedLoopES5.js] +"use strict"; var classesByRow = {}; var _loop_1 = function (row) { var RowClass = /** @class */ (function () { diff --git a/tests/baselines/reference/classIndexer.js b/tests/baselines/reference/classIndexer.js index 5c88d1640f871..5c8eaab17d4c0 100644 --- a/tests/baselines/reference/classIndexer.js +++ b/tests/baselines/reference/classIndexer.js @@ -8,6 +8,7 @@ class C123 { } //// [classIndexer.js] +"use strict"; class C123 { constructor() { } diff --git a/tests/baselines/reference/classIndexer2.errors.txt b/tests/baselines/reference/classIndexer2.errors.txt index 0b55ab760897a..76337c9024871 100644 --- a/tests/baselines/reference/classIndexer2.errors.txt +++ b/tests/baselines/reference/classIndexer2.errors.txt @@ -1,13 +1,19 @@ +classIndexer2.ts(3,5): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. classIndexer2.ts(4,5): error TS2411: Property 'y' of type 'string' is not assignable to 'string' index type 'number'. +classIndexer2.ts(4,5): error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. -==== classIndexer2.ts (1 errors) ==== +==== classIndexer2.ts (3 errors) ==== class C123 { [s: string]: number; x: number; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. y: string; ~ !!! error TS2411: Property 'y' of type 'string' is not assignable to 'string' index type 'number'. + ~ +!!! error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. constructor() { } } \ No newline at end of file diff --git a/tests/baselines/reference/classIndexer2.js b/tests/baselines/reference/classIndexer2.js index d28e4e95504b9..89c9d91cbd517 100644 --- a/tests/baselines/reference/classIndexer2.js +++ b/tests/baselines/reference/classIndexer2.js @@ -10,6 +10,7 @@ class C123 { } //// [classIndexer2.js] +"use strict"; class C123 { constructor() { } diff --git a/tests/baselines/reference/classIndexer3.errors.txt b/tests/baselines/reference/classIndexer3.errors.txt index 16a17925a77ad..5daf371ea7c6e 100644 --- a/tests/baselines/reference/classIndexer3.errors.txt +++ b/tests/baselines/reference/classIndexer3.errors.txt @@ -1,7 +1,9 @@ +classIndexer3.ts(8,5): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. classIndexer3.ts(9,5): error TS2411: Property 'y' of type 'string' is not assignable to 'string' index type 'number'. +classIndexer3.ts(9,5): error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. -==== classIndexer3.ts (1 errors) ==== +==== classIndexer3.ts (3 errors) ==== class C123 { [s: string]: number; constructor() { @@ -10,7 +12,11 @@ classIndexer3.ts(9,5): error TS2411: Property 'y' of type 'string' is not assign class D123 extends C123 { x: number; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. y: string; ~ !!! error TS2411: Property 'y' of type 'string' is not assignable to 'string' index type 'number'. + ~ +!!! error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. } \ No newline at end of file diff --git a/tests/baselines/reference/classIndexer3.js b/tests/baselines/reference/classIndexer3.js index ea3e2528f24b3..72efcef1bef57 100644 --- a/tests/baselines/reference/classIndexer3.js +++ b/tests/baselines/reference/classIndexer3.js @@ -13,6 +13,7 @@ class D123 extends C123 { } //// [classIndexer3.js] +"use strict"; class C123 { constructor() { } diff --git a/tests/baselines/reference/classIndexer4.js b/tests/baselines/reference/classIndexer4.js index a7751cb40ced5..74629b1e52cbb 100644 --- a/tests/baselines/reference/classIndexer4.js +++ b/tests/baselines/reference/classIndexer4.js @@ -13,6 +13,7 @@ interface D123 extends C123 { } //// [classIndexer4.js] +"use strict"; class C123 { constructor() { } diff --git a/tests/baselines/reference/classIndexer5.errors.txt b/tests/baselines/reference/classIndexer5.errors.txt new file mode 100644 index 0000000000000..387bd166b05fc --- /dev/null +++ b/tests/baselines/reference/classIndexer5.errors.txt @@ -0,0 +1,13 @@ +classIndexer5.ts(4,5): error TS2564: Property '#a' has no initializer and is not definitely assigned in the constructor. + + +==== classIndexer5.ts (1 errors) ==== + class Foo { + [key: string]: number; + + #a: boolean; + ~~ +!!! error TS2564: Property '#a' has no initializer and is not definitely assigned in the constructor. + #b = false; + } + \ No newline at end of file diff --git a/tests/baselines/reference/classIndexer5.js b/tests/baselines/reference/classIndexer5.js index d6a44b4645cb5..94b8abedea4bc 100644 --- a/tests/baselines/reference/classIndexer5.js +++ b/tests/baselines/reference/classIndexer5.js @@ -10,6 +10,7 @@ class Foo { //// [classIndexer5.js] +"use strict"; class Foo { #a; #b = false; diff --git a/tests/baselines/reference/classInheritence.js b/tests/baselines/reference/classInheritence.js index 37b8088e6902a..da1c7b68c8836 100644 --- a/tests/baselines/reference/classInheritence.js +++ b/tests/baselines/reference/classInheritence.js @@ -5,6 +5,7 @@ class B extends A { } class A extends A { } //// [classInheritence.js] +"use strict"; class B extends A { } class A extends A { diff --git a/tests/baselines/reference/classInsideBlock.js b/tests/baselines/reference/classInsideBlock.js index bb33fbdd556bc..42c3e119b41c2 100644 --- a/tests/baselines/reference/classInsideBlock.js +++ b/tests/baselines/reference/classInsideBlock.js @@ -6,6 +6,7 @@ function foo() { } //// [classInsideBlock.js] +"use strict"; function foo() { class C { } diff --git a/tests/baselines/reference/classIsSubtypeOfBaseType.errors.txt b/tests/baselines/reference/classIsSubtypeOfBaseType.errors.txt index 88beeced8d584..c7f284f669d63 100644 --- a/tests/baselines/reference/classIsSubtypeOfBaseType.errors.txt +++ b/tests/baselines/reference/classIsSubtypeOfBaseType.errors.txt @@ -1,15 +1,24 @@ +classIsSubtypeOfBaseType.ts(2,5): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. +classIsSubtypeOfBaseType.ts(6,5): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. classIsSubtypeOfBaseType.ts(12,5): error TS2416: Property 'foo' in type 'Derived2' is not assignable to the same property in base type 'Base<{ bar: string; }>'. - Type '{ bar?: string; }' is not assignable to type '{ bar: string; }'. - Property 'bar' is optional in type '{ bar?: string; }' but required in type '{ bar: string; }'. + Type '{ bar?: string | undefined; }' is not assignable to type '{ bar: string; }'. + Types of property 'bar' are incompatible. + Type 'string | undefined' is not assignable to type 'string'. + Type 'undefined' is not assignable to type 'string'. +classIsSubtypeOfBaseType.ts(12,5): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. -==== classIsSubtypeOfBaseType.ts (1 errors) ==== +==== classIsSubtypeOfBaseType.ts (4 errors) ==== class Base { foo: T; + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. } class Derived extends Base<{ bar: string; }> { foo: { + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. bar: string; baz: number; // ok } } @@ -18,8 +27,12 @@ classIsSubtypeOfBaseType.ts(12,5): error TS2416: Property 'foo' in type 'Derived foo: { ~~~ !!! error TS2416: Property 'foo' in type 'Derived2' is not assignable to the same property in base type 'Base<{ bar: string; }>'. -!!! error TS2416: Type '{ bar?: string; }' is not assignable to type '{ bar: string; }'. -!!! error TS2416: Property 'bar' is optional in type '{ bar?: string; }' but required in type '{ bar: string; }'. +!!! error TS2416: Type '{ bar?: string | undefined; }' is not assignable to type '{ bar: string; }'. +!!! error TS2416: Types of property 'bar' are incompatible. +!!! error TS2416: Type 'string | undefined' is not assignable to type 'string'. +!!! error TS2416: Type 'undefined' is not assignable to type 'string'. + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. bar?: string; // error } } \ No newline at end of file diff --git a/tests/baselines/reference/classIsSubtypeOfBaseType.js b/tests/baselines/reference/classIsSubtypeOfBaseType.js index 6176f3080a361..5bfaadedd96c6 100644 --- a/tests/baselines/reference/classIsSubtypeOfBaseType.js +++ b/tests/baselines/reference/classIsSubtypeOfBaseType.js @@ -18,6 +18,7 @@ class Derived2 extends Base<{ bar: string; }> { } //// [classIsSubtypeOfBaseType.js] +"use strict"; class Base { } class Derived extends Base { diff --git a/tests/baselines/reference/classIsSubtypeOfBaseType.types b/tests/baselines/reference/classIsSubtypeOfBaseType.types index e4aa7529578b7..b3d9ce730761e 100644 --- a/tests/baselines/reference/classIsSubtypeOfBaseType.types +++ b/tests/baselines/reference/classIsSubtypeOfBaseType.types @@ -43,7 +43,7 @@ class Derived2 extends Base<{ bar: string; }> { > : ^^^^^^^^ ^^^ bar?: string; // error ->bar : string -> : ^^^^^^ +>bar : string | undefined +> : ^^^^^^^^^^^^^^^^^^ } } diff --git a/tests/baselines/reference/classMemberInitializerScoping.js b/tests/baselines/reference/classMemberInitializerScoping.js index 0e3bc1a3a7e62..5908cdd30db55 100644 --- a/tests/baselines/reference/classMemberInitializerScoping.js +++ b/tests/baselines/reference/classMemberInitializerScoping.js @@ -23,6 +23,7 @@ class CCCC { //// [classMemberInitializerScoping.js] +"use strict"; var aaa = 1; class CCC { constructor(aaa) { diff --git a/tests/baselines/reference/classMemberInitializerScoping2(target=es2017,usedefineforclassfields=false).js b/tests/baselines/reference/classMemberInitializerScoping2(target=es2017,usedefineforclassfields=false).js index d7d6fa74d245f..3be6e16b88828 100644 --- a/tests/baselines/reference/classMemberInitializerScoping2(target=es2017,usedefineforclassfields=false).js +++ b/tests/baselines/reference/classMemberInitializerScoping2(target=es2017,usedefineforclassfields=false).js @@ -9,6 +9,7 @@ class C { //// [classMemberInitializerScoping2.js] +"use strict"; const x = 1; class C { constructor(x) { diff --git a/tests/baselines/reference/classMemberInitializerScoping2(target=es2017,usedefineforclassfields=true).js b/tests/baselines/reference/classMemberInitializerScoping2(target=es2017,usedefineforclassfields=true).js index 51bb95cc754aa..9c93734ee5c3a 100644 --- a/tests/baselines/reference/classMemberInitializerScoping2(target=es2017,usedefineforclassfields=true).js +++ b/tests/baselines/reference/classMemberInitializerScoping2(target=es2017,usedefineforclassfields=true).js @@ -9,6 +9,7 @@ class C { //// [classMemberInitializerScoping2.js] +"use strict"; const x = 1; class C { constructor(x) { diff --git a/tests/baselines/reference/classMemberInitializerScoping2(target=esnext,usedefineforclassfields=false).js b/tests/baselines/reference/classMemberInitializerScoping2(target=esnext,usedefineforclassfields=false).js index d7d6fa74d245f..3be6e16b88828 100644 --- a/tests/baselines/reference/classMemberInitializerScoping2(target=esnext,usedefineforclassfields=false).js +++ b/tests/baselines/reference/classMemberInitializerScoping2(target=esnext,usedefineforclassfields=false).js @@ -9,6 +9,7 @@ class C { //// [classMemberInitializerScoping2.js] +"use strict"; const x = 1; class C { constructor(x) { diff --git a/tests/baselines/reference/classMemberInitializerScoping2(target=esnext,usedefineforclassfields=true).js b/tests/baselines/reference/classMemberInitializerScoping2(target=esnext,usedefineforclassfields=true).js index fdd412eb0cf5b..f0f58049f7dc0 100644 --- a/tests/baselines/reference/classMemberInitializerScoping2(target=esnext,usedefineforclassfields=true).js +++ b/tests/baselines/reference/classMemberInitializerScoping2(target=esnext,usedefineforclassfields=true).js @@ -9,6 +9,7 @@ class C { //// [classMemberInitializerScoping2.js] +"use strict"; const x = 1; class C { p = x; diff --git a/tests/baselines/reference/classMemberInitializerWithLamdaScoping.js b/tests/baselines/reference/classMemberInitializerWithLamdaScoping.js index d6807aa19a6f0..41cdeb654200f 100644 --- a/tests/baselines/reference/classMemberInitializerWithLamdaScoping.js +++ b/tests/baselines/reference/classMemberInitializerWithLamdaScoping.js @@ -33,6 +33,7 @@ class Test1 { } //// [classMemberInitializerWithLamdaScoping.js] +"use strict"; class Test { constructor(field) { this.field = field; diff --git a/tests/baselines/reference/classMemberInitializerWithLamdaScoping2.js b/tests/baselines/reference/classMemberInitializerWithLamdaScoping2.js index 543cfc5dd7cf9..3fcbb99c41b50 100644 --- a/tests/baselines/reference/classMemberInitializerWithLamdaScoping2.js +++ b/tests/baselines/reference/classMemberInitializerWithLamdaScoping2.js @@ -18,8 +18,10 @@ class Test1 { } //// [classMemberInitializerWithLamdaScoping2_0.js] +"use strict"; var field1; //// [classMemberInitializerWithLamdaScoping2_1.js] +"use strict"; class Test1 { constructor(field1) { this.field1 = field1; diff --git a/tests/baselines/reference/classMemberInitializerWithLamdaScoping3.js b/tests/baselines/reference/classMemberInitializerWithLamdaScoping3.js index 9282989012fc9..f00325fadbece 100644 --- a/tests/baselines/reference/classMemberInitializerWithLamdaScoping3.js +++ b/tests/baselines/reference/classMemberInitializerWithLamdaScoping3.js @@ -18,6 +18,7 @@ export class Test1 { } //// [classMemberInitializerWithLamdaScoping3_0.js] +"use strict"; var field1; //// [classMemberInitializerWithLamdaScoping3_1.js] export class Test1 { diff --git a/tests/baselines/reference/classMemberInitializerWithLamdaScoping5.js b/tests/baselines/reference/classMemberInitializerWithLamdaScoping5.js index 3b77f33be02cf..ea44a39c2c0e1 100644 --- a/tests/baselines/reference/classMemberInitializerWithLamdaScoping5.js +++ b/tests/baselines/reference/classMemberInitializerWithLamdaScoping5.js @@ -14,6 +14,7 @@ class Greeter { } //// [classMemberInitializerWithLamdaScoping5.js] +"use strict"; class Greeter { constructor(message) { this.messageHandler = (message) => { diff --git a/tests/baselines/reference/classMemberWithMissingIdentifier.js b/tests/baselines/reference/classMemberWithMissingIdentifier.js index 9ff702e38bd1b..155aca5765a8d 100644 --- a/tests/baselines/reference/classMemberWithMissingIdentifier.js +++ b/tests/baselines/reference/classMemberWithMissingIdentifier.js @@ -6,6 +6,7 @@ class C { } //// [classMemberWithMissingIdentifier.js] +"use strict"; class C { } { } diff --git a/tests/baselines/reference/classMemberWithMissingIdentifier2.js b/tests/baselines/reference/classMemberWithMissingIdentifier2.js index f49a14b87d640..d4f2e32e5dbfb 100644 --- a/tests/baselines/reference/classMemberWithMissingIdentifier2.js +++ b/tests/baselines/reference/classMemberWithMissingIdentifier2.js @@ -6,6 +6,7 @@ class C { } //// [classMemberWithMissingIdentifier2.js] +"use strict"; class C { } { diff --git a/tests/baselines/reference/classMethodWithKeywordName1.js b/tests/baselines/reference/classMethodWithKeywordName1.js index f7887561a329e..dcbc9ab55e852 100644 --- a/tests/baselines/reference/classMethodWithKeywordName1.js +++ b/tests/baselines/reference/classMethodWithKeywordName1.js @@ -6,6 +6,7 @@ class C { } //// [classMethodWithKeywordName1.js] +"use strict"; class C { static try() { } } diff --git a/tests/baselines/reference/classNameReferencesInStaticElements.js b/tests/baselines/reference/classNameReferencesInStaticElements.js index b6dbd4bda14b5..caed1032bbe1c 100644 --- a/tests/baselines/reference/classNameReferencesInStaticElements.js +++ b/tests/baselines/reference/classNameReferencesInStaticElements.js @@ -18,6 +18,7 @@ oldFoo.y(); new oldFoo().x(); //// [classNameReferencesInStaticElements.js] +"use strict"; var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); diff --git a/tests/baselines/reference/classOrder1.js b/tests/baselines/reference/classOrder1.js index 3e4a161b0873e..c016d3300e54f 100644 --- a/tests/baselines/reference/classOrder1.js +++ b/tests/baselines/reference/classOrder1.js @@ -14,6 +14,7 @@ a.foo(); //// [classOrder1.js] +"use strict"; class A { foo() { /*WScript.Echo("Here!");*/ diff --git a/tests/baselines/reference/classOrder2.js b/tests/baselines/reference/classOrder2.js index b2d206d79c575..818f6dd6e6e13 100644 --- a/tests/baselines/reference/classOrder2.js +++ b/tests/baselines/reference/classOrder2.js @@ -21,6 +21,7 @@ a.foo(); //// [classOrder2.js] +"use strict"; class A extends B { foo() { this.bar(); } } diff --git a/tests/baselines/reference/classOrderBug.js b/tests/baselines/reference/classOrderBug.js index 643fb2f841f24..0a2b44daf0e34 100644 --- a/tests/baselines/reference/classOrderBug.js +++ b/tests/baselines/reference/classOrderBug.js @@ -18,6 +18,7 @@ class foo extends baz {} //// [classOrderBug.js] +"use strict"; class bar { constructor() { this.baz = new foo(); diff --git a/tests/baselines/reference/classOverloadForFunction.js b/tests/baselines/reference/classOverloadForFunction.js index 4548279bd5864..8bb635149e745 100644 --- a/tests/baselines/reference/classOverloadForFunction.js +++ b/tests/baselines/reference/classOverloadForFunction.js @@ -6,6 +6,7 @@ function foo() {} //// [classOverloadForFunction.js] +"use strict"; class foo { } ; diff --git a/tests/baselines/reference/classOverloadForFunction2.js b/tests/baselines/reference/classOverloadForFunction2.js index a8664926d06f0..f73d357f53cec 100644 --- a/tests/baselines/reference/classOverloadForFunction2.js +++ b/tests/baselines/reference/classOverloadForFunction2.js @@ -5,5 +5,6 @@ function bar(): string; class bar {} //// [classOverloadForFunction2.js] +"use strict"; class bar { } diff --git a/tests/baselines/reference/classPropertyAsPrivate.js b/tests/baselines/reference/classPropertyAsPrivate.js index 76b289933a97c..fcd0782a15cb5 100644 --- a/tests/baselines/reference/classPropertyAsPrivate.js +++ b/tests/baselines/reference/classPropertyAsPrivate.js @@ -26,6 +26,7 @@ C.b = 1; C.foo(); //// [classPropertyAsPrivate.js] +"use strict"; class C { get y() { return null; } set y(x) { } diff --git a/tests/baselines/reference/classPropertyAsProtected.js b/tests/baselines/reference/classPropertyAsProtected.js index 1fecf3b2383fe..4a00b4af6c4ef 100644 --- a/tests/baselines/reference/classPropertyAsProtected.js +++ b/tests/baselines/reference/classPropertyAsProtected.js @@ -26,6 +26,7 @@ C.b = 1; C.foo(); //// [classPropertyAsProtected.js] +"use strict"; class C { get y() { return null; } set y(x) { } diff --git a/tests/baselines/reference/classPropertyIsPublicByDefault.js b/tests/baselines/reference/classPropertyIsPublicByDefault.js index 01d98ef426754..f384cb4133472 100644 --- a/tests/baselines/reference/classPropertyIsPublicByDefault.js +++ b/tests/baselines/reference/classPropertyIsPublicByDefault.js @@ -25,6 +25,7 @@ C.b = 1; C.foo(); //// [classPropertyIsPublicByDefault.js] +"use strict"; class C { get y() { return null; } set y(x) { } diff --git a/tests/baselines/reference/classSideInheritance1.js b/tests/baselines/reference/classSideInheritance1.js index a4a3a349a4f5c..c4689ab140d30 100644 --- a/tests/baselines/reference/classSideInheritance1.js +++ b/tests/baselines/reference/classSideInheritance1.js @@ -18,6 +18,7 @@ A.bar(); // valid C2.bar(); // valid //// [classSideInheritance1.js] +"use strict"; class A { static bar() { return ""; diff --git a/tests/baselines/reference/classSideInheritance2.errors.txt b/tests/baselines/reference/classSideInheritance2.errors.txt index 9cea5bf3938c1..ee389079c68e3 100644 --- a/tests/baselines/reference/classSideInheritance2.errors.txt +++ b/tests/baselines/reference/classSideInheritance2.errors.txt @@ -1,7 +1,8 @@ classSideInheritance2.ts(7,23): error TS2449: Class 'TextBase' used before its declaration. +classSideInheritance2.ts(15,16): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. -==== classSideInheritance2.ts (1 errors) ==== +==== classSideInheritance2.ts (2 errors) ==== interface IText { foo: number; } @@ -20,6 +21,8 @@ classSideInheritance2.ts(7,23): error TS2449: Class 'TextBase' used before its d class TextBase implements IText { public foo: number; + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. public subText(span: TextSpan): IText { return new SubText(this, span); diff --git a/tests/baselines/reference/classSideInheritance2.js b/tests/baselines/reference/classSideInheritance2.js index 0d3618e4aef0b..5baa206e058bf 100644 --- a/tests/baselines/reference/classSideInheritance2.js +++ b/tests/baselines/reference/classSideInheritance2.js @@ -23,6 +23,7 @@ class TextBase implements IText { } //// [classSideInheritance2.js] +"use strict"; class SubText extends TextBase { constructor(text, span) { super(); diff --git a/tests/baselines/reference/classSideInheritance3.js b/tests/baselines/reference/classSideInheritance3.js index 9d5f15c1f3832..4a1f0b2dcf584 100644 --- a/tests/baselines/reference/classSideInheritance3.js +++ b/tests/baselines/reference/classSideInheritance3.js @@ -21,6 +21,7 @@ var r2: new (x: string) => A = B; // error var r3: typeof A = C; // ok //// [classSideInheritance3.js] +"use strict"; class A { constructor(x) { this.x = x; diff --git a/tests/baselines/reference/classStaticBlock1(target=es2015).js b/tests/baselines/reference/classStaticBlock1(target=es2015).js index 8d00576d5d586..ff5e0c837aea1 100644 --- a/tests/baselines/reference/classStaticBlock1(target=es2015).js +++ b/tests/baselines/reference/classStaticBlock1(target=es2015).js @@ -13,6 +13,7 @@ class C { //// [classStaticBlock1.js] +"use strict"; const a = 2; class C { } diff --git a/tests/baselines/reference/classStaticBlock1(target=es2022).js b/tests/baselines/reference/classStaticBlock1(target=es2022).js index a98762a0ad0e2..b27042073d29b 100644 --- a/tests/baselines/reference/classStaticBlock1(target=es2022).js +++ b/tests/baselines/reference/classStaticBlock1(target=es2022).js @@ -13,6 +13,7 @@ class C { //// [classStaticBlock1.js] +"use strict"; const a = 2; class C { static { diff --git a/tests/baselines/reference/classStaticBlock1(target=es5).js b/tests/baselines/reference/classStaticBlock1(target=es5).js index 952d584bb907c..d7e4e7243662e 100644 --- a/tests/baselines/reference/classStaticBlock1(target=es5).js +++ b/tests/baselines/reference/classStaticBlock1(target=es5).js @@ -13,6 +13,7 @@ class C { //// [classStaticBlock1.js] +"use strict"; var a = 2; var C = /** @class */ (function () { function C() { diff --git a/tests/baselines/reference/classStaticBlock1(target=esnext).js b/tests/baselines/reference/classStaticBlock1(target=esnext).js index a98762a0ad0e2..b27042073d29b 100644 --- a/tests/baselines/reference/classStaticBlock1(target=esnext).js +++ b/tests/baselines/reference/classStaticBlock1(target=esnext).js @@ -13,6 +13,7 @@ class C { //// [classStaticBlock1.js] +"use strict"; const a = 2; class C { static { diff --git a/tests/baselines/reference/classStaticBlock10(target=es2015).js b/tests/baselines/reference/classStaticBlock10(target=es2015).js index 5ec314d672ffd..5ceb042f7a2a2 100644 --- a/tests/baselines/reference/classStaticBlock10(target=es2015).js +++ b/tests/baselines/reference/classStaticBlock10(target=es2015).js @@ -31,6 +31,7 @@ class C2 { //// [classStaticBlock10.js] +"use strict"; var a1 = 1; var a2 = 1; const b1 = 2; diff --git a/tests/baselines/reference/classStaticBlock10(target=es2022).js b/tests/baselines/reference/classStaticBlock10(target=es2022).js index 9c8190f35469e..47bb453b238cb 100644 --- a/tests/baselines/reference/classStaticBlock10(target=es2022).js +++ b/tests/baselines/reference/classStaticBlock10(target=es2022).js @@ -31,6 +31,7 @@ class C2 { //// [classStaticBlock10.js] +"use strict"; var a1 = 1; var a2 = 1; const b1 = 2; diff --git a/tests/baselines/reference/classStaticBlock10(target=es5).js b/tests/baselines/reference/classStaticBlock10(target=es5).js index 8d4cd26a427ed..560de3e224486 100644 --- a/tests/baselines/reference/classStaticBlock10(target=es5).js +++ b/tests/baselines/reference/classStaticBlock10(target=es5).js @@ -31,6 +31,7 @@ class C2 { //// [classStaticBlock10.js] +"use strict"; var a1 = 1; var a2 = 1; var b1 = 2; diff --git a/tests/baselines/reference/classStaticBlock10(target=esnext).js b/tests/baselines/reference/classStaticBlock10(target=esnext).js index 9c8190f35469e..47bb453b238cb 100644 --- a/tests/baselines/reference/classStaticBlock10(target=esnext).js +++ b/tests/baselines/reference/classStaticBlock10(target=esnext).js @@ -31,6 +31,7 @@ class C2 { //// [classStaticBlock10.js] +"use strict"; var a1 = 1; var a2 = 1; const b1 = 2; diff --git a/tests/baselines/reference/classStaticBlock11(target=es2015).js b/tests/baselines/reference/classStaticBlock11(target=es2015).js index faa693ae0d649..47c3f71affbfc 100644 --- a/tests/baselines/reference/classStaticBlock11(target=es2015).js +++ b/tests/baselines/reference/classStaticBlock11(target=es2015).js @@ -16,6 +16,7 @@ class C { //// [classStaticBlock11.js] +"use strict"; var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); diff --git a/tests/baselines/reference/classStaticBlock11(target=es2022).js b/tests/baselines/reference/classStaticBlock11(target=es2022).js index ebee5f8e5a146..c4ba0e039641b 100644 --- a/tests/baselines/reference/classStaticBlock11(target=es2022).js +++ b/tests/baselines/reference/classStaticBlock11(target=es2022).js @@ -16,6 +16,7 @@ class C { //// [classStaticBlock11.js] +"use strict"; let getX; class C { #x = 1; diff --git a/tests/baselines/reference/classStaticBlock11(target=esnext).js b/tests/baselines/reference/classStaticBlock11(target=esnext).js index ebee5f8e5a146..c4ba0e039641b 100644 --- a/tests/baselines/reference/classStaticBlock11(target=esnext).js +++ b/tests/baselines/reference/classStaticBlock11(target=esnext).js @@ -16,6 +16,7 @@ class C { //// [classStaticBlock11.js] +"use strict"; let getX; class C { #x = 1; diff --git a/tests/baselines/reference/classStaticBlock12.js b/tests/baselines/reference/classStaticBlock12.js index 9cba3a67235d4..22bf48a90daa3 100644 --- a/tests/baselines/reference/classStaticBlock12.js +++ b/tests/baselines/reference/classStaticBlock12.js @@ -11,6 +11,7 @@ class C { //// [classStaticBlock12.js] +"use strict"; var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); diff --git a/tests/baselines/reference/classStaticBlock13(target=es2015).js b/tests/baselines/reference/classStaticBlock13(target=es2015).js index f1a7dfe01795a..dd96e345f90b1 100644 --- a/tests/baselines/reference/classStaticBlock13(target=es2015).js +++ b/tests/baselines/reference/classStaticBlock13(target=es2015).js @@ -15,6 +15,7 @@ class C { //// [classStaticBlock13.js] +"use strict"; var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); diff --git a/tests/baselines/reference/classStaticBlock13(target=es2022).js b/tests/baselines/reference/classStaticBlock13(target=es2022).js index e88dc8c2fa89f..c3a702646d0df 100644 --- a/tests/baselines/reference/classStaticBlock13(target=es2022).js +++ b/tests/baselines/reference/classStaticBlock13(target=es2022).js @@ -15,6 +15,7 @@ class C { //// [classStaticBlock13.js] +"use strict"; class C { static #x = 123; static { diff --git a/tests/baselines/reference/classStaticBlock13(target=esnext).js b/tests/baselines/reference/classStaticBlock13(target=esnext).js index e88dc8c2fa89f..c3a702646d0df 100644 --- a/tests/baselines/reference/classStaticBlock13(target=esnext).js +++ b/tests/baselines/reference/classStaticBlock13(target=esnext).js @@ -15,6 +15,7 @@ class C { //// [classStaticBlock13.js] +"use strict"; class C { static #x = 123; static { diff --git a/tests/baselines/reference/classStaticBlock14.js b/tests/baselines/reference/classStaticBlock14.js index f40d2122850a1..9064ee0dd5250 100644 --- a/tests/baselines/reference/classStaticBlock14.js +++ b/tests/baselines/reference/classStaticBlock14.js @@ -16,6 +16,7 @@ class C { //// [classStaticBlock14.js] +"use strict"; var _a, _C__1, _C__3, _C__5; class C { } diff --git a/tests/baselines/reference/classStaticBlock15(target=es2015).js b/tests/baselines/reference/classStaticBlock15(target=es2015).js index 2ba53277d1461..5ae9cd6da172e 100644 --- a/tests/baselines/reference/classStaticBlock15(target=es2015).js +++ b/tests/baselines/reference/classStaticBlock15(target=es2015).js @@ -20,6 +20,7 @@ console.log(_C__1) //// [classStaticBlock15.js] +"use strict"; var _a, _C__1_1, _C__3, _C__5; var _C__1; class C { diff --git a/tests/baselines/reference/classStaticBlock15(target=es2015).types b/tests/baselines/reference/classStaticBlock15(target=es2015).types index 1ffb5ba7d2bff..cc993ec2e9b89 100644 --- a/tests/baselines/reference/classStaticBlock15(target=es2015).types +++ b/tests/baselines/reference/classStaticBlock15(target=es2015).types @@ -43,5 +43,6 @@ console.log(_C__1) > : ^^^^^^^ >log : (...data: any[]) => void > : ^^^^ ^^ ^^^^^ ->_C__1 : any +>_C__1 : undefined +> : ^^^^^^^^^ diff --git a/tests/baselines/reference/classStaticBlock15(target=es2022).js b/tests/baselines/reference/classStaticBlock15(target=es2022).js index 396df4718e75c..5fae60e518d5d 100644 --- a/tests/baselines/reference/classStaticBlock15(target=es2022).js +++ b/tests/baselines/reference/classStaticBlock15(target=es2022).js @@ -20,6 +20,7 @@ console.log(_C__1) //// [classStaticBlock15.js] +"use strict"; var _C__1; class C { static #_1 = 1; diff --git a/tests/baselines/reference/classStaticBlock15(target=es2022).types b/tests/baselines/reference/classStaticBlock15(target=es2022).types index 1ffb5ba7d2bff..cc993ec2e9b89 100644 --- a/tests/baselines/reference/classStaticBlock15(target=es2022).types +++ b/tests/baselines/reference/classStaticBlock15(target=es2022).types @@ -43,5 +43,6 @@ console.log(_C__1) > : ^^^^^^^ >log : (...data: any[]) => void > : ^^^^ ^^ ^^^^^ ->_C__1 : any +>_C__1 : undefined +> : ^^^^^^^^^ diff --git a/tests/baselines/reference/classStaticBlock15(target=esnext).js b/tests/baselines/reference/classStaticBlock15(target=esnext).js index 396df4718e75c..5fae60e518d5d 100644 --- a/tests/baselines/reference/classStaticBlock15(target=esnext).js +++ b/tests/baselines/reference/classStaticBlock15(target=esnext).js @@ -20,6 +20,7 @@ console.log(_C__1) //// [classStaticBlock15.js] +"use strict"; var _C__1; class C { static #_1 = 1; diff --git a/tests/baselines/reference/classStaticBlock15(target=esnext).types b/tests/baselines/reference/classStaticBlock15(target=esnext).types index 1ffb5ba7d2bff..cc993ec2e9b89 100644 --- a/tests/baselines/reference/classStaticBlock15(target=esnext).types +++ b/tests/baselines/reference/classStaticBlock15(target=esnext).types @@ -43,5 +43,6 @@ console.log(_C__1) > : ^^^^^^^ >log : (...data: any[]) => void > : ^^^^ ^^ ^^^^^ ->_C__1 : any +>_C__1 : undefined +> : ^^^^^^^^^ diff --git a/tests/baselines/reference/classStaticBlock16.js b/tests/baselines/reference/classStaticBlock16.js index 53bf038cac3d9..60a93faae55b5 100644 --- a/tests/baselines/reference/classStaticBlock16.js +++ b/tests/baselines/reference/classStaticBlock16.js @@ -27,6 +27,7 @@ class D { } //// [classStaticBlock16.js] +"use strict"; var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); diff --git a/tests/baselines/reference/classStaticBlock17.js b/tests/baselines/reference/classStaticBlock17.js index 0ea5608afd5f3..da4d165171480 100644 --- a/tests/baselines/reference/classStaticBlock17.js +++ b/tests/baselines/reference/classStaticBlock17.js @@ -34,6 +34,7 @@ const b = new B(a); a.getX(); //// [classStaticBlock17.js] +"use strict"; var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); diff --git a/tests/baselines/reference/classStaticBlock18(target=es2015).js b/tests/baselines/reference/classStaticBlock18(target=es2015).js index a594c733f7082..074a0f2ac49c4 100644 --- a/tests/baselines/reference/classStaticBlock18(target=es2015).js +++ b/tests/baselines/reference/classStaticBlock18(target=es2015).js @@ -17,6 +17,7 @@ function foo () { //// [classStaticBlock18.js] +"use strict"; var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) { if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); diff --git a/tests/baselines/reference/classStaticBlock18(target=es2022).js b/tests/baselines/reference/classStaticBlock18(target=es2022).js index 0bf043c30d8ac..806edddabb462 100644 --- a/tests/baselines/reference/classStaticBlock18(target=es2022).js +++ b/tests/baselines/reference/classStaticBlock18(target=es2022).js @@ -17,6 +17,7 @@ function foo () { //// [classStaticBlock18.js] +"use strict"; function foo() { return class { static foo = 1; diff --git a/tests/baselines/reference/classStaticBlock18(target=es5).js b/tests/baselines/reference/classStaticBlock18(target=es5).js index f9c310c90de12..a7c7cc7a28947 100644 --- a/tests/baselines/reference/classStaticBlock18(target=es5).js +++ b/tests/baselines/reference/classStaticBlock18(target=es5).js @@ -17,6 +17,7 @@ function foo () { //// [classStaticBlock18.js] +"use strict"; var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) { if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); diff --git a/tests/baselines/reference/classStaticBlock18(target=esnext).js b/tests/baselines/reference/classStaticBlock18(target=esnext).js index 0bf043c30d8ac..806edddabb462 100644 --- a/tests/baselines/reference/classStaticBlock18(target=esnext).js +++ b/tests/baselines/reference/classStaticBlock18(target=esnext).js @@ -17,6 +17,7 @@ function foo () { //// [classStaticBlock18.js] +"use strict"; function foo() { return class { static foo = 1; diff --git a/tests/baselines/reference/classStaticBlock19.js b/tests/baselines/reference/classStaticBlock19.js index ab1f5f3da62b8..510e193ae9e79 100644 --- a/tests/baselines/reference/classStaticBlock19.js +++ b/tests/baselines/reference/classStaticBlock19.js @@ -10,6 +10,7 @@ class C { //// [classStaticBlock19.js] +"use strict"; class C { } (() => { diff --git a/tests/baselines/reference/classStaticBlock2(target=es2015).js b/tests/baselines/reference/classStaticBlock2(target=es2015).js index 121818952873f..cddfa96f88f27 100644 --- a/tests/baselines/reference/classStaticBlock2(target=es2015).js +++ b/tests/baselines/reference/classStaticBlock2(target=es2015).js @@ -22,6 +22,7 @@ class C { //// [classStaticBlock2.js] +"use strict"; const a = 1; const b = 2; class C { diff --git a/tests/baselines/reference/classStaticBlock2(target=es2022).js b/tests/baselines/reference/classStaticBlock2(target=es2022).js index bda6e6dc7512c..5bb0698bce7ad 100644 --- a/tests/baselines/reference/classStaticBlock2(target=es2022).js +++ b/tests/baselines/reference/classStaticBlock2(target=es2022).js @@ -22,6 +22,7 @@ class C { //// [classStaticBlock2.js] +"use strict"; const a = 1; const b = 2; class C { diff --git a/tests/baselines/reference/classStaticBlock2(target=es5).js b/tests/baselines/reference/classStaticBlock2(target=es5).js index 815b3c0a010ed..a59fa40ca4d36 100644 --- a/tests/baselines/reference/classStaticBlock2(target=es5).js +++ b/tests/baselines/reference/classStaticBlock2(target=es5).js @@ -22,6 +22,7 @@ class C { //// [classStaticBlock2.js] +"use strict"; var a = 1; var b = 2; var C = /** @class */ (function () { diff --git a/tests/baselines/reference/classStaticBlock2(target=esnext).js b/tests/baselines/reference/classStaticBlock2(target=esnext).js index bda6e6dc7512c..5bb0698bce7ad 100644 --- a/tests/baselines/reference/classStaticBlock2(target=esnext).js +++ b/tests/baselines/reference/classStaticBlock2(target=esnext).js @@ -22,6 +22,7 @@ class C { //// [classStaticBlock2.js] +"use strict"; const a = 1; const b = 2; class C { diff --git a/tests/baselines/reference/classStaticBlock20.js b/tests/baselines/reference/classStaticBlock20.js index 8653fc43e3b4a..0fd4753ec4259 100644 --- a/tests/baselines/reference/classStaticBlock20.js +++ b/tests/baselines/reference/classStaticBlock20.js @@ -17,6 +17,7 @@ class C { //// [classStaticBlock20.js] +"use strict"; class C { } (() => { diff --git a/tests/baselines/reference/classStaticBlock21.js b/tests/baselines/reference/classStaticBlock21.js index 17e8537023fdc..54e876058a67b 100644 --- a/tests/baselines/reference/classStaticBlock21.js +++ b/tests/baselines/reference/classStaticBlock21.js @@ -10,6 +10,7 @@ class C { //// [classStaticBlock21.js] +"use strict"; class C { } /* jsdocs */ diff --git a/tests/baselines/reference/classStaticBlock22(target=es2022).js b/tests/baselines/reference/classStaticBlock22(target=es2022).js index f1e722d87cba4..6408cad19d5ab 100644 --- a/tests/baselines/reference/classStaticBlock22(target=es2022).js +++ b/tests/baselines/reference/classStaticBlock22(target=es2022).js @@ -74,6 +74,7 @@ class C { //// [classStaticBlock22.js] +"use strict"; let await; class C { static { diff --git a/tests/baselines/reference/classStaticBlock22(target=esnext).js b/tests/baselines/reference/classStaticBlock22(target=esnext).js index f1e722d87cba4..6408cad19d5ab 100644 --- a/tests/baselines/reference/classStaticBlock22(target=esnext).js +++ b/tests/baselines/reference/classStaticBlock22(target=esnext).js @@ -74,6 +74,7 @@ class C { //// [classStaticBlock22.js] +"use strict"; let await; class C { static { diff --git a/tests/baselines/reference/classStaticBlock23(target=es2022).js b/tests/baselines/reference/classStaticBlock23(target=es2022).js index 2b0675d84ec0d..37741f22fd290 100644 --- a/tests/baselines/reference/classStaticBlock23(target=es2022).js +++ b/tests/baselines/reference/classStaticBlock23(target=es2022).js @@ -23,6 +23,7 @@ async function foo () { //// [classStaticBlock23.js] +"use strict"; const nums = [1, 2, 3].map(n => Promise.resolve(n)); class C { static { diff --git a/tests/baselines/reference/classStaticBlock23(target=esnext).js b/tests/baselines/reference/classStaticBlock23(target=esnext).js index 2b0675d84ec0d..37741f22fd290 100644 --- a/tests/baselines/reference/classStaticBlock23(target=esnext).js +++ b/tests/baselines/reference/classStaticBlock23(target=esnext).js @@ -23,6 +23,7 @@ async function foo () { //// [classStaticBlock23.js] +"use strict"; const nums = [1, 2, 3].map(n => Promise.resolve(n)); class C { static { diff --git a/tests/baselines/reference/classStaticBlock25(target=es2022).js b/tests/baselines/reference/classStaticBlock25(target=es2022).js index 8d79960bac8a7..f0270f435e8b4 100644 --- a/tests/baselines/reference/classStaticBlock25(target=es2022).js +++ b/tests/baselines/reference/classStaticBlock25(target=es2022).js @@ -22,6 +22,7 @@ class C { //// [classStaticBlock25.js] +"use strict"; const a = 1; const b = 2; class C { diff --git a/tests/baselines/reference/classStaticBlock25(target=es2022).js.map b/tests/baselines/reference/classStaticBlock25(target=es2022).js.map index f3bccac8cb86f..2ea6762469b27 100644 --- a/tests/baselines/reference/classStaticBlock25(target=es2022).js.map +++ b/tests/baselines/reference/classStaticBlock25(target=es2022).js.map @@ -1,6 +1,6 @@ //// [classStaticBlock25.js.map] -{"version":3,"file":"classStaticBlock25.js","sourceRoot":"","sources":["classStaticBlock25.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,GAAG,CAAC,CAAC;AACZ,MAAM,CAAC,GAAG,CAAC,CAAC;AAEZ,MAAM,CAAC;IACH;QACI,MAAM,CAAC,GAAG,EAAE,CAAC;QAEb,CAAC,CAAC;QACF,CAAC,CAAC;IACN,CAAC;IAED;QACI,MAAM,CAAC,GAAG,EAAE,CAAC;QAEb,CAAC,CAAC;QACF,CAAC,CAAC;IACN,CAAC;CACJ"} -//// https://sokra.github.io/source-map-visualization#base64,Y29uc3QgYSA9IDE7DQpjb25zdCBiID0gMjsNCmNsYXNzIEMgew0KICAgIHN0YXRpYyB7DQogICAgICAgIGNvbnN0IGEgPSAxMTsNCiAgICAgICAgYTsNCiAgICAgICAgYjsNCiAgICB9DQogICAgc3RhdGljIHsNCiAgICAgICAgY29uc3QgYSA9IDExOw0KICAgICAgICBhOw0KICAgICAgICBiOw0KICAgIH0NCn0NCi8vIyBzb3VyY2VNYXBwaW5nVVJMPWNsYXNzU3RhdGljQmxvY2syNS5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xhc3NTdGF0aWNCbG9jazI1LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiY2xhc3NTdGF0aWNCbG9jazI1LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE1BQU0sQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUNaLE1BQU0sQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUVaLE1BQU0sQ0FBQztJQUNIO1FBQ0ksTUFBTSxDQUFDLEdBQUcsRUFBRSxDQUFDO1FBRWIsQ0FBQyxDQUFDO1FBQ0YsQ0FBQyxDQUFDO0lBQ04sQ0FBQztJQUVEO1FBQ0ksTUFBTSxDQUFDLEdBQUcsRUFBRSxDQUFDO1FBRWIsQ0FBQyxDQUFDO1FBQ0YsQ0FBQyxDQUFDO0lBQ04sQ0FBQztDQUNKIn0=,Y29uc3QgYSA9IDE7CmNvbnN0IGIgPSAyOwoKY2xhc3MgQyB7CiAgICBzdGF0aWMgewogICAgICAgIGNvbnN0IGEgPSAxMTsKCiAgICAgICAgYTsKICAgICAgICBiOwogICAgfQoKICAgIHN0YXRpYyB7CiAgICAgICAgY29uc3QgYSA9IDExOwoKICAgICAgICBhOwogICAgICAgIGI7CiAgICB9Cn0K +{"version":3,"file":"classStaticBlock25.js","sourceRoot":"","sources":["classStaticBlock25.ts"],"names":[],"mappings":";AAAA,MAAM,CAAC,GAAG,CAAC,CAAC;AACZ,MAAM,CAAC,GAAG,CAAC,CAAC;AAEZ,MAAM,CAAC;IACH;QACI,MAAM,CAAC,GAAG,EAAE,CAAC;QAEb,CAAC,CAAC;QACF,CAAC,CAAC;IACN,CAAC;IAED;QACI,MAAM,CAAC,GAAG,EAAE,CAAC;QAEb,CAAC,CAAC;QACF,CAAC,CAAC;IACN,CAAC;CACJ"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KY29uc3QgYSA9IDE7DQpjb25zdCBiID0gMjsNCmNsYXNzIEMgew0KICAgIHN0YXRpYyB7DQogICAgICAgIGNvbnN0IGEgPSAxMTsNCiAgICAgICAgYTsNCiAgICAgICAgYjsNCiAgICB9DQogICAgc3RhdGljIHsNCiAgICAgICAgY29uc3QgYSA9IDExOw0KICAgICAgICBhOw0KICAgICAgICBiOw0KICAgIH0NCn0NCi8vIyBzb3VyY2VNYXBwaW5nVVJMPWNsYXNzU3RhdGljQmxvY2syNS5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xhc3NTdGF0aWNCbG9jazI1LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiY2xhc3NTdGF0aWNCbG9jazI1LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxNQUFNLENBQUMsR0FBRyxDQUFDLENBQUM7QUFDWixNQUFNLENBQUMsR0FBRyxDQUFDLENBQUM7QUFFWixNQUFNLENBQUM7SUFDSDtRQUNJLE1BQU0sQ0FBQyxHQUFHLEVBQUUsQ0FBQztRQUViLENBQUMsQ0FBQztRQUNGLENBQUMsQ0FBQztJQUNOLENBQUM7SUFFRDtRQUNJLE1BQU0sQ0FBQyxHQUFHLEVBQUUsQ0FBQztRQUViLENBQUMsQ0FBQztRQUNGLENBQUMsQ0FBQztJQUNOLENBQUM7Q0FDSiJ9,Y29uc3QgYSA9IDE7CmNvbnN0IGIgPSAyOwoKY2xhc3MgQyB7CiAgICBzdGF0aWMgewogICAgICAgIGNvbnN0IGEgPSAxMTsKCiAgICAgICAgYTsKICAgICAgICBiOwogICAgfQoKICAgIHN0YXRpYyB7CiAgICAgICAgY29uc3QgYSA9IDExOwoKICAgICAgICBhOwogICAgICAgIGI7CiAgICB9Cn0K //// [classStaticBlock25.d.ts.map] {"version":3,"file":"classStaticBlock25.d.ts","sourceRoot":"","sources":["classStaticBlock25.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,CAAC,IAAI,CAAC;AACZ,QAAA,MAAM,CAAC,IAAI,CAAC;AAEZ,cAAM,CAAC;CAcN"} diff --git a/tests/baselines/reference/classStaticBlock25(target=es2022).sourcemap.txt b/tests/baselines/reference/classStaticBlock25(target=es2022).sourcemap.txt index f2f548f460210..20161418284a9 100644 --- a/tests/baselines/reference/classStaticBlock25(target=es2022).sourcemap.txt +++ b/tests/baselines/reference/classStaticBlock25(target=es2022).sourcemap.txt @@ -8,6 +8,7 @@ sources: classStaticBlock25.ts emittedFile:classStaticBlock25.js sourceFile:classStaticBlock25.ts ------------------------------------------------------------------- +>>>"use strict"; >>>const a = 1; 1 > 2 >^^^^^^ @@ -22,12 +23,12 @@ sourceFile:classStaticBlock25.ts 4 > = 5 > 1 6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -3 >Emitted(1, 8) Source(1, 8) + SourceIndex(0) -4 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 7) Source(1, 7) + SourceIndex(0) +3 >Emitted(2, 8) Source(1, 8) + SourceIndex(0) +4 >Emitted(2, 11) Source(1, 11) + SourceIndex(0) +5 >Emitted(2, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(2, 13) Source(1, 13) + SourceIndex(0) --- >>>const b = 2; 1-> @@ -43,12 +44,12 @@ sourceFile:classStaticBlock25.ts 4 > = 5 > 2 6 > ; -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -3 >Emitted(2, 8) Source(2, 8) + SourceIndex(0) -4 >Emitted(2, 11) Source(2, 11) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) +1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(3, 8) Source(2, 8) + SourceIndex(0) +4 >Emitted(3, 11) Source(2, 11) + SourceIndex(0) +5 >Emitted(3, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(3, 13) Source(2, 13) + SourceIndex(0) --- >>>class C { 1 > @@ -60,16 +61,16 @@ sourceFile:classStaticBlock25.ts > 2 >class 3 > C -1 >Emitted(3, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(3, 7) Source(4, 7) + SourceIndex(0) -3 >Emitted(3, 8) Source(4, 8) + SourceIndex(0) +1 >Emitted(4, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(4, 7) Source(4, 7) + SourceIndex(0) +3 >Emitted(4, 8) Source(4, 8) + SourceIndex(0) --- >>> static { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^-> 1-> { > -1->Emitted(4, 5) Source(5, 5) + SourceIndex(0) +1->Emitted(5, 5) Source(5, 5) + SourceIndex(0) --- >>> const a = 11; 1->^^^^^^^^ @@ -85,12 +86,12 @@ sourceFile:classStaticBlock25.ts 4 > = 5 > 11 6 > ; -1->Emitted(5, 9) Source(6, 9) + SourceIndex(0) -2 >Emitted(5, 15) Source(6, 15) + SourceIndex(0) -3 >Emitted(5, 16) Source(6, 16) + SourceIndex(0) -4 >Emitted(5, 19) Source(6, 19) + SourceIndex(0) -5 >Emitted(5, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(5, 22) Source(6, 22) + SourceIndex(0) +1->Emitted(6, 9) Source(6, 9) + SourceIndex(0) +2 >Emitted(6, 15) Source(6, 15) + SourceIndex(0) +3 >Emitted(6, 16) Source(6, 16) + SourceIndex(0) +4 >Emitted(6, 19) Source(6, 19) + SourceIndex(0) +5 >Emitted(6, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(6, 22) Source(6, 22) + SourceIndex(0) --- >>> a; 1 >^^^^^^^^ @@ -102,9 +103,9 @@ sourceFile:classStaticBlock25.ts > 2 > a 3 > ; -1 >Emitted(6, 9) Source(8, 9) + SourceIndex(0) -2 >Emitted(6, 10) Source(8, 10) + SourceIndex(0) -3 >Emitted(6, 11) Source(8, 11) + SourceIndex(0) +1 >Emitted(7, 9) Source(8, 9) + SourceIndex(0) +2 >Emitted(7, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(7, 11) Source(8, 11) + SourceIndex(0) --- >>> b; 1->^^^^^^^^ @@ -114,9 +115,9 @@ sourceFile:classStaticBlock25.ts > 2 > b 3 > ; -1->Emitted(7, 9) Source(9, 9) + SourceIndex(0) -2 >Emitted(7, 10) Source(9, 10) + SourceIndex(0) -3 >Emitted(7, 11) Source(9, 11) + SourceIndex(0) +1->Emitted(8, 9) Source(9, 9) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 11) Source(9, 11) + SourceIndex(0) --- >>> } 1 >^^^^ @@ -125,8 +126,8 @@ sourceFile:classStaticBlock25.ts 1 > > 2 > } -1 >Emitted(8, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(8, 6) Source(10, 6) + SourceIndex(0) +1 >Emitted(9, 5) Source(10, 5) + SourceIndex(0) +2 >Emitted(9, 6) Source(10, 6) + SourceIndex(0) --- >>> static { 1->^^^^ @@ -134,7 +135,7 @@ sourceFile:classStaticBlock25.ts 1-> > > -1->Emitted(9, 5) Source(12, 5) + SourceIndex(0) +1->Emitted(10, 5) Source(12, 5) + SourceIndex(0) --- >>> const a = 11; 1->^^^^^^^^ @@ -150,12 +151,12 @@ sourceFile:classStaticBlock25.ts 4 > = 5 > 11 6 > ; -1->Emitted(10, 9) Source(13, 9) + SourceIndex(0) -2 >Emitted(10, 15) Source(13, 15) + SourceIndex(0) -3 >Emitted(10, 16) Source(13, 16) + SourceIndex(0) -4 >Emitted(10, 19) Source(13, 19) + SourceIndex(0) -5 >Emitted(10, 21) Source(13, 21) + SourceIndex(0) -6 >Emitted(10, 22) Source(13, 22) + SourceIndex(0) +1->Emitted(11, 9) Source(13, 9) + SourceIndex(0) +2 >Emitted(11, 15) Source(13, 15) + SourceIndex(0) +3 >Emitted(11, 16) Source(13, 16) + SourceIndex(0) +4 >Emitted(11, 19) Source(13, 19) + SourceIndex(0) +5 >Emitted(11, 21) Source(13, 21) + SourceIndex(0) +6 >Emitted(11, 22) Source(13, 22) + SourceIndex(0) --- >>> a; 1 >^^^^^^^^ @@ -167,9 +168,9 @@ sourceFile:classStaticBlock25.ts > 2 > a 3 > ; -1 >Emitted(11, 9) Source(15, 9) + SourceIndex(0) -2 >Emitted(11, 10) Source(15, 10) + SourceIndex(0) -3 >Emitted(11, 11) Source(15, 11) + SourceIndex(0) +1 >Emitted(12, 9) Source(15, 9) + SourceIndex(0) +2 >Emitted(12, 10) Source(15, 10) + SourceIndex(0) +3 >Emitted(12, 11) Source(15, 11) + SourceIndex(0) --- >>> b; 1->^^^^^^^^ @@ -179,9 +180,9 @@ sourceFile:classStaticBlock25.ts > 2 > b 3 > ; -1->Emitted(12, 9) Source(16, 9) + SourceIndex(0) -2 >Emitted(12, 10) Source(16, 10) + SourceIndex(0) -3 >Emitted(12, 11) Source(16, 11) + SourceIndex(0) +1->Emitted(13, 9) Source(16, 9) + SourceIndex(0) +2 >Emitted(13, 10) Source(16, 10) + SourceIndex(0) +3 >Emitted(13, 11) Source(16, 11) + SourceIndex(0) --- >>> } 1 >^^^^ @@ -189,15 +190,15 @@ sourceFile:classStaticBlock25.ts 1 > > 2 > } -1 >Emitted(13, 5) Source(17, 5) + SourceIndex(0) -2 >Emitted(13, 6) Source(17, 6) + SourceIndex(0) +1 >Emitted(14, 5) Source(17, 5) + SourceIndex(0) +2 >Emitted(14, 6) Source(17, 6) + SourceIndex(0) --- >>>} 1 >^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > >} -1 >Emitted(14, 2) Source(18, 2) + SourceIndex(0) +1 >Emitted(15, 2) Source(18, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=classStaticBlock25.js.map=================================================================== JsFile: classStaticBlock25.d.ts diff --git a/tests/baselines/reference/classStaticBlock25(target=esnext).js b/tests/baselines/reference/classStaticBlock25(target=esnext).js index 8d79960bac8a7..f0270f435e8b4 100644 --- a/tests/baselines/reference/classStaticBlock25(target=esnext).js +++ b/tests/baselines/reference/classStaticBlock25(target=esnext).js @@ -22,6 +22,7 @@ class C { //// [classStaticBlock25.js] +"use strict"; const a = 1; const b = 2; class C { diff --git a/tests/baselines/reference/classStaticBlock25(target=esnext).js.map b/tests/baselines/reference/classStaticBlock25(target=esnext).js.map index f3bccac8cb86f..2ea6762469b27 100644 --- a/tests/baselines/reference/classStaticBlock25(target=esnext).js.map +++ b/tests/baselines/reference/classStaticBlock25(target=esnext).js.map @@ -1,6 +1,6 @@ //// [classStaticBlock25.js.map] -{"version":3,"file":"classStaticBlock25.js","sourceRoot":"","sources":["classStaticBlock25.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,GAAG,CAAC,CAAC;AACZ,MAAM,CAAC,GAAG,CAAC,CAAC;AAEZ,MAAM,CAAC;IACH;QACI,MAAM,CAAC,GAAG,EAAE,CAAC;QAEb,CAAC,CAAC;QACF,CAAC,CAAC;IACN,CAAC;IAED;QACI,MAAM,CAAC,GAAG,EAAE,CAAC;QAEb,CAAC,CAAC;QACF,CAAC,CAAC;IACN,CAAC;CACJ"} -//// https://sokra.github.io/source-map-visualization#base64,Y29uc3QgYSA9IDE7DQpjb25zdCBiID0gMjsNCmNsYXNzIEMgew0KICAgIHN0YXRpYyB7DQogICAgICAgIGNvbnN0IGEgPSAxMTsNCiAgICAgICAgYTsNCiAgICAgICAgYjsNCiAgICB9DQogICAgc3RhdGljIHsNCiAgICAgICAgY29uc3QgYSA9IDExOw0KICAgICAgICBhOw0KICAgICAgICBiOw0KICAgIH0NCn0NCi8vIyBzb3VyY2VNYXBwaW5nVVJMPWNsYXNzU3RhdGljQmxvY2syNS5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xhc3NTdGF0aWNCbG9jazI1LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiY2xhc3NTdGF0aWNCbG9jazI1LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE1BQU0sQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUNaLE1BQU0sQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUVaLE1BQU0sQ0FBQztJQUNIO1FBQ0ksTUFBTSxDQUFDLEdBQUcsRUFBRSxDQUFDO1FBRWIsQ0FBQyxDQUFDO1FBQ0YsQ0FBQyxDQUFDO0lBQ04sQ0FBQztJQUVEO1FBQ0ksTUFBTSxDQUFDLEdBQUcsRUFBRSxDQUFDO1FBRWIsQ0FBQyxDQUFDO1FBQ0YsQ0FBQyxDQUFDO0lBQ04sQ0FBQztDQUNKIn0=,Y29uc3QgYSA9IDE7CmNvbnN0IGIgPSAyOwoKY2xhc3MgQyB7CiAgICBzdGF0aWMgewogICAgICAgIGNvbnN0IGEgPSAxMTsKCiAgICAgICAgYTsKICAgICAgICBiOwogICAgfQoKICAgIHN0YXRpYyB7CiAgICAgICAgY29uc3QgYSA9IDExOwoKICAgICAgICBhOwogICAgICAgIGI7CiAgICB9Cn0K +{"version":3,"file":"classStaticBlock25.js","sourceRoot":"","sources":["classStaticBlock25.ts"],"names":[],"mappings":";AAAA,MAAM,CAAC,GAAG,CAAC,CAAC;AACZ,MAAM,CAAC,GAAG,CAAC,CAAC;AAEZ,MAAM,CAAC;IACH;QACI,MAAM,CAAC,GAAG,EAAE,CAAC;QAEb,CAAC,CAAC;QACF,CAAC,CAAC;IACN,CAAC;IAED;QACI,MAAM,CAAC,GAAG,EAAE,CAAC;QAEb,CAAC,CAAC;QACF,CAAC,CAAC;IACN,CAAC;CACJ"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KY29uc3QgYSA9IDE7DQpjb25zdCBiID0gMjsNCmNsYXNzIEMgew0KICAgIHN0YXRpYyB7DQogICAgICAgIGNvbnN0IGEgPSAxMTsNCiAgICAgICAgYTsNCiAgICAgICAgYjsNCiAgICB9DQogICAgc3RhdGljIHsNCiAgICAgICAgY29uc3QgYSA9IDExOw0KICAgICAgICBhOw0KICAgICAgICBiOw0KICAgIH0NCn0NCi8vIyBzb3VyY2VNYXBwaW5nVVJMPWNsYXNzU3RhdGljQmxvY2syNS5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xhc3NTdGF0aWNCbG9jazI1LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiY2xhc3NTdGF0aWNCbG9jazI1LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxNQUFNLENBQUMsR0FBRyxDQUFDLENBQUM7QUFDWixNQUFNLENBQUMsR0FBRyxDQUFDLENBQUM7QUFFWixNQUFNLENBQUM7SUFDSDtRQUNJLE1BQU0sQ0FBQyxHQUFHLEVBQUUsQ0FBQztRQUViLENBQUMsQ0FBQztRQUNGLENBQUMsQ0FBQztJQUNOLENBQUM7SUFFRDtRQUNJLE1BQU0sQ0FBQyxHQUFHLEVBQUUsQ0FBQztRQUViLENBQUMsQ0FBQztRQUNGLENBQUMsQ0FBQztJQUNOLENBQUM7Q0FDSiJ9,Y29uc3QgYSA9IDE7CmNvbnN0IGIgPSAyOwoKY2xhc3MgQyB7CiAgICBzdGF0aWMgewogICAgICAgIGNvbnN0IGEgPSAxMTsKCiAgICAgICAgYTsKICAgICAgICBiOwogICAgfQoKICAgIHN0YXRpYyB7CiAgICAgICAgY29uc3QgYSA9IDExOwoKICAgICAgICBhOwogICAgICAgIGI7CiAgICB9Cn0K //// [classStaticBlock25.d.ts.map] {"version":3,"file":"classStaticBlock25.d.ts","sourceRoot":"","sources":["classStaticBlock25.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,CAAC,IAAI,CAAC;AACZ,QAAA,MAAM,CAAC,IAAI,CAAC;AAEZ,cAAM,CAAC;CAcN"} diff --git a/tests/baselines/reference/classStaticBlock25(target=esnext).sourcemap.txt b/tests/baselines/reference/classStaticBlock25(target=esnext).sourcemap.txt index f2f548f460210..20161418284a9 100644 --- a/tests/baselines/reference/classStaticBlock25(target=esnext).sourcemap.txt +++ b/tests/baselines/reference/classStaticBlock25(target=esnext).sourcemap.txt @@ -8,6 +8,7 @@ sources: classStaticBlock25.ts emittedFile:classStaticBlock25.js sourceFile:classStaticBlock25.ts ------------------------------------------------------------------- +>>>"use strict"; >>>const a = 1; 1 > 2 >^^^^^^ @@ -22,12 +23,12 @@ sourceFile:classStaticBlock25.ts 4 > = 5 > 1 6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -3 >Emitted(1, 8) Source(1, 8) + SourceIndex(0) -4 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) +1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 7) Source(1, 7) + SourceIndex(0) +3 >Emitted(2, 8) Source(1, 8) + SourceIndex(0) +4 >Emitted(2, 11) Source(1, 11) + SourceIndex(0) +5 >Emitted(2, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(2, 13) Source(1, 13) + SourceIndex(0) --- >>>const b = 2; 1-> @@ -43,12 +44,12 @@ sourceFile:classStaticBlock25.ts 4 > = 5 > 2 6 > ; -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -3 >Emitted(2, 8) Source(2, 8) + SourceIndex(0) -4 >Emitted(2, 11) Source(2, 11) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) +1->Emitted(3, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(3, 7) Source(2, 7) + SourceIndex(0) +3 >Emitted(3, 8) Source(2, 8) + SourceIndex(0) +4 >Emitted(3, 11) Source(2, 11) + SourceIndex(0) +5 >Emitted(3, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(3, 13) Source(2, 13) + SourceIndex(0) --- >>>class C { 1 > @@ -60,16 +61,16 @@ sourceFile:classStaticBlock25.ts > 2 >class 3 > C -1 >Emitted(3, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(3, 7) Source(4, 7) + SourceIndex(0) -3 >Emitted(3, 8) Source(4, 8) + SourceIndex(0) +1 >Emitted(4, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(4, 7) Source(4, 7) + SourceIndex(0) +3 >Emitted(4, 8) Source(4, 8) + SourceIndex(0) --- >>> static { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^-> 1-> { > -1->Emitted(4, 5) Source(5, 5) + SourceIndex(0) +1->Emitted(5, 5) Source(5, 5) + SourceIndex(0) --- >>> const a = 11; 1->^^^^^^^^ @@ -85,12 +86,12 @@ sourceFile:classStaticBlock25.ts 4 > = 5 > 11 6 > ; -1->Emitted(5, 9) Source(6, 9) + SourceIndex(0) -2 >Emitted(5, 15) Source(6, 15) + SourceIndex(0) -3 >Emitted(5, 16) Source(6, 16) + SourceIndex(0) -4 >Emitted(5, 19) Source(6, 19) + SourceIndex(0) -5 >Emitted(5, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(5, 22) Source(6, 22) + SourceIndex(0) +1->Emitted(6, 9) Source(6, 9) + SourceIndex(0) +2 >Emitted(6, 15) Source(6, 15) + SourceIndex(0) +3 >Emitted(6, 16) Source(6, 16) + SourceIndex(0) +4 >Emitted(6, 19) Source(6, 19) + SourceIndex(0) +5 >Emitted(6, 21) Source(6, 21) + SourceIndex(0) +6 >Emitted(6, 22) Source(6, 22) + SourceIndex(0) --- >>> a; 1 >^^^^^^^^ @@ -102,9 +103,9 @@ sourceFile:classStaticBlock25.ts > 2 > a 3 > ; -1 >Emitted(6, 9) Source(8, 9) + SourceIndex(0) -2 >Emitted(6, 10) Source(8, 10) + SourceIndex(0) -3 >Emitted(6, 11) Source(8, 11) + SourceIndex(0) +1 >Emitted(7, 9) Source(8, 9) + SourceIndex(0) +2 >Emitted(7, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(7, 11) Source(8, 11) + SourceIndex(0) --- >>> b; 1->^^^^^^^^ @@ -114,9 +115,9 @@ sourceFile:classStaticBlock25.ts > 2 > b 3 > ; -1->Emitted(7, 9) Source(9, 9) + SourceIndex(0) -2 >Emitted(7, 10) Source(9, 10) + SourceIndex(0) -3 >Emitted(7, 11) Source(9, 11) + SourceIndex(0) +1->Emitted(8, 9) Source(9, 9) + SourceIndex(0) +2 >Emitted(8, 10) Source(9, 10) + SourceIndex(0) +3 >Emitted(8, 11) Source(9, 11) + SourceIndex(0) --- >>> } 1 >^^^^ @@ -125,8 +126,8 @@ sourceFile:classStaticBlock25.ts 1 > > 2 > } -1 >Emitted(8, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(8, 6) Source(10, 6) + SourceIndex(0) +1 >Emitted(9, 5) Source(10, 5) + SourceIndex(0) +2 >Emitted(9, 6) Source(10, 6) + SourceIndex(0) --- >>> static { 1->^^^^ @@ -134,7 +135,7 @@ sourceFile:classStaticBlock25.ts 1-> > > -1->Emitted(9, 5) Source(12, 5) + SourceIndex(0) +1->Emitted(10, 5) Source(12, 5) + SourceIndex(0) --- >>> const a = 11; 1->^^^^^^^^ @@ -150,12 +151,12 @@ sourceFile:classStaticBlock25.ts 4 > = 5 > 11 6 > ; -1->Emitted(10, 9) Source(13, 9) + SourceIndex(0) -2 >Emitted(10, 15) Source(13, 15) + SourceIndex(0) -3 >Emitted(10, 16) Source(13, 16) + SourceIndex(0) -4 >Emitted(10, 19) Source(13, 19) + SourceIndex(0) -5 >Emitted(10, 21) Source(13, 21) + SourceIndex(0) -6 >Emitted(10, 22) Source(13, 22) + SourceIndex(0) +1->Emitted(11, 9) Source(13, 9) + SourceIndex(0) +2 >Emitted(11, 15) Source(13, 15) + SourceIndex(0) +3 >Emitted(11, 16) Source(13, 16) + SourceIndex(0) +4 >Emitted(11, 19) Source(13, 19) + SourceIndex(0) +5 >Emitted(11, 21) Source(13, 21) + SourceIndex(0) +6 >Emitted(11, 22) Source(13, 22) + SourceIndex(0) --- >>> a; 1 >^^^^^^^^ @@ -167,9 +168,9 @@ sourceFile:classStaticBlock25.ts > 2 > a 3 > ; -1 >Emitted(11, 9) Source(15, 9) + SourceIndex(0) -2 >Emitted(11, 10) Source(15, 10) + SourceIndex(0) -3 >Emitted(11, 11) Source(15, 11) + SourceIndex(0) +1 >Emitted(12, 9) Source(15, 9) + SourceIndex(0) +2 >Emitted(12, 10) Source(15, 10) + SourceIndex(0) +3 >Emitted(12, 11) Source(15, 11) + SourceIndex(0) --- >>> b; 1->^^^^^^^^ @@ -179,9 +180,9 @@ sourceFile:classStaticBlock25.ts > 2 > b 3 > ; -1->Emitted(12, 9) Source(16, 9) + SourceIndex(0) -2 >Emitted(12, 10) Source(16, 10) + SourceIndex(0) -3 >Emitted(12, 11) Source(16, 11) + SourceIndex(0) +1->Emitted(13, 9) Source(16, 9) + SourceIndex(0) +2 >Emitted(13, 10) Source(16, 10) + SourceIndex(0) +3 >Emitted(13, 11) Source(16, 11) + SourceIndex(0) --- >>> } 1 >^^^^ @@ -189,15 +190,15 @@ sourceFile:classStaticBlock25.ts 1 > > 2 > } -1 >Emitted(13, 5) Source(17, 5) + SourceIndex(0) -2 >Emitted(13, 6) Source(17, 6) + SourceIndex(0) +1 >Emitted(14, 5) Source(17, 5) + SourceIndex(0) +2 >Emitted(14, 6) Source(17, 6) + SourceIndex(0) --- >>>} 1 >^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > >} -1 >Emitted(14, 2) Source(18, 2) + SourceIndex(0) +1 >Emitted(15, 2) Source(18, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=classStaticBlock25.js.map=================================================================== JsFile: classStaticBlock25.d.ts diff --git a/tests/baselines/reference/classStaticBlock26(target=es2022).js b/tests/baselines/reference/classStaticBlock26(target=es2022).js index edda6e3b8f1e9..128c2d1bc599c 100644 --- a/tests/baselines/reference/classStaticBlock26(target=es2022).js +++ b/tests/baselines/reference/classStaticBlock26(target=es2022).js @@ -32,6 +32,7 @@ class C { //// [classStaticBlock26.js] +"use strict"; class C { static { await ; // illegal diff --git a/tests/baselines/reference/classStaticBlock26(target=esnext).js b/tests/baselines/reference/classStaticBlock26(target=esnext).js index edda6e3b8f1e9..128c2d1bc599c 100644 --- a/tests/baselines/reference/classStaticBlock26(target=esnext).js +++ b/tests/baselines/reference/classStaticBlock26(target=esnext).js @@ -32,6 +32,7 @@ class C { //// [classStaticBlock26.js] +"use strict"; class C { static { await ; // illegal diff --git a/tests/baselines/reference/classStaticBlock27.js b/tests/baselines/reference/classStaticBlock27.js index 6caaecaeafc69..bda50285ae9f9 100644 --- a/tests/baselines/reference/classStaticBlock27.js +++ b/tests/baselines/reference/classStaticBlock27.js @@ -20,6 +20,7 @@ void class Foo { } //// [classStaticBlock27.js] +"use strict"; // https://github.com/microsoft/TypeScript/issues/44872 var _a; void (_a = class Foo { diff --git a/tests/baselines/reference/classStaticBlock3(target=es2022).js b/tests/baselines/reference/classStaticBlock3(target=es2022).js index a8f509d8905ef..2332de398aca5 100644 --- a/tests/baselines/reference/classStaticBlock3(target=es2022).js +++ b/tests/baselines/reference/classStaticBlock3(target=es2022).js @@ -21,6 +21,7 @@ class C { //// [classStaticBlock3.js] +"use strict"; const a = 1; class C { static f1 = 1; diff --git a/tests/baselines/reference/classStaticBlock3(target=esnext).js b/tests/baselines/reference/classStaticBlock3(target=esnext).js index a8f509d8905ef..2332de398aca5 100644 --- a/tests/baselines/reference/classStaticBlock3(target=esnext).js +++ b/tests/baselines/reference/classStaticBlock3(target=esnext).js @@ -21,6 +21,7 @@ class C { //// [classStaticBlock3.js] +"use strict"; const a = 1; class C { static f1 = 1; diff --git a/tests/baselines/reference/classStaticBlock4(target=es2022).js b/tests/baselines/reference/classStaticBlock4(target=es2022).js index cc4ae4306da59..6c2e8fd5a7c13 100644 --- a/tests/baselines/reference/classStaticBlock4(target=es2022).js +++ b/tests/baselines/reference/classStaticBlock4(target=es2022).js @@ -18,6 +18,7 @@ class C { //// [classStaticBlock4.js] +"use strict"; class C { static s1 = 1; static { diff --git a/tests/baselines/reference/classStaticBlock4(target=esnext).js b/tests/baselines/reference/classStaticBlock4(target=esnext).js index cc4ae4306da59..6c2e8fd5a7c13 100644 --- a/tests/baselines/reference/classStaticBlock4(target=esnext).js +++ b/tests/baselines/reference/classStaticBlock4(target=esnext).js @@ -18,6 +18,7 @@ class C { //// [classStaticBlock4.js] +"use strict"; class C { static s1 = 1; static { diff --git a/tests/baselines/reference/classStaticBlock5(target=es2015).js b/tests/baselines/reference/classStaticBlock5(target=es2015).js index 404ca2101ee19..8b4753f2f5323 100644 --- a/tests/baselines/reference/classStaticBlock5(target=es2015).js +++ b/tests/baselines/reference/classStaticBlock5(target=es2015).js @@ -19,6 +19,7 @@ class C extends B { //// [classStaticBlock5.js] +"use strict"; var _a, _b; class B { } diff --git a/tests/baselines/reference/classStaticBlock5(target=es2022).js b/tests/baselines/reference/classStaticBlock5(target=es2022).js index 773bbaf926dea..f87977443923e 100644 --- a/tests/baselines/reference/classStaticBlock5(target=es2022).js +++ b/tests/baselines/reference/classStaticBlock5(target=es2022).js @@ -19,6 +19,7 @@ class C extends B { //// [classStaticBlock5.js] +"use strict"; class B { static a = 1; static b = 2; diff --git a/tests/baselines/reference/classStaticBlock5(target=es5).js b/tests/baselines/reference/classStaticBlock5(target=es5).js index e12b8213aff5f..f052523360876 100644 --- a/tests/baselines/reference/classStaticBlock5(target=es5).js +++ b/tests/baselines/reference/classStaticBlock5(target=es5).js @@ -19,6 +19,7 @@ class C extends B { //// [classStaticBlock5.js] +"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || diff --git a/tests/baselines/reference/classStaticBlock5(target=esnext).js b/tests/baselines/reference/classStaticBlock5(target=esnext).js index 773bbaf926dea..f87977443923e 100644 --- a/tests/baselines/reference/classStaticBlock5(target=esnext).js +++ b/tests/baselines/reference/classStaticBlock5(target=esnext).js @@ -19,6 +19,7 @@ class C extends B { //// [classStaticBlock5.js] +"use strict"; class B { static a = 1; static b = 2; diff --git a/tests/baselines/reference/classStaticBlock6(target=es2015).js b/tests/baselines/reference/classStaticBlock6(target=es2015).js index 2761dccac7a7e..2bbf60107a363 100644 --- a/tests/baselines/reference/classStaticBlock6(target=es2015).js +++ b/tests/baselines/reference/classStaticBlock6(target=es2015).js @@ -77,6 +77,7 @@ class foo2 { } //// [classStaticBlock6.js] +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { diff --git a/tests/baselines/reference/classStaticBlock6(target=es5).js b/tests/baselines/reference/classStaticBlock6(target=es5).js index 3ac5eccd62a10..41cb6673b515a 100644 --- a/tests/baselines/reference/classStaticBlock6(target=es5).js +++ b/tests/baselines/reference/classStaticBlock6(target=es5).js @@ -77,6 +77,7 @@ class foo2 { } //// [classStaticBlock6.js] +"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || diff --git a/tests/baselines/reference/classStaticBlock7.js b/tests/baselines/reference/classStaticBlock7.js index 50fd72a637aa5..7df82b0fa4727 100644 --- a/tests/baselines/reference/classStaticBlock7.js +++ b/tests/baselines/reference/classStaticBlock7.js @@ -47,6 +47,7 @@ function f3 () { //// [classStaticBlock7.js] +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { diff --git a/tests/baselines/reference/classStaticBlock8.js b/tests/baselines/reference/classStaticBlock8.js index c105f2fa1a25d..6e3c9e4e4e0dc 100644 --- a/tests/baselines/reference/classStaticBlock8.js +++ b/tests/baselines/reference/classStaticBlock8.js @@ -52,6 +52,7 @@ function foo (v: number) { //// [classStaticBlock8.js] +"use strict"; function foo(v) { label: while (v) { class C { diff --git a/tests/baselines/reference/classStaticBlock9(target=es2015).js b/tests/baselines/reference/classStaticBlock9(target=es2015).js index f9aa69b640278..184a4267765c5 100644 --- a/tests/baselines/reference/classStaticBlock9(target=es2015).js +++ b/tests/baselines/reference/classStaticBlock9(target=es2015).js @@ -11,6 +11,7 @@ class A { //// [classStaticBlock9.js] +"use strict"; class A { } A.bar = A.foo + 1; diff --git a/tests/baselines/reference/classStaticBlock9(target=es2022).js b/tests/baselines/reference/classStaticBlock9(target=es2022).js index 8801c6779c2c5..93a29a1a25dba 100644 --- a/tests/baselines/reference/classStaticBlock9(target=es2022).js +++ b/tests/baselines/reference/classStaticBlock9(target=es2022).js @@ -11,6 +11,7 @@ class A { //// [classStaticBlock9.js] +"use strict"; class A { static bar = A.foo + 1; static { diff --git a/tests/baselines/reference/classStaticBlock9(target=es5).js b/tests/baselines/reference/classStaticBlock9(target=es5).js index 824ee2770fe08..eac58fec8772f 100644 --- a/tests/baselines/reference/classStaticBlock9(target=es5).js +++ b/tests/baselines/reference/classStaticBlock9(target=es5).js @@ -11,6 +11,7 @@ class A { //// [classStaticBlock9.js] +"use strict"; var A = /** @class */ (function () { function A() { } diff --git a/tests/baselines/reference/classStaticBlock9(target=esnext).js b/tests/baselines/reference/classStaticBlock9(target=esnext).js index 8801c6779c2c5..93a29a1a25dba 100644 --- a/tests/baselines/reference/classStaticBlock9(target=esnext).js +++ b/tests/baselines/reference/classStaticBlock9(target=esnext).js @@ -11,6 +11,7 @@ class A { //// [classStaticBlock9.js] +"use strict"; class A { static bar = A.foo + 1; static { diff --git a/tests/baselines/reference/classStaticInitializersUsePropertiesBeforeDeclaration.js b/tests/baselines/reference/classStaticInitializersUsePropertiesBeforeDeclaration.js index 08282535c1df1..301fceb40289b 100644 --- a/tests/baselines/reference/classStaticInitializersUsePropertiesBeforeDeclaration.js +++ b/tests/baselines/reference/classStaticInitializersUsePropertiesBeforeDeclaration.js @@ -21,6 +21,7 @@ namespace Namespace { //// [classStaticInitializersUsePropertiesBeforeDeclaration.js] +"use strict"; class Foo { } Foo.enumMember = Enum.A; diff --git a/tests/baselines/reference/classStaticPropertyTypeGuard(target=es2015).js b/tests/baselines/reference/classStaticPropertyTypeGuard(target=es2015).js index b8b340d0c2242..87fa520a458da 100644 --- a/tests/baselines/reference/classStaticPropertyTypeGuard(target=es2015).js +++ b/tests/baselines/reference/classStaticPropertyTypeGuard(target=es2015).js @@ -15,6 +15,7 @@ class A { } //// [classStaticPropertyTypeGuard.js] +"use strict"; // Repro from #8923 class A { get a() { diff --git a/tests/baselines/reference/classStaticPropertyTypeGuard(target=es5).js b/tests/baselines/reference/classStaticPropertyTypeGuard(target=es5).js index e4e8564109d75..1d32e28c1fd92 100644 --- a/tests/baselines/reference/classStaticPropertyTypeGuard(target=es5).js +++ b/tests/baselines/reference/classStaticPropertyTypeGuard(target=es5).js @@ -15,6 +15,7 @@ class A { } //// [classStaticPropertyTypeGuard.js] +"use strict"; // Repro from #8923 var A = /** @class */ (function () { function A() { diff --git a/tests/baselines/reference/classTypeParametersInStatics.errors.txt b/tests/baselines/reference/classTypeParametersInStatics.errors.txt index e8c3238fbc531..28fa1531cb237 100644 --- a/tests/baselines/reference/classTypeParametersInStatics.errors.txt +++ b/tests/baselines/reference/classTypeParametersInStatics.errors.txt @@ -1,15 +1,25 @@ +classTypeParametersInStatics.ts(5,16): error TS2564: Property 'next' has no initializer and is not definitely assigned in the constructor. +classTypeParametersInStatics.ts(6,16): error TS2564: Property 'prev' has no initializer and is not definitely assigned in the constructor. classTypeParametersInStatics.ts(12,40): error TS2302: Static members cannot reference class type parameters. classTypeParametersInStatics.ts(13,29): error TS2302: Static members cannot reference class type parameters. classTypeParametersInStatics.ts(13,43): error TS2302: Static members cannot reference class type parameters. +classTypeParametersInStatics.ts(20,52): error TS2345: Argument of type 'null' is not assignable to parameter of type 'T'. + 'T' could be instantiated with an arbitrary type which could be unrelated to 'null'. +classTypeParametersInStatics.ts(27,52): error TS2345: Argument of type 'null' is not assignable to parameter of type 'U'. + 'U' could be instantiated with an arbitrary type which could be unrelated to 'null'. -==== classTypeParametersInStatics.ts (3 errors) ==== +==== classTypeParametersInStatics.ts (7 errors) ==== namespace Editor { export class List { public next: List; + ~~~~ +!!! error TS2564: Property 'next' has no initializer and is not definitely assigned in the constructor. public prev: List; + ~~~~ +!!! error TS2564: Property 'prev' has no initializer and is not definitely assigned in the constructor. constructor(public isHead: boolean, public data: T) { @@ -30,6 +40,9 @@ classTypeParametersInStatics.ts(13,43): error TS2302: Static members cannot refe public static MakeHead2(): List { // should not error var entry: List = new List(true, null); + ~~~~ +!!! error TS2345: Argument of type 'null' is not assignable to parameter of type 'T'. +!!! error TS2345: 'T' could be instantiated with an arbitrary type which could be unrelated to 'null'. entry.prev = entry; entry.next = entry; return entry; @@ -37,6 +50,9 @@ classTypeParametersInStatics.ts(13,43): error TS2302: Static members cannot refe public static MakeHead3(): List { // should not error var entry: List = new List(true, null); + ~~~~ +!!! error TS2345: Argument of type 'null' is not assignable to parameter of type 'U'. +!!! error TS2345: 'U' could be instantiated with an arbitrary type which could be unrelated to 'null'. entry.prev = entry; entry.next = entry; return entry; diff --git a/tests/baselines/reference/classTypeParametersInStatics.js b/tests/baselines/reference/classTypeParametersInStatics.js index 02efc46bf6509..5f7ece956ceb6 100644 --- a/tests/baselines/reference/classTypeParametersInStatics.js +++ b/tests/baselines/reference/classTypeParametersInStatics.js @@ -36,6 +36,7 @@ namespace Editor { } //// [classTypeParametersInStatics.js] +"use strict"; var Editor; (function (Editor) { class List { diff --git a/tests/baselines/reference/classUpdateTests.js b/tests/baselines/reference/classUpdateTests.js index d8e2ac17f1f76..eeeb32c17549b 100644 --- a/tests/baselines/reference/classUpdateTests.js +++ b/tests/baselines/reference/classUpdateTests.js @@ -116,6 +116,7 @@ class R { } //// [classUpdateTests.js] +"use strict"; // // test codegen for instance properties // diff --git a/tests/baselines/reference/classUsedBeforeInitializedVariables(target=es2015).errors.txt b/tests/baselines/reference/classUsedBeforeInitializedVariables(target=es2015).errors.txt index 5a9c7352042eb..e1e253de8c2fa 100644 --- a/tests/baselines/reference/classUsedBeforeInitializedVariables(target=es2015).errors.txt +++ b/tests/baselines/reference/classUsedBeforeInitializedVariables(target=es2015).errors.txt @@ -1,12 +1,14 @@ classUsedBeforeInitializedVariables.ts(4,15): error TS2729: Property 'p4' is used before its initialization. classUsedBeforeInitializedVariables.ts(13,34): error TS2729: Property 'directlyAssigned' is used before its initialization. +classUsedBeforeInitializedVariables.ts(18,16): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. classUsedBeforeInitializedVariables.ts(22,15): error TS2729: Property 'withinObjectLiteral' is used before its initialization. classUsedBeforeInitializedVariables.ts(26,19): error TS2729: Property 'withinObjectLiteralGetterName' is used before its initialization. classUsedBeforeInitializedVariables.ts(32,19): error TS2729: Property 'withinObjectLiteralSetterName' is used before its initialization. classUsedBeforeInitializedVariables.ts(35,64): error TS2729: Property 'withinClassDeclarationExtension' is used before its initialization. +classUsedBeforeInitializedVariables.ts(44,16): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. -==== classUsedBeforeInitializedVariables.ts (6 errors) ==== +==== classUsedBeforeInitializedVariables.ts (8 errors) ==== class Test { p1 = 0; p2 = this.p1; @@ -31,6 +33,9 @@ classUsedBeforeInitializedVariables.ts(35,64): error TS2729: Property 'withinCla withinFunction: any = function () { return this.withinFunction; + ~~~~ +!!! error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. +!!! related TS2738 classUsedBeforeInitializedVariables.ts:17:27: An outer value of 'this' is shadowed by this container. }; withinObjectLiteral: any = { @@ -69,6 +74,9 @@ classUsedBeforeInitializedVariables.ts(35,64): error TS2729: Property 'withinCla assignedByFunction: any = (function () { return this.assignedByFunction; + ~~~~ +!!! error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. +!!! related TS2738 classUsedBeforeInitializedVariables.ts:43:32: An outer value of 'this' is shadowed by this container. })(); } \ No newline at end of file diff --git a/tests/baselines/reference/classUsedBeforeInitializedVariables(target=es2015).js b/tests/baselines/reference/classUsedBeforeInitializedVariables(target=es2015).js index 37fd555343acd..61ecc51512954 100644 --- a/tests/baselines/reference/classUsedBeforeInitializedVariables(target=es2015).js +++ b/tests/baselines/reference/classUsedBeforeInitializedVariables(target=es2015).js @@ -50,6 +50,7 @@ class Test { //// [classUsedBeforeInitializedVariables.js] +"use strict"; class Test { constructor() { this.p1 = 0; diff --git a/tests/baselines/reference/classUsedBeforeInitializedVariables(target=es2015).types b/tests/baselines/reference/classUsedBeforeInitializedVariables(target=es2015).types index 76ce7c9ddfc41..778df9e3752e7 100644 --- a/tests/baselines/reference/classUsedBeforeInitializedVariables(target=es2015).types +++ b/tests/baselines/reference/classUsedBeforeInitializedVariables(target=es2015).types @@ -38,12 +38,12 @@ class Test { > : ^ p5?: number; ->p5 : number -> : ^^^^^^ +>p5 : number | undefined +> : ^^^^^^^^^^^^^^^^^^ p6?: string; ->p6 : string -> : ^^^^^^ +>p6 : string | undefined +> : ^^^^^^^^^^^^^^^^^^ p7 = { >p7 : { hello: string; } @@ -58,12 +58,12 @@ class Test { > : ^^^^^^^^ >this.p6 = "string" : "string" > : ^^^^^^^^ ->this.p6 : string -> : ^^^^^^ +>this.p6 : string | undefined +> : ^^^^^^^^^^^^^^^^^^ >this : this > : ^^^^ ->p6 : string -> : ^^^^^^ +>p6 : string | undefined +> : ^^^^^^^^^^^^^^^^^^ >"string" : "string" > : ^^^^^^^^ @@ -184,14 +184,14 @@ class Test { > : ^^^ fromOptional = this.p5; ->fromOptional : number -> : ^^^^^^ ->this.p5 : number -> : ^^^^^^ +>fromOptional : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>this.p5 : number | undefined +> : ^^^^^^^^^^^^^^^^^^ >this : this > : ^^^^ ->p5 : number -> : ^^^^^^ +>p5 : number | undefined +> : ^^^^^^^^^^^^^^^^^^ // These error cases are ignored (not checked by control flow analysis) diff --git a/tests/baselines/reference/classUsedBeforeInitializedVariables(target=es5).errors.txt b/tests/baselines/reference/classUsedBeforeInitializedVariables(target=es5).errors.txt index e40d4a97ab74a..2221660ea062f 100644 --- a/tests/baselines/reference/classUsedBeforeInitializedVariables(target=es5).errors.txt +++ b/tests/baselines/reference/classUsedBeforeInitializedVariables(target=es5).errors.txt @@ -1,14 +1,16 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. classUsedBeforeInitializedVariables.ts(4,15): error TS2729: Property 'p4' is used before its initialization. classUsedBeforeInitializedVariables.ts(13,34): error TS2729: Property 'directlyAssigned' is used before its initialization. +classUsedBeforeInitializedVariables.ts(18,16): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. classUsedBeforeInitializedVariables.ts(22,15): error TS2729: Property 'withinObjectLiteral' is used before its initialization. classUsedBeforeInitializedVariables.ts(26,19): error TS2729: Property 'withinObjectLiteralGetterName' is used before its initialization. classUsedBeforeInitializedVariables.ts(32,19): error TS2729: Property 'withinObjectLiteralSetterName' is used before its initialization. classUsedBeforeInitializedVariables.ts(35,64): error TS2729: Property 'withinClassDeclarationExtension' is used before its initialization. +classUsedBeforeInitializedVariables.ts(44,16): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== classUsedBeforeInitializedVariables.ts (6 errors) ==== +==== classUsedBeforeInitializedVariables.ts (8 errors) ==== class Test { p1 = 0; p2 = this.p1; @@ -33,6 +35,9 @@ classUsedBeforeInitializedVariables.ts(35,64): error TS2729: Property 'withinCla withinFunction: any = function () { return this.withinFunction; + ~~~~ +!!! error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. +!!! related TS2738 classUsedBeforeInitializedVariables.ts:17:27: An outer value of 'this' is shadowed by this container. }; withinObjectLiteral: any = { @@ -71,6 +76,9 @@ classUsedBeforeInitializedVariables.ts(35,64): error TS2729: Property 'withinCla assignedByFunction: any = (function () { return this.assignedByFunction; + ~~~~ +!!! error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. +!!! related TS2738 classUsedBeforeInitializedVariables.ts:43:32: An outer value of 'this' is shadowed by this container. })(); } \ No newline at end of file diff --git a/tests/baselines/reference/classUsedBeforeInitializedVariables(target=es5).js b/tests/baselines/reference/classUsedBeforeInitializedVariables(target=es5).js index 343c8b0f6c127..55944a8e65269 100644 --- a/tests/baselines/reference/classUsedBeforeInitializedVariables(target=es5).js +++ b/tests/baselines/reference/classUsedBeforeInitializedVariables(target=es5).js @@ -50,6 +50,7 @@ class Test { //// [classUsedBeforeInitializedVariables.js] +"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || diff --git a/tests/baselines/reference/classUsedBeforeInitializedVariables(target=es5).types b/tests/baselines/reference/classUsedBeforeInitializedVariables(target=es5).types index 76ce7c9ddfc41..778df9e3752e7 100644 --- a/tests/baselines/reference/classUsedBeforeInitializedVariables(target=es5).types +++ b/tests/baselines/reference/classUsedBeforeInitializedVariables(target=es5).types @@ -38,12 +38,12 @@ class Test { > : ^ p5?: number; ->p5 : number -> : ^^^^^^ +>p5 : number | undefined +> : ^^^^^^^^^^^^^^^^^^ p6?: string; ->p6 : string -> : ^^^^^^ +>p6 : string | undefined +> : ^^^^^^^^^^^^^^^^^^ p7 = { >p7 : { hello: string; } @@ -58,12 +58,12 @@ class Test { > : ^^^^^^^^ >this.p6 = "string" : "string" > : ^^^^^^^^ ->this.p6 : string -> : ^^^^^^ +>this.p6 : string | undefined +> : ^^^^^^^^^^^^^^^^^^ >this : this > : ^^^^ ->p6 : string -> : ^^^^^^ +>p6 : string | undefined +> : ^^^^^^^^^^^^^^^^^^ >"string" : "string" > : ^^^^^^^^ @@ -184,14 +184,14 @@ class Test { > : ^^^ fromOptional = this.p5; ->fromOptional : number -> : ^^^^^^ ->this.p5 : number -> : ^^^^^^ +>fromOptional : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>this.p5 : number | undefined +> : ^^^^^^^^^^^^^^^^^^ >this : this > : ^^^^ ->p5 : number -> : ^^^^^^ +>p5 : number | undefined +> : ^^^^^^^^^^^^^^^^^^ // These error cases are ignored (not checked by control flow analysis) diff --git a/tests/baselines/reference/classWithBaseClassButNoConstructor.errors.txt b/tests/baselines/reference/classWithBaseClassButNoConstructor.errors.txt index 37970a5a4f794..e4026e90519f6 100644 --- a/tests/baselines/reference/classWithBaseClassButNoConstructor.errors.txt +++ b/tests/baselines/reference/classWithBaseClassButNoConstructor.errors.txt @@ -1,16 +1,22 @@ +classWithBaseClassButNoConstructor.ts(6,5): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. classWithBaseClassButNoConstructor.ts(10,9): error TS2554: Expected 1 arguments, but got 0. +classWithBaseClassButNoConstructor.ts(18,5): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. classWithBaseClassButNoConstructor.ts(22,9): error TS2554: Expected 1 arguments, but got 0. +classWithBaseClassButNoConstructor.ts(27,5): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. classWithBaseClassButNoConstructor.ts(31,10): error TS2554: Expected 1 arguments, but got 0. +classWithBaseClassButNoConstructor.ts(35,5): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. classWithBaseClassButNoConstructor.ts(39,10): error TS2554: Expected 1 arguments, but got 0. -==== classWithBaseClassButNoConstructor.ts (4 errors) ==== +==== classWithBaseClassButNoConstructor.ts (8 errors) ==== class Base { constructor(x: number) { } } class C extends Base { foo: string; + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. } var r = C; @@ -26,6 +32,8 @@ classWithBaseClassButNoConstructor.ts(39,10): error TS2554: Expected 1 arguments class D extends Base2 { foo: U; + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. } var r2 = D; @@ -38,6 +46,8 @@ classWithBaseClassButNoConstructor.ts(39,10): error TS2554: Expected 1 arguments // specialized base class class D2 extends Base2 { foo: U; + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. } var r3 = D2; @@ -49,6 +59,8 @@ classWithBaseClassButNoConstructor.ts(39,10): error TS2554: Expected 1 arguments class D3 extends Base2 { foo: string; + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. } var r4 = D3; diff --git a/tests/baselines/reference/classWithBaseClassButNoConstructor.js b/tests/baselines/reference/classWithBaseClassButNoConstructor.js index c56898d9540cd..ad77c50cbdadc 100644 --- a/tests/baselines/reference/classWithBaseClassButNoConstructor.js +++ b/tests/baselines/reference/classWithBaseClassButNoConstructor.js @@ -43,6 +43,7 @@ var d5 = new D(); // error var d6 = new D(1); // ok //// [classWithBaseClassButNoConstructor.js] +"use strict"; class Base { constructor(x) { } } diff --git a/tests/baselines/reference/classWithConstructors.js b/tests/baselines/reference/classWithConstructors.js index 3bc8f7203e685..b4d458dcbcd78 100644 --- a/tests/baselines/reference/classWithConstructors.js +++ b/tests/baselines/reference/classWithConstructors.js @@ -52,6 +52,7 @@ namespace Generics { } //// [classWithConstructors.js] +"use strict"; var NonGeneric; (function (NonGeneric) { class C { diff --git a/tests/baselines/reference/classWithDuplicateIdentifier.errors.txt b/tests/baselines/reference/classWithDuplicateIdentifier.errors.txt index 9dc49a40a5596..6808c86ee488d 100644 --- a/tests/baselines/reference/classWithDuplicateIdentifier.errors.txt +++ b/tests/baselines/reference/classWithDuplicateIdentifier.errors.txt @@ -1,18 +1,24 @@ classWithDuplicateIdentifier.ts(3,5): error TS2300: Duplicate identifier 'a'. +classWithDuplicateIdentifier.ts(3,5): error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. classWithDuplicateIdentifier.ts(3,5): error TS2717: Subsequent property declarations must have the same type. Property 'a' must be of type '() => number', but here has type 'number'. classWithDuplicateIdentifier.ts(6,5): error TS2300: Duplicate identifier 'b'. +classWithDuplicateIdentifier.ts(6,5): error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. classWithDuplicateIdentifier.ts(7,5): error TS2300: Duplicate identifier 'b'. +classWithDuplicateIdentifier.ts(10,5): error TS2564: Property 'c' has no initializer and is not definitely assigned in the constructor. classWithDuplicateIdentifier.ts(11,5): error TS2300: Duplicate identifier 'c'. +classWithDuplicateIdentifier.ts(11,5): error TS2564: Property 'c' has no initializer and is not definitely assigned in the constructor. classWithDuplicateIdentifier.ts(11,5): error TS2717: Subsequent property declarations must have the same type. Property 'c' must be of type 'number', but here has type 'string'. -==== classWithDuplicateIdentifier.ts (6 errors) ==== +==== classWithDuplicateIdentifier.ts (10 errors) ==== class C { a(): number { return 0; } // error: duplicate identifier a: number; ~ !!! error TS2300: Duplicate identifier 'a'. ~ +!!! error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. + ~ !!! error TS2717: Subsequent property declarations must have the same type. Property 'a' must be of type '() => number', but here has type 'number'. !!! related TS6203 classWithDuplicateIdentifier.ts:2:5: 'a' was also declared here. } @@ -20,16 +26,22 @@ classWithDuplicateIdentifier.ts(11,5): error TS2717: Subsequent property declara b: number; // error: duplicate identifier ~ !!! error TS2300: Duplicate identifier 'b'. + ~ +!!! error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. b(): number { return 0; } ~ !!! error TS2300: Duplicate identifier 'b'. } class D { c: number; + ~ +!!! error TS2564: Property 'c' has no initializer and is not definitely assigned in the constructor. c: string; ~ !!! error TS2300: Duplicate identifier 'c'. ~ +!!! error TS2564: Property 'c' has no initializer and is not definitely assigned in the constructor. + ~ !!! error TS2717: Subsequent property declarations must have the same type. Property 'c' must be of type 'number', but here has type 'string'. !!! related TS6203 classWithDuplicateIdentifier.ts:10:5: 'c' was also declared here. } diff --git a/tests/baselines/reference/classWithDuplicateIdentifier.js b/tests/baselines/reference/classWithDuplicateIdentifier.js index e7dfcbb99f57d..268c794a60836 100644 --- a/tests/baselines/reference/classWithDuplicateIdentifier.js +++ b/tests/baselines/reference/classWithDuplicateIdentifier.js @@ -16,6 +16,7 @@ class D { //// [classWithDuplicateIdentifier.js] +"use strict"; class C { a() { return 0; } // error: duplicate identifier } diff --git a/tests/baselines/reference/classWithEmptyBody.errors.txt b/tests/baselines/reference/classWithEmptyBody.errors.txt new file mode 100644 index 0000000000000..eb33f117c747c --- /dev/null +++ b/tests/baselines/reference/classWithEmptyBody.errors.txt @@ -0,0 +1,29 @@ +classWithEmptyBody.ts(5,13): error TS2454: Variable 'c' is used before being assigned. +classWithEmptyBody.ts(17,13): error TS2454: Variable 'd' is used before being assigned. + + +==== classWithEmptyBody.ts (2 errors) ==== + class C { + } + + var c: C; + var o: {} = c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + c = 1; + c = { foo: '' } + c = () => { } + + class D { + constructor() { + return 1; + } + } + + var d: D; + var o: {} = d; + ~ +!!! error TS2454: Variable 'd' is used before being assigned. + d = 1; + d = { foo: '' } + d = () => { } \ No newline at end of file diff --git a/tests/baselines/reference/classWithEmptyBody.js b/tests/baselines/reference/classWithEmptyBody.js index 3b179fe806051..46b10001cb41a 100644 --- a/tests/baselines/reference/classWithEmptyBody.js +++ b/tests/baselines/reference/classWithEmptyBody.js @@ -23,6 +23,7 @@ d = { foo: '' } d = () => { } //// [classWithEmptyBody.js] +"use strict"; class C { } var c; diff --git a/tests/baselines/reference/classWithEmptyTypeParameter.js b/tests/baselines/reference/classWithEmptyTypeParameter.js index d1db0c67bc894..f9857672889e8 100644 --- a/tests/baselines/reference/classWithEmptyTypeParameter.js +++ b/tests/baselines/reference/classWithEmptyTypeParameter.js @@ -5,5 +5,6 @@ class C<> { } //// [classWithEmptyTypeParameter.js] +"use strict"; class C { } diff --git a/tests/baselines/reference/classWithMultipleBaseClasses.js b/tests/baselines/reference/classWithMultipleBaseClasses.js index 89fa823772018..0b57c303a3feb 100644 --- a/tests/baselines/reference/classWithMultipleBaseClasses.js +++ b/tests/baselines/reference/classWithMultipleBaseClasses.js @@ -27,6 +27,7 @@ interface I extends A, B { } //// [classWithMultipleBaseClasses.js] +"use strict"; class A { foo() { } } diff --git a/tests/baselines/reference/classWithNoConstructorOrBaseClass.errors.txt b/tests/baselines/reference/classWithNoConstructorOrBaseClass.errors.txt new file mode 100644 index 0000000000000..3c71f009ec607 --- /dev/null +++ b/tests/baselines/reference/classWithNoConstructorOrBaseClass.errors.txt @@ -0,0 +1,28 @@ +classWithNoConstructorOrBaseClass.ts(2,5): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. +classWithNoConstructorOrBaseClass.ts(9,5): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. +classWithNoConstructorOrBaseClass.ts(10,5): error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. + + +==== classWithNoConstructorOrBaseClass.ts (3 errors) ==== + class C { + x: string; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. + } + + var c = new C(); + var r = C; + + class D { + x: T; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. + y: U; + ~ +!!! error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. + } + + var d = new D(); + var d2 = new D(); + var r2 = D; + \ No newline at end of file diff --git a/tests/baselines/reference/classWithNoConstructorOrBaseClass.js b/tests/baselines/reference/classWithNoConstructorOrBaseClass.js index 3da07f87e9822..e9ec3c170d390 100644 --- a/tests/baselines/reference/classWithNoConstructorOrBaseClass.js +++ b/tests/baselines/reference/classWithNoConstructorOrBaseClass.js @@ -19,6 +19,7 @@ var r2 = D; //// [classWithNoConstructorOrBaseClass.js] +"use strict"; class C { } var c = new C(); diff --git a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface(target=es2015).errors.txt b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface(target=es2015).errors.txt new file mode 100644 index 0000000000000..9cb20f8c4d03f --- /dev/null +++ b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface(target=es2015).errors.txt @@ -0,0 +1,37 @@ +classWithOnlyPublicMembersEquivalentToInterface.ts(4,12): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. +classWithOnlyPublicMembersEquivalentToInterface.ts(5,35): error TS2322: Type 'null' is not assignable to type 'number'. +classWithOnlyPublicMembersEquivalentToInterface.ts(24,5): error TS2454: Variable 'i' is used before being assigned. + + +==== classWithOnlyPublicMembersEquivalentToInterface.ts (3 errors) ==== + // no errors expected + + class C { + public x: string; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. + public y(a: number): number { return null; } + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'number'. + public get z() { return 1; } + public set z(v) { } + [x: string]: Object; + [x: number]: Object; + 0: number; + } + + interface I { + x: string; + y(b: number): number; + z: number; + [x: string]: Object; + [x: number]: Object; + 0: number; + } + + var c: C; + var i: I; + c = i; + ~ +!!! error TS2454: Variable 'i' is used before being assigned. + i = c; \ No newline at end of file diff --git a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface(target=es2015).js b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface(target=es2015).js index bf458163ff606..2db959de8c332 100644 --- a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface(target=es2015).js +++ b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface(target=es2015).js @@ -28,6 +28,7 @@ c = i; i = c; //// [classWithOnlyPublicMembersEquivalentToInterface.js] +"use strict"; // no errors expected class C { y(a) { return null; } diff --git a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface(target=es5).errors.txt b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface(target=es5).errors.txt index b01fb7aa05dce..0961893377772 100644 --- a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface(target=es5).errors.txt +++ b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface(target=es5).errors.txt @@ -1,13 +1,20 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +classWithOnlyPublicMembersEquivalentToInterface.ts(4,12): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. +classWithOnlyPublicMembersEquivalentToInterface.ts(5,35): error TS2322: Type 'null' is not assignable to type 'number'. +classWithOnlyPublicMembersEquivalentToInterface.ts(24,5): error TS2454: Variable 'i' is used before being assigned. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== classWithOnlyPublicMembersEquivalentToInterface.ts (0 errors) ==== +==== classWithOnlyPublicMembersEquivalentToInterface.ts (3 errors) ==== // no errors expected class C { public x: string; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. public y(a: number): number { return null; } + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'number'. public get z() { return 1; } public set z(v) { } [x: string]: Object; @@ -27,4 +34,6 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in Typ var c: C; var i: I; c = i; + ~ +!!! error TS2454: Variable 'i' is used before being assigned. i = c; \ No newline at end of file diff --git a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface(target=es5).js b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface(target=es5).js index 5c524304cbbe2..84a4260cb5ce3 100644 --- a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface(target=es5).js +++ b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface(target=es5).js @@ -28,6 +28,7 @@ c = i; i = c; //// [classWithOnlyPublicMembersEquivalentToInterface.js] +"use strict"; // no errors expected var C = /** @class */ (function () { function C() { diff --git a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2(target=es2015).errors.txt b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2(target=es2015).errors.txt new file mode 100644 index 0000000000000..1b35ab423204c --- /dev/null +++ b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2(target=es2015).errors.txt @@ -0,0 +1,39 @@ +classWithOnlyPublicMembersEquivalentToInterface2.ts(4,12): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. +classWithOnlyPublicMembersEquivalentToInterface2.ts(5,35): error TS2322: Type 'null' is not assignable to type 'number'. +classWithOnlyPublicMembersEquivalentToInterface2.ts(26,5): error TS2454: Variable 'i' is used before being assigned. + + +==== classWithOnlyPublicMembersEquivalentToInterface2.ts (3 errors) ==== + // no errors expected + + class C { + public x: string; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. + public y(a: number): number { return null; } + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'number'. + public get z() { return 1; } + public set z(v) { } + [x: string]: Object; + [x: number]: Object; + 0: number; + + public static foo: string; // doesn't effect equivalence + } + + interface I { + x: string; + y(b: number): number; + z: number; + [x: string]: Object; + [x: number]: Object; + 0: number; + } + + var c: C; + var i: I; + c = i; + ~ +!!! error TS2454: Variable 'i' is used before being assigned. + i = c; \ No newline at end of file diff --git a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2(target=es2015).js b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2(target=es2015).js index 2d5d125309eec..914d4b1a2745c 100644 --- a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2(target=es2015).js +++ b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2(target=es2015).js @@ -30,6 +30,7 @@ c = i; i = c; //// [classWithOnlyPublicMembersEquivalentToInterface2.js] +"use strict"; // no errors expected class C { y(a) { return null; } diff --git a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2(target=es5).errors.txt b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2(target=es5).errors.txt index d233b01d7ba57..f23543d8ce107 100644 --- a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2(target=es5).errors.txt +++ b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2(target=es5).errors.txt @@ -1,13 +1,20 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +classWithOnlyPublicMembersEquivalentToInterface2.ts(4,12): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. +classWithOnlyPublicMembersEquivalentToInterface2.ts(5,35): error TS2322: Type 'null' is not assignable to type 'number'. +classWithOnlyPublicMembersEquivalentToInterface2.ts(26,5): error TS2454: Variable 'i' is used before being assigned. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== classWithOnlyPublicMembersEquivalentToInterface2.ts (0 errors) ==== +==== classWithOnlyPublicMembersEquivalentToInterface2.ts (3 errors) ==== // no errors expected class C { public x: string; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. public y(a: number): number { return null; } + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'number'. public get z() { return 1; } public set z(v) { } [x: string]: Object; @@ -29,4 +36,6 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in Typ var c: C; var i: I; c = i; + ~ +!!! error TS2454: Variable 'i' is used before being assigned. i = c; \ No newline at end of file diff --git a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2(target=es5).js b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2(target=es5).js index d485998827a96..578a199866730 100644 --- a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2(target=es5).js +++ b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2(target=es5).js @@ -30,6 +30,7 @@ c = i; i = c; //// [classWithOnlyPublicMembersEquivalentToInterface2.js] +"use strict"; // no errors expected var C = /** @class */ (function () { function C() { diff --git a/tests/baselines/reference/classWithOptionalParameter.js b/tests/baselines/reference/classWithOptionalParameter.js index bfa649bc1f025..ca6d740ef6b51 100644 --- a/tests/baselines/reference/classWithOptionalParameter.js +++ b/tests/baselines/reference/classWithOptionalParameter.js @@ -14,6 +14,7 @@ class C2 { } //// [classWithOptionalParameter.js] +"use strict"; // classes do not permit optional parameters, these are errors class C { f() { } diff --git a/tests/baselines/reference/classWithOptionalParameter.types b/tests/baselines/reference/classWithOptionalParameter.types index c5d3b3d2565df..4cf78745c842c 100644 --- a/tests/baselines/reference/classWithOptionalParameter.types +++ b/tests/baselines/reference/classWithOptionalParameter.types @@ -8,12 +8,12 @@ class C { > : ^ x?: string; ->x : string -> : ^^^^^^ +>x : string | undefined +> : ^^^^^^^^^^^^^^^^^^ f?() {} ->f : () => void -> : ^^^^^^^^^^ +>f : (() => void) | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^ } class C2 { @@ -21,12 +21,12 @@ class C2 { > : ^^^^^ x?: T; ->x : T -> : ^ +>x : T | undefined +> : ^^^^^^^^^^^^^ f?(x: T) {} ->f : (x: T) => void -> : ^ ^^ ^^^^^^^^^ +>f : ((x: T) => void) | undefined +> : ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^ >x : T > : ^ } diff --git a/tests/baselines/reference/classWithOverloadImplementationOfWrongName.js b/tests/baselines/reference/classWithOverloadImplementationOfWrongName.js index 10ccab14fdc04..885f7c75f4210 100644 --- a/tests/baselines/reference/classWithOverloadImplementationOfWrongName.js +++ b/tests/baselines/reference/classWithOverloadImplementationOfWrongName.js @@ -8,6 +8,7 @@ class C { } //// [classWithOverloadImplementationOfWrongName.js] +"use strict"; class C { bar(x) { } } diff --git a/tests/baselines/reference/classWithOverloadImplementationOfWrongName2.js b/tests/baselines/reference/classWithOverloadImplementationOfWrongName2.js index a6a9f79159fb7..0440ef3b42494 100644 --- a/tests/baselines/reference/classWithOverloadImplementationOfWrongName2.js +++ b/tests/baselines/reference/classWithOverloadImplementationOfWrongName2.js @@ -8,6 +8,7 @@ class C { } //// [classWithOverloadImplementationOfWrongName2.js] +"use strict"; class C { bar(x) { } } diff --git a/tests/baselines/reference/classWithPredefinedTypesAsNames.js b/tests/baselines/reference/classWithPredefinedTypesAsNames.js index 7ea9bbcd82fd6..fa21a2cceb55a 100644 --- a/tests/baselines/reference/classWithPredefinedTypesAsNames.js +++ b/tests/baselines/reference/classWithPredefinedTypesAsNames.js @@ -9,6 +9,7 @@ class boolean { } class string { } //// [classWithPredefinedTypesAsNames.js] +"use strict"; // classes cannot use predefined types as names class any { } diff --git a/tests/baselines/reference/classWithPredefinedTypesAsNames2.js b/tests/baselines/reference/classWithPredefinedTypesAsNames2.js index 88582aa14c844..12e523adda787 100644 --- a/tests/baselines/reference/classWithPredefinedTypesAsNames2.js +++ b/tests/baselines/reference/classWithPredefinedTypesAsNames2.js @@ -6,6 +6,7 @@ class void {} //// [classWithPredefinedTypesAsNames2.js] +"use strict"; // classes cannot use predefined types as names class { } diff --git a/tests/baselines/reference/classWithPrivateProperty.js b/tests/baselines/reference/classWithPrivateProperty.js index 1f29ff2ae66d6..e6d95445e748b 100644 --- a/tests/baselines/reference/classWithPrivateProperty.js +++ b/tests/baselines/reference/classWithPrivateProperty.js @@ -25,6 +25,7 @@ var r7: string = C.f(); var r8: string = C.g(); //// [classWithPrivateProperty.js] +"use strict"; // accessing any private outside the class is an error class C { constructor() { diff --git a/tests/baselines/reference/classWithProtectedProperty.js b/tests/baselines/reference/classWithProtectedProperty.js index 2378228dcf7fe..59c2f78327927 100644 --- a/tests/baselines/reference/classWithProtectedProperty.js +++ b/tests/baselines/reference/classWithProtectedProperty.js @@ -30,6 +30,7 @@ class D extends C { } //// [classWithProtectedProperty.js] +"use strict"; // accessing any protected outside the class is an error class C { constructor() { diff --git a/tests/baselines/reference/classWithPublicProperty.js b/tests/baselines/reference/classWithPublicProperty.js index 5e8023b5eed4e..35bba5807fc5e 100644 --- a/tests/baselines/reference/classWithPublicProperty.js +++ b/tests/baselines/reference/classWithPublicProperty.js @@ -24,6 +24,7 @@ var r7: string = C.f(); var r8: string = C.g(); //// [classWithPublicProperty.js] +"use strict"; class C { constructor() { this.a = ''; diff --git a/tests/baselines/reference/classWithSemicolonClassElement1.js b/tests/baselines/reference/classWithSemicolonClassElement1.js index 1640aab72c88d..022ae35cef73c 100644 --- a/tests/baselines/reference/classWithSemicolonClassElement1.js +++ b/tests/baselines/reference/classWithSemicolonClassElement1.js @@ -6,6 +6,7 @@ class C { } //// [classWithSemicolonClassElement1.js] +"use strict"; class C { ; } diff --git a/tests/baselines/reference/classWithSemicolonClassElement2.js b/tests/baselines/reference/classWithSemicolonClassElement2.js index f99611f042c1a..243fef1454880 100644 --- a/tests/baselines/reference/classWithSemicolonClassElement2.js +++ b/tests/baselines/reference/classWithSemicolonClassElement2.js @@ -7,6 +7,7 @@ class C { } //// [classWithSemicolonClassElement2.js] +"use strict"; class C { ; ; diff --git a/tests/baselines/reference/classWithSemicolonClassElementES61.js b/tests/baselines/reference/classWithSemicolonClassElementES61.js index 913c8e62a3d30..7044fe0f00406 100644 --- a/tests/baselines/reference/classWithSemicolonClassElementES61.js +++ b/tests/baselines/reference/classWithSemicolonClassElementES61.js @@ -6,6 +6,7 @@ class C { } //// [classWithSemicolonClassElementES61.js] +"use strict"; class C { ; } diff --git a/tests/baselines/reference/classWithSemicolonClassElementES62.js b/tests/baselines/reference/classWithSemicolonClassElementES62.js index 1bb646d9b2cc2..1c6b49f1d34de 100644 --- a/tests/baselines/reference/classWithSemicolonClassElementES62.js +++ b/tests/baselines/reference/classWithSemicolonClassElementES62.js @@ -7,6 +7,7 @@ class C { } //// [classWithSemicolonClassElementES62.js] +"use strict"; class C { ; ; diff --git a/tests/baselines/reference/classWithStaticFieldInParameterBindingPattern(target=es2015).js b/tests/baselines/reference/classWithStaticFieldInParameterBindingPattern(target=es2015).js index 1f5494e202bc2..8f04085c9ae46 100644 --- a/tests/baselines/reference/classWithStaticFieldInParameterBindingPattern(target=es2015).js +++ b/tests/baselines/reference/classWithStaticFieldInParameterBindingPattern(target=es2015).js @@ -5,6 +5,7 @@ (({ [class { static x = 1 }.x]: b = "" }) => {})(); //// [classWithStaticFieldInParameterBindingPattern.js] +"use strict"; // https://github.com/microsoft/TypeScript/issues/36295 ((_a) => { var _b; var { [(_b = class { }, diff --git a/tests/baselines/reference/classWithStaticFieldInParameterBindingPattern(target=es5).js b/tests/baselines/reference/classWithStaticFieldInParameterBindingPattern(target=es5).js index 63c0427a6ab66..48a95ff3383bd 100644 --- a/tests/baselines/reference/classWithStaticFieldInParameterBindingPattern(target=es5).js +++ b/tests/baselines/reference/classWithStaticFieldInParameterBindingPattern(target=es5).js @@ -5,6 +5,7 @@ (({ [class { static x = 1 }.x]: b = "" }) => {})(); //// [classWithStaticFieldInParameterBindingPattern.js] +"use strict"; // https://github.com/microsoft/TypeScript/issues/36295 (function (_a) { var _b; diff --git a/tests/baselines/reference/classWithStaticFieldInParameterBindingPattern(target=esnext).js b/tests/baselines/reference/classWithStaticFieldInParameterBindingPattern(target=esnext).js index c8a30ea33d34a..5b96397abbc92 100644 --- a/tests/baselines/reference/classWithStaticFieldInParameterBindingPattern(target=esnext).js +++ b/tests/baselines/reference/classWithStaticFieldInParameterBindingPattern(target=esnext).js @@ -5,6 +5,7 @@ (({ [class { static x = 1 }.x]: b = "" }) => {})(); //// [classWithStaticFieldInParameterBindingPattern.js] +"use strict"; // https://github.com/microsoft/TypeScript/issues/36295 (({ [class { static x = 1; diff --git a/tests/baselines/reference/classWithStaticFieldInParameterInitializer(target=es2015).js b/tests/baselines/reference/classWithStaticFieldInParameterInitializer(target=es2015).js index e3adc92a100e4..497cf24a7eae1 100644 --- a/tests/baselines/reference/classWithStaticFieldInParameterInitializer(target=es2015).js +++ b/tests/baselines/reference/classWithStaticFieldInParameterInitializer(target=es2015).js @@ -5,6 +5,7 @@ ((b = class { static x = 1 }) => {})(); //// [classWithStaticFieldInParameterInitializer.js] +"use strict"; var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) { if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); diff --git a/tests/baselines/reference/classWithStaticFieldInParameterInitializer(target=es5).js b/tests/baselines/reference/classWithStaticFieldInParameterInitializer(target=es5).js index af41d155adb5d..52ac2c7913c0c 100644 --- a/tests/baselines/reference/classWithStaticFieldInParameterInitializer(target=es5).js +++ b/tests/baselines/reference/classWithStaticFieldInParameterInitializer(target=es5).js @@ -5,6 +5,7 @@ ((b = class { static x = 1 }) => {})(); //// [classWithStaticFieldInParameterInitializer.js] +"use strict"; var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) { if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); diff --git a/tests/baselines/reference/classWithStaticFieldInParameterInitializer(target=esnext).js b/tests/baselines/reference/classWithStaticFieldInParameterInitializer(target=esnext).js index c90c730f6a4aa..697c5a8cfe8d2 100644 --- a/tests/baselines/reference/classWithStaticFieldInParameterInitializer(target=esnext).js +++ b/tests/baselines/reference/classWithStaticFieldInParameterInitializer(target=esnext).js @@ -5,6 +5,7 @@ ((b = class { static x = 1 }) => {})(); //// [classWithStaticFieldInParameterInitializer.js] +"use strict"; // https://github.com/microsoft/TypeScript/issues/36295 ((b = class { static x = 1; diff --git a/tests/baselines/reference/classWithStaticMembers.errors.txt b/tests/baselines/reference/classWithStaticMembers.errors.txt new file mode 100644 index 0000000000000..cfd323e5d7453 --- /dev/null +++ b/tests/baselines/reference/classWithStaticMembers.errors.txt @@ -0,0 +1,25 @@ +classWithStaticMembers.ts(14,5): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. + + +==== classWithStaticMembers.ts (1 errors) ==== + class C { + static fn() { return this; } + static get x() { return 1; } + static set x(v) { } + constructor(public a: number, private b: number) { } + static foo: string; + } + + var r = C.fn(); + var r2 = r.x; + var r3 = r.foo; + + class D extends C { + bar: string; + ~~~ +!!! error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. + } + + var r = D.fn(); + var r2 = r.x; + var r3 = r.foo; \ No newline at end of file diff --git a/tests/baselines/reference/classWithStaticMembers.js b/tests/baselines/reference/classWithStaticMembers.js index cbca35ef06861..cf336ec4e1a59 100644 --- a/tests/baselines/reference/classWithStaticMembers.js +++ b/tests/baselines/reference/classWithStaticMembers.js @@ -22,6 +22,7 @@ var r2 = r.x; var r3 = r.foo; //// [classWithStaticMembers.js] +"use strict"; class C { static fn() { return this; } static get x() { return 1; } diff --git a/tests/baselines/reference/classWithTwoConstructorDefinitions.js b/tests/baselines/reference/classWithTwoConstructorDefinitions.js index a0a4ae278b66f..2ed515c2291ea 100644 --- a/tests/baselines/reference/classWithTwoConstructorDefinitions.js +++ b/tests/baselines/reference/classWithTwoConstructorDefinitions.js @@ -12,6 +12,7 @@ class D { } //// [classWithTwoConstructorDefinitions.js] +"use strict"; class C { constructor() { } // error constructor(x) { } // error diff --git a/tests/baselines/reference/classWithoutExplicitConstructor.errors.txt b/tests/baselines/reference/classWithoutExplicitConstructor.errors.txt index 77efc13b2c46c..902598be68b24 100644 --- a/tests/baselines/reference/classWithoutExplicitConstructor.errors.txt +++ b/tests/baselines/reference/classWithoutExplicitConstructor.errors.txt @@ -1,8 +1,10 @@ classWithoutExplicitConstructor.ts(7,16): error TS2554: Expected 0 arguments, but got 1. +classWithoutExplicitConstructor.ts(11,5): error TS2322: Type 'null' is not assignable to type 'T'. + 'T' could be instantiated with an arbitrary type which could be unrelated to 'null'. classWithoutExplicitConstructor.ts(15,16): error TS2554: Expected 0 arguments, but got 1. -==== classWithoutExplicitConstructor.ts (2 errors) ==== +==== classWithoutExplicitConstructor.ts (3 errors) ==== class C { x = 1 y = 'hello'; @@ -16,6 +18,9 @@ classWithoutExplicitConstructor.ts(15,16): error TS2554: Expected 0 arguments, b class D { x = 2 y: T = null; + ~ +!!! error TS2322: Type 'null' is not assignable to type 'T'. +!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'null'. } var d = new D(); diff --git a/tests/baselines/reference/classWithoutExplicitConstructor.js b/tests/baselines/reference/classWithoutExplicitConstructor.js index 25f8d3655c371..3672723c71879 100644 --- a/tests/baselines/reference/classWithoutExplicitConstructor.js +++ b/tests/baselines/reference/classWithoutExplicitConstructor.js @@ -18,6 +18,7 @@ var d = new D(); var d2 = new D(null); // error //// [classWithoutExplicitConstructor.js] +"use strict"; class C { constructor() { this.x = 1; diff --git a/tests/baselines/reference/classdecl(target=es2015).js b/tests/baselines/reference/classdecl(target=es2015).js index bdb60b4940f32..7efedd7eef83c 100644 --- a/tests/baselines/reference/classdecl(target=es2015).js +++ b/tests/baselines/reference/classdecl(target=es2015).js @@ -96,6 +96,7 @@ class e { } //// [classdecl.js] +"use strict"; class a { constructor(ns) { } diff --git a/tests/baselines/reference/classdecl(target=es5).js b/tests/baselines/reference/classdecl(target=es5).js index 9afd83763b15f..534d6296ccd6a 100644 --- a/tests/baselines/reference/classdecl(target=es5).js +++ b/tests/baselines/reference/classdecl(target=es5).js @@ -96,6 +96,7 @@ class e { } //// [classdecl.js] +"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || diff --git a/tests/baselines/reference/clinterfaces.errors.txt b/tests/baselines/reference/clinterfaces.errors.txt new file mode 100644 index 0000000000000..4689880d9c1ad --- /dev/null +++ b/tests/baselines/reference/clinterfaces.errors.txt @@ -0,0 +1,34 @@ +clinterfaces.ts(13,5): error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. +clinterfaces.ts(17,5): error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. + + +==== clinterfaces.ts (2 errors) ==== + namespace M { + class C { } + interface C { } + interface D { } + class D { } + } + + interface Foo { + a: string; + } + + class Foo{ + b: number; + ~ +!!! error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. + } + + class Bar{ + b: number; + ~ +!!! error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. + } + + interface Bar { + a: string; + } + + export = Foo; + \ No newline at end of file diff --git a/tests/baselines/reference/cloduleAcrossModuleDefinitions.js b/tests/baselines/reference/cloduleAcrossModuleDefinitions.js index f228641c432cc..0928e87847399 100644 --- a/tests/baselines/reference/cloduleAcrossModuleDefinitions.js +++ b/tests/baselines/reference/cloduleAcrossModuleDefinitions.js @@ -18,6 +18,7 @@ var b: A.B; // ok //// [cloduleAcrossModuleDefinitions.js] +"use strict"; var A; (function (A) { class B { diff --git a/tests/baselines/reference/cloduleAndTypeParameters.js b/tests/baselines/reference/cloduleAndTypeParameters.js index 8add560584a5a..c338ad60bd081 100644 --- a/tests/baselines/reference/cloduleAndTypeParameters.js +++ b/tests/baselines/reference/cloduleAndTypeParameters.js @@ -16,6 +16,7 @@ namespace Foo { } //// [cloduleAndTypeParameters.js] +"use strict"; class Foo { constructor() { } diff --git a/tests/baselines/reference/cloduleGenericOnSelfMember.errors.txt b/tests/baselines/reference/cloduleGenericOnSelfMember.errors.txt new file mode 100644 index 0000000000000..d2b8e23ef3b37 --- /dev/null +++ b/tests/baselines/reference/cloduleGenericOnSelfMember.errors.txt @@ -0,0 +1,17 @@ +cloduleGenericOnSelfMember.ts(2,5): error TS2564: Property 'field' has no initializer and is not definitely assigned in the constructor. + + +==== cloduleGenericOnSelfMember.ts (1 errors) ==== + class ServiceBase { + field: T; + ~~~~~ +!!! error TS2564: Property 'field' has no initializer and is not definitely assigned in the constructor. + } + class Service extends ServiceBase { + } + namespace Service { + export const Base = { + name: "1", + value: 5 + }; + } \ No newline at end of file diff --git a/tests/baselines/reference/cloduleGenericOnSelfMember.js b/tests/baselines/reference/cloduleGenericOnSelfMember.js index 4c3ba18d4fc2e..971c974a40b48 100644 --- a/tests/baselines/reference/cloduleGenericOnSelfMember.js +++ b/tests/baselines/reference/cloduleGenericOnSelfMember.js @@ -14,6 +14,7 @@ namespace Service { } //// [cloduleGenericOnSelfMember.js] +"use strict"; class ServiceBase { } class Service extends ServiceBase { diff --git a/tests/baselines/reference/cloduleSplitAcrossFiles.js b/tests/baselines/reference/cloduleSplitAcrossFiles.js index 1741ab19ffa1c..b60a9509e09a7 100644 --- a/tests/baselines/reference/cloduleSplitAcrossFiles.js +++ b/tests/baselines/reference/cloduleSplitAcrossFiles.js @@ -10,9 +10,11 @@ namespace D { D.y; //// [cloduleSplitAcrossFiles_class.js] +"use strict"; class D { } //// [cloduleSplitAcrossFiles_module.js] +"use strict"; var D; (function (D) { D.y = "hi"; diff --git a/tests/baselines/reference/cloduleStaticMembers.js b/tests/baselines/reference/cloduleStaticMembers.js index 60979077cec20..07a40efc45748 100644 --- a/tests/baselines/reference/cloduleStaticMembers.js +++ b/tests/baselines/reference/cloduleStaticMembers.js @@ -15,6 +15,7 @@ namespace Clod { //// [cloduleStaticMembers.js] +"use strict"; class Clod { } Clod.x = 10; diff --git a/tests/baselines/reference/cloduleTest1.js b/tests/baselines/reference/cloduleTest1.js index 5871181863b9a..b62cab15d71e0 100644 --- a/tests/baselines/reference/cloduleTest1.js +++ b/tests/baselines/reference/cloduleTest1.js @@ -14,6 +14,7 @@ //// [cloduleTest1.js] +"use strict"; var $; (function ($) { function ajax(options) { } diff --git a/tests/baselines/reference/cloduleTest2.js b/tests/baselines/reference/cloduleTest2.js index 5270b8176b404..a0777f13626b3 100644 --- a/tests/baselines/reference/cloduleTest2.js +++ b/tests/baselines/reference/cloduleTest2.js @@ -39,6 +39,7 @@ declare class m4d extends m3d { } var r2 = new m4d(); // error //// [cloduleTest2.js] +"use strict"; var T1; (function (T1) { let m3d; diff --git a/tests/baselines/reference/cloduleWithDuplicateMember1.js b/tests/baselines/reference/cloduleWithDuplicateMember1.js index 131fc3ca53a33..92d467762447f 100644 --- a/tests/baselines/reference/cloduleWithDuplicateMember1.js +++ b/tests/baselines/reference/cloduleWithDuplicateMember1.js @@ -18,6 +18,7 @@ namespace C { } //// [cloduleWithDuplicateMember1.js] +"use strict"; class C { get x() { return 1; } static get x() { diff --git a/tests/baselines/reference/cloduleWithDuplicateMember2.js b/tests/baselines/reference/cloduleWithDuplicateMember2.js index 2e58784356b61..b884d008627a8 100644 --- a/tests/baselines/reference/cloduleWithDuplicateMember2.js +++ b/tests/baselines/reference/cloduleWithDuplicateMember2.js @@ -14,6 +14,7 @@ namespace C { } //// [cloduleWithDuplicateMember2.js] +"use strict"; class C { set x(y) { } static set y(z) { } diff --git a/tests/baselines/reference/cloduleWithPriorInstantiatedModule.js b/tests/baselines/reference/cloduleWithPriorInstantiatedModule.js index befbee230335f..4e81f853f7f08 100644 --- a/tests/baselines/reference/cloduleWithPriorInstantiatedModule.js +++ b/tests/baselines/reference/cloduleWithPriorInstantiatedModule.js @@ -19,6 +19,7 @@ namespace Moclodule { } //// [cloduleWithPriorInstantiatedModule.js] +"use strict"; // Non-ambient & instantiated module. var Moclodule; (function (Moclodule) { diff --git a/tests/baselines/reference/cloduleWithPriorUninstantiatedModule.js b/tests/baselines/reference/cloduleWithPriorUninstantiatedModule.js index 2ba1af6b7cab7..dd535ff76d944 100644 --- a/tests/baselines/reference/cloduleWithPriorUninstantiatedModule.js +++ b/tests/baselines/reference/cloduleWithPriorUninstantiatedModule.js @@ -18,6 +18,7 @@ namespace Moclodule { } //// [cloduleWithPriorUninstantiatedModule.js] +"use strict"; class Moclodule { } // Instantiated module. diff --git a/tests/baselines/reference/cloduleWithRecursiveReference.js b/tests/baselines/reference/cloduleWithRecursiveReference.js index b1d1e899e287c..7a97f44533587 100644 --- a/tests/baselines/reference/cloduleWithRecursiveReference.js +++ b/tests/baselines/reference/cloduleWithRecursiveReference.js @@ -10,6 +10,7 @@ namespace M } //// [cloduleWithRecursiveReference.js] +"use strict"; var M; (function (M) { class C { diff --git a/tests/baselines/reference/clodulesDerivedClasses.errors.txt b/tests/baselines/reference/clodulesDerivedClasses.errors.txt index 72893772429cf..a04e25193d291 100644 --- a/tests/baselines/reference/clodulesDerivedClasses.errors.txt +++ b/tests/baselines/reference/clodulesDerivedClasses.errors.txt @@ -1,15 +1,23 @@ +clodulesDerivedClasses.ts(2,5): error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. +clodulesDerivedClasses.ts(6,40): error TS2322: Type 'null' is not assignable to type 'Shape'. clodulesDerivedClasses.ts(9,7): error TS2417: Class static side 'typeof Path' incorrectly extends base class static side 'typeof Shape'. Types of property 'Utils' are incompatible. Property 'convert' is missing in type 'typeof Path.Utils' but required in type 'typeof Shape.Utils'. +clodulesDerivedClasses.ts(10,5): error TS2564: Property 'name' has no initializer and is not definitely assigned in the constructor. +clodulesDerivedClasses.ts(16,9): error TS2322: Type 'null' is not assignable to type 'Path'. -==== clodulesDerivedClasses.ts (1 errors) ==== +==== clodulesDerivedClasses.ts (5 errors) ==== class Shape { id: number; + ~~ +!!! error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor. } namespace Shape.Utils { export function convert(): Shape { return null;} + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'Shape'. } class Path extends Shape { @@ -19,12 +27,16 @@ clodulesDerivedClasses.ts(9,7): error TS2417: Class static side 'typeof Path' in !!! error TS2417: Property 'convert' is missing in type 'typeof Path.Utils' but required in type 'typeof Shape.Utils'. !!! related TS2728 clodulesDerivedClasses.ts:6:21: 'convert' is declared here. name: string; + ~~~~ +!!! error TS2564: Property 'name' has no initializer and is not definitely assigned in the constructor. } namespace Path.Utils { export function convert2(): Path { return null; + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'Path'. } } diff --git a/tests/baselines/reference/clodulesDerivedClasses.js b/tests/baselines/reference/clodulesDerivedClasses.js index 758e8330af1cb..5e263d61a4a47 100644 --- a/tests/baselines/reference/clodulesDerivedClasses.js +++ b/tests/baselines/reference/clodulesDerivedClasses.js @@ -25,6 +25,7 @@ namespace Path.Utils { //// [clodulesDerivedClasses.js] +"use strict"; class Shape { } (function (Shape) { diff --git a/tests/baselines/reference/collectionPatternNoError.js b/tests/baselines/reference/collectionPatternNoError.js index 3d299dcd523e4..9c85358252f9a 100644 --- a/tests/baselines/reference/collectionPatternNoError.js +++ b/tests/baselines/reference/collectionPatternNoError.js @@ -40,6 +40,7 @@ function f< //// [collectionPatternNoError.js] +"use strict"; class Message { clone() { return this; diff --git a/tests/baselines/reference/collectionPatternNoError.types b/tests/baselines/reference/collectionPatternNoError.types index 14f62d0689bbf..2522d302eeb34 100644 --- a/tests/baselines/reference/collectionPatternNoError.types +++ b/tests/baselines/reference/collectionPatternNoError.types @@ -32,8 +32,8 @@ function fetchMsg(protoCtor: MsgConstructor): V { > : ^^^^^^^^^^^^^^^^^ return null!; ->null! : null -> : ^^^^ +>null! : never +> : ^^^^^ } class DataProvider> { diff --git a/tests/baselines/reference/collisionArgumentsArrowFunctions(target=es2015).errors.txt b/tests/baselines/reference/collisionArgumentsArrowFunctions(target=es2015).errors.txt new file mode 100644 index 0000000000000..8e907f7f316ad --- /dev/null +++ b/tests/baselines/reference/collisionArgumentsArrowFunctions(target=es2015).errors.txt @@ -0,0 +1,43 @@ +collisionArgumentsArrowFunctions.ts(1,25): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsArrowFunctions.ts(2,9): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsArrowFunctions.ts(4,12): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsArrowFunctions.ts(5,9): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsArrowFunctions.ts(7,18): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsArrowFunctions.ts(8,9): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsArrowFunctions.ts(12,9): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsArrowFunctions.ts(15,9): error TS1100: Invalid use of 'arguments' in strict mode. + + +==== collisionArgumentsArrowFunctions.ts (8 errors) ==== + var f1 = (i: number, ...arguments) => { //arguments is error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + var arguments: any[]; // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + } + var f12 = (arguments: number, ...rest) => { //arguments is error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + } + var f1NoError = (arguments: number) => { // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + } + + var f2 = (...restParameters) => { + var arguments = 10; // No Error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + } + var f2NoError = () => { + var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionArgumentsArrowFunctions(target=es2015).js b/tests/baselines/reference/collisionArgumentsArrowFunctions(target=es2015).js index 3e7ae866ed007..11524f2d2d055 100644 --- a/tests/baselines/reference/collisionArgumentsArrowFunctions(target=es2015).js +++ b/tests/baselines/reference/collisionArgumentsArrowFunctions(target=es2015).js @@ -19,6 +19,7 @@ var f2NoError = () => { } //// [collisionArgumentsArrowFunctions.js] +"use strict"; var f1 = (i, ...arguments) => { var arguments; // no error }; diff --git a/tests/baselines/reference/collisionArgumentsArrowFunctions(target=es5).errors.txt b/tests/baselines/reference/collisionArgumentsArrowFunctions(target=es5).errors.txt index cbde2985f06bd..ca26bb041193a 100644 --- a/tests/baselines/reference/collisionArgumentsArrowFunctions(target=es5).errors.txt +++ b/tests/baselines/reference/collisionArgumentsArrowFunctions(target=es5).errors.txt @@ -1,27 +1,51 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. collisionArgumentsArrowFunctions.ts(1,22): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +collisionArgumentsArrowFunctions.ts(1,25): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsArrowFunctions.ts(2,9): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsArrowFunctions.ts(4,12): error TS1100: Invalid use of 'arguments' in strict mode. collisionArgumentsArrowFunctions.ts(4,12): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +collisionArgumentsArrowFunctions.ts(5,9): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsArrowFunctions.ts(7,18): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsArrowFunctions.ts(8,9): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsArrowFunctions.ts(12,9): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsArrowFunctions.ts(15,9): error TS1100: Invalid use of 'arguments' in strict mode. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== collisionArgumentsArrowFunctions.ts (2 errors) ==== +==== collisionArgumentsArrowFunctions.ts (10 errors) ==== var f1 = (i: number, ...arguments) => { //arguments is error ~~~~~~~~~~~~ !!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. var arguments: any[]; // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. } var f12 = (arguments: number, ...rest) => { //arguments is error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. ~~~~~~~~~~~~~~~~~ !!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. } var f1NoError = (arguments: number) => { // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. } var f2 = (...restParameters) => { var arguments = 10; // No Error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. } var f2NoError = () => { var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. } \ No newline at end of file diff --git a/tests/baselines/reference/collisionArgumentsArrowFunctions(target=es5).js b/tests/baselines/reference/collisionArgumentsArrowFunctions(target=es5).js index 78527c71736da..f06a3f27f3d34 100644 --- a/tests/baselines/reference/collisionArgumentsArrowFunctions(target=es5).js +++ b/tests/baselines/reference/collisionArgumentsArrowFunctions(target=es5).js @@ -19,6 +19,7 @@ var f2NoError = () => { } //// [collisionArgumentsArrowFunctions.js] +"use strict"; var f1 = function (i) { var arguments = []; for (var _i = 1; _i < arguments.length; _i++) { diff --git a/tests/baselines/reference/collisionArgumentsClassConstructor(target=es2015).js b/tests/baselines/reference/collisionArgumentsClassConstructor(target=es2015).js index 10855699e3ee1..5138f024ad1bd 100644 --- a/tests/baselines/reference/collisionArgumentsClassConstructor(target=es2015).js +++ b/tests/baselines/reference/collisionArgumentsClassConstructor(target=es2015).js @@ -89,6 +89,7 @@ declare class c6NoError { } //// [collisionArgumentsClassConstructor.js] +"use strict"; // Constructors class c1 { constructor(i, ...arguments) { diff --git a/tests/baselines/reference/collisionArgumentsClassConstructor(target=es5).js b/tests/baselines/reference/collisionArgumentsClassConstructor(target=es5).js index 621d5e2382a84..4738d5d8ff59b 100644 --- a/tests/baselines/reference/collisionArgumentsClassConstructor(target=es5).js +++ b/tests/baselines/reference/collisionArgumentsClassConstructor(target=es5).js @@ -89,6 +89,7 @@ declare class c6NoError { } //// [collisionArgumentsClassConstructor.js] +"use strict"; // Constructors var c1 = /** @class */ (function () { function c1(i) { diff --git a/tests/baselines/reference/collisionArgumentsClassMethod(target=es2015).js b/tests/baselines/reference/collisionArgumentsClassMethod(target=es2015).js index a32d2e607140f..58994402bca75 100644 --- a/tests/baselines/reference/collisionArgumentsClassMethod(target=es2015).js +++ b/tests/baselines/reference/collisionArgumentsClassMethod(target=es2015).js @@ -51,6 +51,7 @@ class c3 { } //// [collisionArgumentsClassMethod.js] +"use strict"; class c1 { foo(i, ...arguments) { var arguments; // no error diff --git a/tests/baselines/reference/collisionArgumentsClassMethod(target=es5).js b/tests/baselines/reference/collisionArgumentsClassMethod(target=es5).js index 25f98144d1331..7808b8378fea0 100644 --- a/tests/baselines/reference/collisionArgumentsClassMethod(target=es5).js +++ b/tests/baselines/reference/collisionArgumentsClassMethod(target=es5).js @@ -51,6 +51,7 @@ class c3 { } //// [collisionArgumentsClassMethod.js] +"use strict"; var c1 = /** @class */ (function () { function c1() { } diff --git a/tests/baselines/reference/collisionArgumentsFunction(target=es2015).errors.txt b/tests/baselines/reference/collisionArgumentsFunction(target=es2015).errors.txt new file mode 100644 index 0000000000000..d0667533b3b4a --- /dev/null +++ b/tests/baselines/reference/collisionArgumentsFunction(target=es2015).errors.txt @@ -0,0 +1,107 @@ +collisionArgumentsFunction.ts(2,13): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunction.ts(3,9): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunction.ts(5,28): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunction.ts(6,9): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunction.ts(8,20): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunction.ts(9,9): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunction.ts(17,9): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunction.ts(20,9): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunction.ts(23,13): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunction.ts(24,13): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunction.ts(25,13): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunction.ts(26,9): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunction.ts(28,28): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunction.ts(29,28): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunction.ts(30,25): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunction.ts(31,9): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunction.ts(33,20): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunction.ts(34,20): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunction.ts(35,20): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunction.ts(36,9): error TS1100: Invalid use of 'arguments' in strict mode. + + +==== collisionArgumentsFunction.ts (20 errors) ==== + // Functions + function f1(arguments: number, ...restParameters) { //arguments is error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + } + function f12(i: number, ...arguments) { //arguments is error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + var arguments: any[]; // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + } + function f1NoError(arguments: number) { // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + } + + declare function f2(i: number, ...arguments); // no error - no code gen + declare function f21(arguments: number, ...rest); // no error - no code gen + declare function f2NoError(arguments: number); // no error + + function f3(...restParameters) { + var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + } + function f3NoError() { + var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + } + + function f4(arguments: number, ...rest); // no codegen no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + function f4(arguments: string, ...rest); // no codegen no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + function f4(arguments: any, ...rest) { // error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + var arguments: any; // No error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + } + function f42(i: number, ...arguments); // no codegen no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + function f42(i: string, ...arguments); // no codegen no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + function f42(i: any, ...arguments) { // error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + var arguments: any[]; // No error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + } + function f4NoError(arguments: number); // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + function f4NoError(arguments: string); // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + function f4NoError(arguments: any) { // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + var arguments: any; // No error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + } + + declare function f5(arguments: number, ...rest); // no codegen no error + declare function f5(arguments: string, ...rest); // no codegen no error + declare function f52(i: number, ...arguments); // no codegen no error + declare function f52(i: string, ...arguments); // no codegen no error + declare function f6(arguments: number); // no codegen no error + declare function f6(arguments: string); // no codegen no error \ No newline at end of file diff --git a/tests/baselines/reference/collisionArgumentsFunction(target=es2015).js b/tests/baselines/reference/collisionArgumentsFunction(target=es2015).js index b25325c55411d..682a22ba96601 100644 --- a/tests/baselines/reference/collisionArgumentsFunction(target=es2015).js +++ b/tests/baselines/reference/collisionArgumentsFunction(target=es2015).js @@ -47,6 +47,7 @@ declare function f6(arguments: number); // no codegen no error declare function f6(arguments: string); // no codegen no error //// [collisionArgumentsFunction.js] +"use strict"; // Functions function f1(arguments, ...restParameters) { var arguments = 10; // no error diff --git a/tests/baselines/reference/collisionArgumentsFunction(target=es2015).types b/tests/baselines/reference/collisionArgumentsFunction(target=es2015).types index 00149caf4329c..88c4107b45ae9 100644 --- a/tests/baselines/reference/collisionArgumentsFunction(target=es2015).types +++ b/tests/baselines/reference/collisionArgumentsFunction(target=es2015).types @@ -106,11 +106,13 @@ function f4(arguments: any, ...rest) { // error >f4 : { (arguments: number, ...rest: any[]): any; (arguments: string, ...rest: any[]): any; } > : ^^^ ^^ ^^^^^ ^^^^^^^^^^^^^^^^ ^^ ^^^^^ ^^^^^^^^^^^^^^^^ >arguments : any +> : ^^^ >rest : any[] > : ^^^^^ var arguments: any; // No error >arguments : any +> : ^^^ } function f42(i: number, ...arguments); // no codegen no error >f42 : { (i: number, ...arguments: any[]): any; (i: string, ...arguments: any[]): any; } @@ -132,6 +134,7 @@ function f42(i: any, ...arguments) { // error >f42 : { (i: number, ...arguments: any[]): any; (i: string, ...arguments: any[]): any; } > : ^^^ ^^ ^^^^^ ^^^^^^^^^^^^^^^^ ^^ ^^^^^ ^^^^^^^^^^^^^^^^ >i : any +> : ^^^ >arguments : any[] > : ^^^^^ @@ -155,9 +158,11 @@ function f4NoError(arguments: any) { // no error >f4NoError : { (arguments: number): any; (arguments: string): any; } > : ^^^ ^^ ^^^^^^^^^ ^^ ^^^^^^^^^ >arguments : any +> : ^^^ var arguments: any; // No error >arguments : any +> : ^^^ } declare function f5(arguments: number, ...rest); // no codegen no error diff --git a/tests/baselines/reference/collisionArgumentsFunction(target=es5).errors.txt b/tests/baselines/reference/collisionArgumentsFunction(target=es5).errors.txt index bced0ca74e435..55e3d551b0e95 100644 --- a/tests/baselines/reference/collisionArgumentsFunction(target=es5).errors.txt +++ b/tests/baselines/reference/collisionArgumentsFunction(target=es5).errors.txt @@ -1,25 +1,57 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +collisionArgumentsFunction.ts(2,13): error TS1100: Invalid use of 'arguments' in strict mode. collisionArgumentsFunction.ts(2,13): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +collisionArgumentsFunction.ts(3,9): error TS1100: Invalid use of 'arguments' in strict mode. collisionArgumentsFunction.ts(5,25): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +collisionArgumentsFunction.ts(5,28): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunction.ts(6,9): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunction.ts(8,20): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunction.ts(9,9): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunction.ts(17,9): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunction.ts(20,9): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunction.ts(23,13): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunction.ts(24,13): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunction.ts(25,13): error TS1100: Invalid use of 'arguments' in strict mode. collisionArgumentsFunction.ts(25,13): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +collisionArgumentsFunction.ts(26,9): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunction.ts(28,28): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunction.ts(29,28): error TS1100: Invalid use of 'arguments' in strict mode. collisionArgumentsFunction.ts(30,22): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +collisionArgumentsFunction.ts(30,25): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunction.ts(31,9): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunction.ts(33,20): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunction.ts(34,20): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunction.ts(35,20): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunction.ts(36,9): error TS1100: Invalid use of 'arguments' in strict mode. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== collisionArgumentsFunction.ts (4 errors) ==== +==== collisionArgumentsFunction.ts (24 errors) ==== // Functions function f1(arguments: number, ...restParameters) { //arguments is error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. ~~~~~~~~~~~~~~~~~ !!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. } function f12(i: number, ...arguments) { //arguments is error ~~~~~~~~~~~~ !!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. var arguments: any[]; // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. } function f1NoError(arguments: number) { // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. } declare function f2(i: number, ...arguments); // no error - no code gen @@ -28,29 +60,57 @@ collisionArgumentsFunction.ts(30,22): error TS2396: Duplicate identifier 'argume function f3(...restParameters) { var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. } function f3NoError() { var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. } function f4(arguments: number, ...rest); // no codegen no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. function f4(arguments: string, ...rest); // no codegen no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. function f4(arguments: any, ...rest) { // error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. ~~~~~~~~~~~~~~ !!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. var arguments: any; // No error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. } function f42(i: number, ...arguments); // no codegen no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. function f42(i: string, ...arguments); // no codegen no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. function f42(i: any, ...arguments) { // error ~~~~~~~~~~~~ !!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. var arguments: any[]; // No error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. } function f4NoError(arguments: number); // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. function f4NoError(arguments: string); // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. function f4NoError(arguments: any) { // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. var arguments: any; // No error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. } declare function f5(arguments: number, ...rest); // no codegen no error diff --git a/tests/baselines/reference/collisionArgumentsFunction(target=es5).js b/tests/baselines/reference/collisionArgumentsFunction(target=es5).js index e23bb139ffca5..5690801bcde0b 100644 --- a/tests/baselines/reference/collisionArgumentsFunction(target=es5).js +++ b/tests/baselines/reference/collisionArgumentsFunction(target=es5).js @@ -47,6 +47,7 @@ declare function f6(arguments: number); // no codegen no error declare function f6(arguments: string); // no codegen no error //// [collisionArgumentsFunction.js] +"use strict"; // Functions function f1(arguments) { var restParameters = []; diff --git a/tests/baselines/reference/collisionArgumentsFunctionExpressions(target=es2015).errors.txt b/tests/baselines/reference/collisionArgumentsFunctionExpressions(target=es2015).errors.txt new file mode 100644 index 0000000000000..f580bf12b6ead --- /dev/null +++ b/tests/baselines/reference/collisionArgumentsFunctionExpressions(target=es2015).errors.txt @@ -0,0 +1,97 @@ +collisionArgumentsFunctionExpressions.ts(2,17): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunctionExpressions.ts(3,13): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunctionExpressions.ts(5,32): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunctionExpressions.ts(6,13): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunctionExpressions.ts(8,24): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunctionExpressions.ts(9,13): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunctionExpressions.ts(13,13): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunctionExpressions.ts(16,13): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunctionExpressions.ts(19,17): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunctionExpressions.ts(20,17): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunctionExpressions.ts(21,17): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunctionExpressions.ts(22,13): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunctionExpressions.ts(24,32): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunctionExpressions.ts(25,32): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunctionExpressions.ts(26,29): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunctionExpressions.ts(27,13): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunctionExpressions.ts(29,24): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunctionExpressions.ts(30,24): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunctionExpressions.ts(31,24): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunctionExpressions.ts(32,13): error TS1100: Invalid use of 'arguments' in strict mode. + + +==== collisionArgumentsFunctionExpressions.ts (20 errors) ==== + function foo() { + function f1(arguments: number, ...restParameters) { //arguments is error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + } + function f12(i: number, ...arguments) { //arguments is error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + var arguments: any[]; // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + } + function f1NoError(arguments: number) { // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + } + + function f3(...restParameters) { + var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + } + function f3NoError() { + var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + } + + function f4(arguments: number, ...rest); // no codegen no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + function f4(arguments: string, ...rest); // no codegen no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + function f4(arguments: any, ...rest) { // error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + var arguments: any; // No error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + } + function f42(i: number, ...arguments); // no codegen no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + function f42(i: string, ...arguments); // no codegen no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + function f42(i: any, ...arguments) { // error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + var arguments: any[]; // No error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + } + function f4NoError(arguments: number); // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + function f4NoError(arguments: string); // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + function f4NoError(arguments: any) { // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + var arguments: any; // No error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionArgumentsFunctionExpressions(target=es2015).js b/tests/baselines/reference/collisionArgumentsFunctionExpressions(target=es2015).js index eb8d260654f32..56a002496f761 100644 --- a/tests/baselines/reference/collisionArgumentsFunctionExpressions(target=es2015).js +++ b/tests/baselines/reference/collisionArgumentsFunctionExpressions(target=es2015).js @@ -37,6 +37,7 @@ function foo() { } //// [collisionArgumentsFunctionExpressions.js] +"use strict"; function foo() { function f1(arguments, ...restParameters) { var arguments = 10; // no error diff --git a/tests/baselines/reference/collisionArgumentsFunctionExpressions(target=es2015).types b/tests/baselines/reference/collisionArgumentsFunctionExpressions(target=es2015).types index 7cc3327ed029b..6ede79355c201 100644 --- a/tests/baselines/reference/collisionArgumentsFunctionExpressions(target=es2015).types +++ b/tests/baselines/reference/collisionArgumentsFunctionExpressions(target=es2015).types @@ -87,11 +87,13 @@ function foo() { >f4 : { (arguments: number, ...rest: any[]): any; (arguments: string, ...rest: any[]): any; } > : ^^^ ^^ ^^^^^ ^^^^^^^^^^^^^^^^ ^^ ^^^^^ ^^^^^^^^^^^^^^^^ >arguments : any +> : ^^^ >rest : any[] > : ^^^^^ var arguments: any; // No error >arguments : any +> : ^^^ } function f42(i: number, ...arguments); // no codegen no error >f42 : { (i: number, ...arguments: any[]): any; (i: string, ...arguments: any[]): any; } @@ -113,6 +115,7 @@ function foo() { >f42 : { (i: number, ...arguments: any[]): any; (i: string, ...arguments: any[]): any; } > : ^^^ ^^ ^^^^^ ^^^^^^^^^^^^^^^^ ^^ ^^^^^ ^^^^^^^^^^^^^^^^ >i : any +> : ^^^ >arguments : any[] > : ^^^^^ @@ -136,8 +139,10 @@ function foo() { >f4NoError : { (arguments: number): any; (arguments: string): any; } > : ^^^ ^^ ^^^^^^^^^ ^^ ^^^^^^^^^ >arguments : any +> : ^^^ var arguments: any; // No error >arguments : any +> : ^^^ } } diff --git a/tests/baselines/reference/collisionArgumentsFunctionExpressions(target=es5).errors.txt b/tests/baselines/reference/collisionArgumentsFunctionExpressions(target=es5).errors.txt index 4ff7bf7317155..ff231642568fc 100644 --- a/tests/baselines/reference/collisionArgumentsFunctionExpressions(target=es5).errors.txt +++ b/tests/baselines/reference/collisionArgumentsFunctionExpressions(target=es5).errors.txt @@ -1,51 +1,111 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +collisionArgumentsFunctionExpressions.ts(2,17): error TS1100: Invalid use of 'arguments' in strict mode. collisionArgumentsFunctionExpressions.ts(2,17): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +collisionArgumentsFunctionExpressions.ts(3,13): error TS1100: Invalid use of 'arguments' in strict mode. collisionArgumentsFunctionExpressions.ts(5,29): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +collisionArgumentsFunctionExpressions.ts(5,32): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunctionExpressions.ts(6,13): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunctionExpressions.ts(8,24): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunctionExpressions.ts(9,13): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunctionExpressions.ts(13,13): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunctionExpressions.ts(16,13): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunctionExpressions.ts(19,17): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunctionExpressions.ts(20,17): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunctionExpressions.ts(21,17): error TS1100: Invalid use of 'arguments' in strict mode. collisionArgumentsFunctionExpressions.ts(21,17): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +collisionArgumentsFunctionExpressions.ts(22,13): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunctionExpressions.ts(24,32): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunctionExpressions.ts(25,32): error TS1100: Invalid use of 'arguments' in strict mode. collisionArgumentsFunctionExpressions.ts(26,26): error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. +collisionArgumentsFunctionExpressions.ts(26,29): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunctionExpressions.ts(27,13): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunctionExpressions.ts(29,24): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunctionExpressions.ts(30,24): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunctionExpressions.ts(31,24): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsFunctionExpressions.ts(32,13): error TS1100: Invalid use of 'arguments' in strict mode. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== collisionArgumentsFunctionExpressions.ts (4 errors) ==== +==== collisionArgumentsFunctionExpressions.ts (24 errors) ==== function foo() { function f1(arguments: number, ...restParameters) { //arguments is error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. ~~~~~~~~~~~~~~~~~ !!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. } function f12(i: number, ...arguments) { //arguments is error ~~~~~~~~~~~~ !!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. var arguments: any[]; // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. } function f1NoError(arguments: number) { // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. } function f3(...restParameters) { var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. } function f3NoError() { var arguments = 10; // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. } function f4(arguments: number, ...rest); // no codegen no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. function f4(arguments: string, ...rest); // no codegen no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. function f4(arguments: any, ...rest) { // error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. ~~~~~~~~~~~~~~ !!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. var arguments: any; // No error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. } function f42(i: number, ...arguments); // no codegen no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. function f42(i: string, ...arguments); // no codegen no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. function f42(i: any, ...arguments) { // error ~~~~~~~~~~~~ !!! error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. var arguments: any[]; // No error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. } function f4NoError(arguments: number); // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. function f4NoError(arguments: string); // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. function f4NoError(arguments: any) { // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. var arguments: any; // No error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. } } \ No newline at end of file diff --git a/tests/baselines/reference/collisionArgumentsFunctionExpressions(target=es5).js b/tests/baselines/reference/collisionArgumentsFunctionExpressions(target=es5).js index 85bd9f641bd4b..c3f1ab3d7e216 100644 --- a/tests/baselines/reference/collisionArgumentsFunctionExpressions(target=es5).js +++ b/tests/baselines/reference/collisionArgumentsFunctionExpressions(target=es5).js @@ -37,6 +37,7 @@ function foo() { } //// [collisionArgumentsFunctionExpressions.js] +"use strict"; function foo() { function f1(arguments) { var restParameters = []; diff --git a/tests/baselines/reference/collisionArgumentsInType.errors.txt b/tests/baselines/reference/collisionArgumentsInType.errors.txt new file mode 100644 index 0000000000000..51a0a82db76ff --- /dev/null +++ b/tests/baselines/reference/collisionArgumentsInType.errors.txt @@ -0,0 +1,47 @@ +collisionArgumentsInType.ts(1,24): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsInType.ts(2,11): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsInType.ts(4,6): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsInType.ts(5,10): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsInType.ts(6,9): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsInType.ts(7,12): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsInType.ts(10,20): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsInType.ts(11,24): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsInType.ts(12,23): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsInType.ts(13,26): error TS1100: Invalid use of 'arguments' in strict mode. + + +==== collisionArgumentsInType.ts (10 errors) ==== + var v1: (i: number, ...arguments) => void; // no error - no code gen + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + var v12: (arguments: number, ...restParameters) => void; // no error - no code gen + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + var v2: { + (arguments: number, ...restParameters); // no error - no code gen + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + new (arguments: number, ...restParameters); // no error - no code gen + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + foo(arguments: number, ...restParameters); // no error - no code gen + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + prop: (arguments: number, ...restParameters) => void; // no error - no code gen + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + } + var v21: { + (i: number, ...arguments); // no error - no code gen + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + new (i: number, ...arguments); // no error - no code gen + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + foo(i: number, ...arguments); // no error - no code gen + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + prop: (i: number, ...arguments) => void; // no error - no code gen + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionArgumentsInType.js b/tests/baselines/reference/collisionArgumentsInType.js index 751e4d3a93a3b..492c227633bfb 100644 --- a/tests/baselines/reference/collisionArgumentsInType.js +++ b/tests/baselines/reference/collisionArgumentsInType.js @@ -17,6 +17,7 @@ var v21: { } //// [collisionArgumentsInType.js] +"use strict"; var v1; // no error - no code gen var v12; // no error - no code gen var v2; diff --git a/tests/baselines/reference/collisionArgumentsInterfaceMembers.errors.txt b/tests/baselines/reference/collisionArgumentsInterfaceMembers.errors.txt new file mode 100644 index 0000000000000..d7bbdbfb10074 --- /dev/null +++ b/tests/baselines/reference/collisionArgumentsInterfaceMembers.errors.txt @@ -0,0 +1,58 @@ +collisionArgumentsInterfaceMembers.ts(3,20): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsInterfaceMembers.ts(6,6): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsInterfaceMembers.ts(9,6): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsInterfaceMembers.ts(14,24): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsInterfaceMembers.ts(17,10): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsInterfaceMembers.ts(20,10): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsInterfaceMembers.ts(25,23): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsInterfaceMembers.ts(26,10): error TS1100: Invalid use of 'arguments' in strict mode. +collisionArgumentsInterfaceMembers.ts(27,16): error TS1100: Invalid use of 'arguments' in strict mode. + + +==== collisionArgumentsInterfaceMembers.ts (9 errors) ==== + // call + interface i1 { + (i: number, ...arguments); // no error - no code gen + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + } + interface i12 { + (arguments: number, ...rest); // no error - no code gen + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + } + interface i1NoError { + (arguments: number); // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + } + + // new + interface i2 { + new (i: number, ...arguments); // no error - no code gen + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + } + interface i21 { + new (arguments: number, ...rest); // no error - no code gen + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + } + interface i2NoError { + new (arguments: number); // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + } + + // method + interface i3 { + foo(i: number, ...arguments); // no error - no code gen + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + foo1(arguments: number, ...rest); // no error - no code gen + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + fooNoError(arguments: number); // no error + ~~~~~~~~~ +!!! error TS1100: Invalid use of 'arguments' in strict mode. + } \ No newline at end of file diff --git a/tests/baselines/reference/collisionArgumentsInterfaceMembers.js b/tests/baselines/reference/collisionArgumentsInterfaceMembers.js index f0a187da57d34..9ad7c0a9992c8 100644 --- a/tests/baselines/reference/collisionArgumentsInterfaceMembers.js +++ b/tests/baselines/reference/collisionArgumentsInterfaceMembers.js @@ -31,3 +31,4 @@ interface i3 { } //// [collisionArgumentsInterfaceMembers.js] +"use strict"; diff --git a/tests/baselines/reference/collisionCodeGenEnumWithEnumMemberConflict.js b/tests/baselines/reference/collisionCodeGenEnumWithEnumMemberConflict.js index 0a3fc345557a4..db9ced859276d 100644 --- a/tests/baselines/reference/collisionCodeGenEnumWithEnumMemberConflict.js +++ b/tests/baselines/reference/collisionCodeGenEnumWithEnumMemberConflict.js @@ -7,6 +7,7 @@ enum Color { } //// [collisionCodeGenEnumWithEnumMemberConflict.js] +"use strict"; var Color; (function (Color) { Color[Color["Color"] = 0] = "Color"; diff --git a/tests/baselines/reference/collisionCodeGenModuleWithAccessorChildren.js b/tests/baselines/reference/collisionCodeGenModuleWithAccessorChildren.js index 35ca530dd34bb..2052250c9975b 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithAccessorChildren.js +++ b/tests/baselines/reference/collisionCodeGenModuleWithAccessorChildren.js @@ -48,6 +48,7 @@ namespace M { // Shouldnt be _M } //// [collisionCodeGenModuleWithAccessorChildren.js] +"use strict"; var M; (function (M_1) { M_1.x = 3; diff --git a/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.js b/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.js index 4fd9633de9dd9..3dee15af33c86 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.js +++ b/tests/baselines/reference/collisionCodeGenModuleWithConstructorChildren.js @@ -26,6 +26,7 @@ namespace M { } //// [collisionCodeGenModuleWithConstructorChildren.js] +"use strict"; var M; (function (M_1) { M_1.x = 3; diff --git a/tests/baselines/reference/collisionCodeGenModuleWithEnumMemberConflict.js b/tests/baselines/reference/collisionCodeGenModuleWithEnumMemberConflict.js index 87c269378728d..991a6aae90a5d 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithEnumMemberConflict.js +++ b/tests/baselines/reference/collisionCodeGenModuleWithEnumMemberConflict.js @@ -9,6 +9,7 @@ namespace m1 { } //// [collisionCodeGenModuleWithEnumMemberConflict.js] +"use strict"; var m1; (function (m1) { let e; diff --git a/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.js b/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.js index bf299c3770f2d..120e53c7fbc4c 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.js +++ b/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.js @@ -22,6 +22,7 @@ namespace M { } //// [collisionCodeGenModuleWithFunctionChildren.js] +"use strict"; var M; (function (M_1) { M_1.x = 3; diff --git a/tests/baselines/reference/collisionCodeGenModuleWithMemberClassConflict.js b/tests/baselines/reference/collisionCodeGenModuleWithMemberClassConflict.js index dddc0610afcb8..50be269c34cd1 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithMemberClassConflict.js +++ b/tests/baselines/reference/collisionCodeGenModuleWithMemberClassConflict.js @@ -18,6 +18,7 @@ var foo = new m2.m2(); var foo = new m2._m2(); //// [collisionCodeGenModuleWithMemberClassConflict.js] +"use strict"; var m1; (function (m1_1) { class m1 { diff --git a/tests/baselines/reference/collisionCodeGenModuleWithMemberInterfaceConflict.js b/tests/baselines/reference/collisionCodeGenModuleWithMemberInterfaceConflict.js index 16ae9f7f87108..d6e9289718e29 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithMemberInterfaceConflict.js +++ b/tests/baselines/reference/collisionCodeGenModuleWithMemberInterfaceConflict.js @@ -10,6 +10,7 @@ namespace m1 { var foo = new m1.m2(); //// [collisionCodeGenModuleWithMemberInterfaceConflict.js] +"use strict"; var m1; (function (m1) { class m2 { diff --git a/tests/baselines/reference/collisionCodeGenModuleWithMemberVariable.js b/tests/baselines/reference/collisionCodeGenModuleWithMemberVariable.js index 023bf3a8d2abb..883944b0ccca8 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithMemberVariable.js +++ b/tests/baselines/reference/collisionCodeGenModuleWithMemberVariable.js @@ -8,6 +8,7 @@ namespace m1 { var foo = m1.m1; //// [collisionCodeGenModuleWithMemberVariable.js] +"use strict"; var m1; (function (m1_1) { m1_1.m1 = 10; diff --git a/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.js b/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.js index 9fca7c5f63516..0ee348f5f98c3 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.js +++ b/tests/baselines/reference/collisionCodeGenModuleWithMethodChildren.js @@ -35,6 +35,7 @@ namespace M { // Shouldnt bn _M } //// [collisionCodeGenModuleWithMethodChildren.js] +"use strict"; var M; (function (M_1) { M_1.x = 3; diff --git a/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.js b/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.js index f61889ae8ea93..951e90a2cd834 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.js +++ b/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.js @@ -45,6 +45,7 @@ namespace M { } //// [collisionCodeGenModuleWithModuleChildren.js] +"use strict"; var M; (function (M_1) { M_1.x = 3; diff --git a/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.js b/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.js index 7b1eace6d9d6c..e3fea9b0c90fa 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.js +++ b/tests/baselines/reference/collisionCodeGenModuleWithModuleReopening.js @@ -32,6 +32,7 @@ var foo3 = new m2.c1(); var foo2 = new m2.m2(); //// [collisionCodeGenModuleWithModuleReopening.js] +"use strict"; var m1; (function (m1_1) { class m1 { diff --git a/tests/baselines/reference/collisionCodeGenModuleWithPrivateMember.js b/tests/baselines/reference/collisionCodeGenModuleWithPrivateMember.js index 26d1cea4f7bb0..4e6291b571631 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithPrivateMember.js +++ b/tests/baselines/reference/collisionCodeGenModuleWithPrivateMember.js @@ -11,6 +11,7 @@ namespace m1 { var foo = new m1.c1(); //// [collisionCodeGenModuleWithPrivateMember.js] +"use strict"; var m1; (function (m1_1) { class m1 { diff --git a/tests/baselines/reference/collisionCodeGenModuleWithUnicodeNames.js b/tests/baselines/reference/collisionCodeGenModuleWithUnicodeNames.js index f702ecbe87880..a7228650a6a1e 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithUnicodeNames.js +++ b/tests/baselines/reference/collisionCodeGenModuleWithUnicodeNames.js @@ -12,6 +12,7 @@ var x = new 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكو //// [collisionCodeGenModuleWithUnicodeNames.js] +"use strict"; var 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123; (function (才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123_1) { class 才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüß才能ソЫⅨ蒤郳र्क्ड्राüışğİliيونيكودöÄüßAbcd123 { diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientClass.js b/tests/baselines/reference/collisionExportsRequireAndAmbientClass.js index 0cb05d30de00f..4f03daba883c1 100644 --- a/tests/baselines/reference/collisionExportsRequireAndAmbientClass.js +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientClass.js @@ -44,6 +44,7 @@ var m2; (function (m2) { })(m2 || (m2 = {})); //// [collisionExportsRequireAndAmbientClass_globalFile.js] +"use strict"; var m4; (function (m4) { var a = 10; diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientEnum.js b/tests/baselines/reference/collisionExportsRequireAndAmbientEnum.js index b079a99993eae..f948b9abbc23f 100644 --- a/tests/baselines/reference/collisionExportsRequireAndAmbientEnum.js +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientEnum.js @@ -67,6 +67,7 @@ var m2; (function (m2) { })(m2 || (m2 = {})); //// [collisionExportsRequireAndAmbientEnum_globalFile.js] +"use strict"; var m4; (function (m4) { })(m4 || (m4 = {})); diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientFunctionInGlobalFile.js b/tests/baselines/reference/collisionExportsRequireAndAmbientFunctionInGlobalFile.js index 4cc03dfa7b4c0..0c324b759a6f2 100644 --- a/tests/baselines/reference/collisionExportsRequireAndAmbientFunctionInGlobalFile.js +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientFunctionInGlobalFile.js @@ -14,6 +14,7 @@ namespace m4 { } //// [collisionExportsRequireAndAmbientFunctionInGlobalFile.js] +"use strict"; var m4; (function (m4) { var a = 10; diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientModule.errors.txt b/tests/baselines/reference/collisionExportsRequireAndAmbientModule.errors.txt new file mode 100644 index 0000000000000..513986f602d11 --- /dev/null +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientModule.errors.txt @@ -0,0 +1,101 @@ +collisionExportsRequireAndAmbientModule_externalmodule.ts(8,5): error TS2322: Type 'null' is not assignable to type 'I'. +collisionExportsRequireAndAmbientModule_externalmodule.ts(17,5): error TS2322: Type 'null' is not assignable to type 'I'. + + +==== collisionExportsRequireAndAmbientModule_externalmodule.ts (2 errors) ==== + export declare namespace require { + export interface I { + } + export class C { + } + } + export function foo(): require.I { + return null; + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'I'. + } + export declare namespace exports { + export interface I { + } + export class C { + } + } + export function foo2(): exports.I { + return null; + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'I'. + } + declare namespace m1 { + namespace require { + export interface I { + } + export class C { + } + } + namespace exports { + export interface I { + } + export class C { + } + } + } + namespace m2 { + export declare namespace require { + export interface I { + } + export class C { + } + } + export declare namespace exports { + export interface I { + } + export class C { + } + } + var a = 10; + } + +==== collisionExportsRequireAndAmbientModule_globalFile.ts (0 errors) ==== + declare namespace require { + export interface I { + } + export class C { + } + } + declare namespace exports { + export interface I { + } + export class C { + } + } + declare namespace m3 { + namespace require { + export interface I { + } + export class C { + } + } + namespace exports { + export interface I { + } + export class C { + } + } + } + namespace m4 { + export declare namespace require { + export interface I { + } + export class C { + } + } + export declare namespace exports { + export interface I { + } + export class C { + } + } + + var a = 10; + } + \ No newline at end of file diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientModule.js b/tests/baselines/reference/collisionExportsRequireAndAmbientModule.js index ef3e16eeca09a..0332fb9ee2b51 100644 --- a/tests/baselines/reference/collisionExportsRequireAndAmbientModule.js +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientModule.js @@ -110,6 +110,7 @@ var m2; var a = 10; })(m2 || (m2 = {})); //// [collisionExportsRequireAndAmbientModule_globalFile.js] +"use strict"; var m4; (function (m4) { var a = 10; diff --git a/tests/baselines/reference/collisionExportsRequireAndAmbientVar.js b/tests/baselines/reference/collisionExportsRequireAndAmbientVar.js index 273cee0d2e37e..8cf6f9924f406 100644 --- a/tests/baselines/reference/collisionExportsRequireAndAmbientVar.js +++ b/tests/baselines/reference/collisionExportsRequireAndAmbientVar.js @@ -34,6 +34,7 @@ var m2; var a = 10; })(m2 || (m2 = {})); //// [collisionExportsRequireAndAmbientVar_globalFile.js] +"use strict"; var m4; (function (m4) { var a = 10; diff --git a/tests/baselines/reference/collisionExportsRequireAndClass.js b/tests/baselines/reference/collisionExportsRequireAndClass.js index b2350d84c9a00..67ea17becd019 100644 --- a/tests/baselines/reference/collisionExportsRequireAndClass.js +++ b/tests/baselines/reference/collisionExportsRequireAndClass.js @@ -65,6 +65,7 @@ define(["require", "exports"], function (require, exports) { })(m2 || (m2 = {})); }); //// [collisionExportsRequireAndClass_globalFile.js] +"use strict"; class require { } class exports { diff --git a/tests/baselines/reference/collisionExportsRequireAndEnum.js b/tests/baselines/reference/collisionExportsRequireAndEnum.js index 77223ed7e017e..4b2d055e115a9 100644 --- a/tests/baselines/reference/collisionExportsRequireAndEnum.js +++ b/tests/baselines/reference/collisionExportsRequireAndEnum.js @@ -103,6 +103,7 @@ define(["require", "exports"], function (require, exports) { })(m2 || (m2 = {})); }); //// [collisionExportsRequireAndEnum_globalFile.js] +"use strict"; var require; (function (require) { require[require["_thisVal1"] = 0] = "_thisVal1"; diff --git a/tests/baselines/reference/collisionExportsRequireAndFunctionInGlobalFile.js b/tests/baselines/reference/collisionExportsRequireAndFunctionInGlobalFile.js index b0b37f66d4add..473dc99762e57 100644 --- a/tests/baselines/reference/collisionExportsRequireAndFunctionInGlobalFile.js +++ b/tests/baselines/reference/collisionExportsRequireAndFunctionInGlobalFile.js @@ -25,6 +25,7 @@ namespace m4 { } //// [collisionExportsRequireAndFunctionInGlobalFile.js] +"use strict"; function exports() { return 1; } diff --git a/tests/baselines/reference/collisionExportsRequireAndInternalModuleAliasInGlobalFile.js b/tests/baselines/reference/collisionExportsRequireAndInternalModuleAliasInGlobalFile.js index b4b3ffc2647e0..adfe395500fa7 100644 --- a/tests/baselines/reference/collisionExportsRequireAndInternalModuleAliasInGlobalFile.js +++ b/tests/baselines/reference/collisionExportsRequireAndInternalModuleAliasInGlobalFile.js @@ -25,6 +25,7 @@ namespace m2 { } //// [collisionExportsRequireAndInternalModuleAliasInGlobalFile.js] +"use strict"; var mOfGloalFile; (function (mOfGloalFile) { class c { diff --git a/tests/baselines/reference/collisionExportsRequireAndModule.errors.txt b/tests/baselines/reference/collisionExportsRequireAndModule.errors.txt index 4047235cb1366..e08a2ca04be16 100644 --- a/tests/baselines/reference/collisionExportsRequireAndModule.errors.txt +++ b/tests/baselines/reference/collisionExportsRequireAndModule.errors.txt @@ -1,10 +1,12 @@ error TS5107: Option 'module=AMD' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. collisionExportsRequireAndModule_externalmodule.ts(1,18): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. +collisionExportsRequireAndModule_externalmodule.ts(8,5): error TS2322: Type 'null' is not assignable to type 'I'. collisionExportsRequireAndModule_externalmodule.ts(10,18): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. +collisionExportsRequireAndModule_externalmodule.ts(17,5): error TS2322: Type 'null' is not assignable to type 'I'. !!! error TS5107: Option 'module=AMD' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== collisionExportsRequireAndModule_externalmodule.ts (2 errors) ==== +==== collisionExportsRequireAndModule_externalmodule.ts (4 errors) ==== export namespace require { ~~~~~~~ !!! error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. @@ -15,6 +17,8 @@ collisionExportsRequireAndModule_externalmodule.ts(10,18): error TS2441: Duplica } export function foo(): require.I { return null; + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'I'. } export namespace exports { ~~~~~~~ @@ -26,6 +30,8 @@ collisionExportsRequireAndModule_externalmodule.ts(10,18): error TS2441: Duplica } export function foo2(): exports.I { return null; + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'I'. } namespace m1 { namespace require { diff --git a/tests/baselines/reference/collisionExportsRequireAndModule.js b/tests/baselines/reference/collisionExportsRequireAndModule.js index 2053376d7d8e6..b51bddbfb66c4 100644 --- a/tests/baselines/reference/collisionExportsRequireAndModule.js +++ b/tests/baselines/reference/collisionExportsRequireAndModule.js @@ -148,6 +148,7 @@ define(["require", "exports"], function (require, exports) { })(m2 || (m2 = {})); }); //// [collisionExportsRequireAndModule_globalFile.js] +"use strict"; var require; (function (require) { class C { diff --git a/tests/baselines/reference/collisionExportsRequireAndUninstantiatedModule.errors.txt b/tests/baselines/reference/collisionExportsRequireAndUninstantiatedModule.errors.txt index b74aa3662bb84..266991d0bdbd9 100644 --- a/tests/baselines/reference/collisionExportsRequireAndUninstantiatedModule.errors.txt +++ b/tests/baselines/reference/collisionExportsRequireAndUninstantiatedModule.errors.txt @@ -1,14 +1,18 @@ error TS5107: Option 'module=AMD' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +collisionExportsRequireAndUninstantiatedModule.ts(6,5): error TS2322: Type 'null' is not assignable to type 'I'. +collisionExportsRequireAndUninstantiatedModule.ts(13,5): error TS2322: Type 'null' is not assignable to type 'I'. !!! error TS5107: Option 'module=AMD' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== collisionExportsRequireAndUninstantiatedModule.ts (0 errors) ==== +==== collisionExportsRequireAndUninstantiatedModule.ts (2 errors) ==== export namespace require { // no error export interface I { } } export function foo(): require.I { return null; + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'I'. } export namespace exports { // no error export interface I { @@ -16,4 +20,6 @@ error TS5107: Option 'module=AMD' is deprecated and will stop functioning in Typ } export function foo2(): exports.I { return null; + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'I'. } \ No newline at end of file diff --git a/tests/baselines/reference/collisionExportsRequireAndVar.js b/tests/baselines/reference/collisionExportsRequireAndVar.js index 4539468400565..fbc1bf21a055a 100644 --- a/tests/baselines/reference/collisionExportsRequireAndVar.js +++ b/tests/baselines/reference/collisionExportsRequireAndVar.js @@ -47,6 +47,7 @@ define(["require", "exports"], function (require, exports) { })(m2 || (m2 = {})); }); //// [collisionExportsRequireAndVar_globalFile.js] +"use strict"; var exports = 0; var require = "require"; var m3; diff --git a/tests/baselines/reference/collisionRestParameterArrowFunctions.js b/tests/baselines/reference/collisionRestParameterArrowFunctions.js index 60a9748eb3ed1..4dd29de5cdeb3 100644 --- a/tests/baselines/reference/collisionRestParameterArrowFunctions.js +++ b/tests/baselines/reference/collisionRestParameterArrowFunctions.js @@ -16,6 +16,7 @@ var f2NoError = () => { } //// [collisionRestParameterArrowFunctions.js] +"use strict"; var f1 = (_i, ...restParameters) => { var _i = 10; // no error }; diff --git a/tests/baselines/reference/collisionRestParameterClassConstructor.js b/tests/baselines/reference/collisionRestParameterClassConstructor.js index 0a8d0efd19b49..8a3db67a8203a 100644 --- a/tests/baselines/reference/collisionRestParameterClassConstructor.js +++ b/tests/baselines/reference/collisionRestParameterClassConstructor.js @@ -69,6 +69,7 @@ declare class c6NoError { } //// [collisionRestParameterClassConstructor.js] +"use strict"; // Constructors class c1 { constructor(_i, ...restParameters) { diff --git a/tests/baselines/reference/collisionRestParameterClassMethod.js b/tests/baselines/reference/collisionRestParameterClassMethod.js index 7bd52dcb479f1..0100d47103ec9 100644 --- a/tests/baselines/reference/collisionRestParameterClassMethod.js +++ b/tests/baselines/reference/collisionRestParameterClassMethod.js @@ -41,6 +41,7 @@ class c3 { } //// [collisionRestParameterClassMethod.js] +"use strict"; class c1 { foo(_i, ...restParameters) { var _i = 10; // no error diff --git a/tests/baselines/reference/collisionRestParameterFunction.js b/tests/baselines/reference/collisionRestParameterFunction.js index 4437c9b88c11f..d82fb785aac4a 100644 --- a/tests/baselines/reference/collisionRestParameterFunction.js +++ b/tests/baselines/reference/collisionRestParameterFunction.js @@ -36,6 +36,7 @@ declare function f6(_i: number); // no codegen no error declare function f6(_i: string); // no codegen no error //// [collisionRestParameterFunction.js] +"use strict"; // Functions function f1(_i, ...restParameters) { var _i = 10; // no error diff --git a/tests/baselines/reference/collisionRestParameterFunctionExpressions.js b/tests/baselines/reference/collisionRestParameterFunctionExpressions.js index 76a61a18b75c0..c0f6d68e2c250 100644 --- a/tests/baselines/reference/collisionRestParameterFunctionExpressions.js +++ b/tests/baselines/reference/collisionRestParameterFunctionExpressions.js @@ -27,6 +27,7 @@ function foo() { } //// [collisionRestParameterFunctionExpressions.js] +"use strict"; function foo() { function f1(_i, ...restParameters) { var _i = 10; // no error diff --git a/tests/baselines/reference/collisionRestParameterInType.js b/tests/baselines/reference/collisionRestParameterInType.js index 840a38be922b6..5d28e09fa66a7 100644 --- a/tests/baselines/reference/collisionRestParameterInType.js +++ b/tests/baselines/reference/collisionRestParameterInType.js @@ -10,5 +10,6 @@ var v2: { } //// [collisionRestParameterInType.js] +"use strict"; var v1; // no error - no code gen var v2; diff --git a/tests/baselines/reference/collisionRestParameterInterfaceMembers.js b/tests/baselines/reference/collisionRestParameterInterfaceMembers.js index 1429dbcb21370..ea5a0b92b33b9 100644 --- a/tests/baselines/reference/collisionRestParameterInterfaceMembers.js +++ b/tests/baselines/reference/collisionRestParameterInterfaceMembers.js @@ -24,3 +24,4 @@ interface i3 { } //// [collisionRestParameterInterfaceMembers.js] +"use strict"; diff --git a/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.js b/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.js index acebf044be207..4b4922e89a754 100644 --- a/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.js +++ b/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.js @@ -11,6 +11,7 @@ class Foo { new Foo(); //// [collisionRestParameterUnderscoreIUsage.js] +"use strict"; var _i = "This is what I'd expect to see"; class Foo { constructor(...args) { diff --git a/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.types b/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.types index 6697ef9c28c26..a48352522d884 100644 --- a/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.types +++ b/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.types @@ -6,8 +6,8 @@ declare var console: { log(msg?: string): void; }; > : ^^^^^^ ^^^ ^^^ ^^^ >log : (msg?: string) => void > : ^ ^^^ ^^^^^ ->msg : string -> : ^^^^^^ +>msg : string | undefined +> : ^^^^^^^^^^^^^^^^^^ var _i = "This is what I'd expect to see"; >_i : string diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors(target=es2015).js b/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors(target=es2015).js index 1dcb193b07fe1..514835e08c333 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors(target=es2015).js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors(target=es2015).js @@ -42,6 +42,7 @@ class c extends Foo { } //// [collisionSuperAndLocalFunctionInAccessors.js] +"use strict"; function _super() { } class Foo { diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors(target=es5).js b/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors(target=es5).js index d7d3521ccfd90..e06687c483541 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors(target=es5).js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors(target=es5).js @@ -42,6 +42,7 @@ class c extends Foo { } //// [collisionSuperAndLocalFunctionInAccessors.js] +"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js index 4cdd329fc1395..0bc4596b0031a 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js @@ -27,6 +27,7 @@ class c extends Foo { } //// [collisionSuperAndLocalFunctionInConstructor.js] +"use strict"; function _super() { } class Foo { diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.js index e622d6e27902d..f8574f6d3a20f 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.js @@ -31,6 +31,7 @@ class c extends Foo { } //// [collisionSuperAndLocalFunctionInMethod.js] +"use strict"; function _super() { } class Foo { diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js index a737585c8304a..2a52b820aaa06 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js @@ -21,6 +21,7 @@ class b extends Foo { } //// [collisionSuperAndLocalFunctionInProperty.js] +"use strict"; function _super() { } class Foo { diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInAccessors(target=es2015).js b/tests/baselines/reference/collisionSuperAndLocalVarInAccessors(target=es2015).js index 0c29b8ae44040..0321392caaf56 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInAccessors(target=es2015).js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInAccessors(target=es2015).js @@ -35,6 +35,7 @@ class c extends Foo { } //// [collisionSuperAndLocalVarInAccessors.js] +"use strict"; var _super = 10; // No Error class Foo { get prop1() { diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInAccessors(target=es5).js b/tests/baselines/reference/collisionSuperAndLocalVarInAccessors(target=es5).js index 2eb4f2ee53360..2bb8e8085d8f0 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInAccessors(target=es5).js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInAccessors(target=es5).js @@ -35,6 +35,7 @@ class c extends Foo { } //// [collisionSuperAndLocalVarInAccessors.js] +"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js b/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js index bb3809f8cbabe..04ac80de97252 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js @@ -23,6 +23,7 @@ class c extends Foo { } //// [collisionSuperAndLocalVarInConstructor.js] +"use strict"; var _super = 10; // No Error class Foo { constructor() { diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js b/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js index 06660f59b8001..df1758d13c9dc 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js @@ -21,6 +21,7 @@ class c extends Foo { } //// [collisionSuperAndLocalVarInMethod.js] +"use strict"; var _super = 10; // No Error class Foo { x() { diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js b/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js index 599444cddd194..5e21202d62bc9 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js @@ -20,6 +20,7 @@ class b extends Foo { } //// [collisionSuperAndLocalVarInProperty.js] +"use strict"; var _super = 10; // No Error class Foo { constructor() { diff --git a/tests/baselines/reference/collisionSuperAndNameResolution.js b/tests/baselines/reference/collisionSuperAndNameResolution.js index fd66445aa0a94..16530528587a8 100644 --- a/tests/baselines/reference/collisionSuperAndNameResolution.js +++ b/tests/baselines/reference/collisionSuperAndNameResolution.js @@ -14,6 +14,7 @@ class Foo extends base { } //// [collisionSuperAndNameResolution.js] +"use strict"; var console; var _super = 10; // No error class base { diff --git a/tests/baselines/reference/collisionSuperAndParameter(target=es2015).js b/tests/baselines/reference/collisionSuperAndParameter(target=es2015).js index cfabd0ddfd13b..17d9b5c2f845a 100644 --- a/tests/baselines/reference/collisionSuperAndParameter(target=es2015).js +++ b/tests/baselines/reference/collisionSuperAndParameter(target=es2015).js @@ -65,6 +65,7 @@ class Foo4 extends Foo { } //// [collisionSuperAndParameter.js] +"use strict"; class Foo { a() { var lamda = (_super) => { diff --git a/tests/baselines/reference/collisionSuperAndParameter(target=es5).js b/tests/baselines/reference/collisionSuperAndParameter(target=es5).js index fc3705bbc3df2..d75b60586c65d 100644 --- a/tests/baselines/reference/collisionSuperAndParameter(target=es5).js +++ b/tests/baselines/reference/collisionSuperAndParameter(target=es5).js @@ -65,6 +65,7 @@ class Foo4 extends Foo { } //// [collisionSuperAndParameter.js] +"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || diff --git a/tests/baselines/reference/collisionSuperAndParameter1.js b/tests/baselines/reference/collisionSuperAndParameter1.js index 57da6b8a16ef9..484d3a334cce0 100644 --- a/tests/baselines/reference/collisionSuperAndParameter1.js +++ b/tests/baselines/reference/collisionSuperAndParameter1.js @@ -12,6 +12,7 @@ class Foo2 extends Foo { } //// [collisionSuperAndParameter1.js] +"use strict"; class Foo { } class Foo2 extends Foo { diff --git a/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js b/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js index 3fcc3b64e37fa..962556696ca9f 100644 --- a/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js +++ b/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js @@ -33,6 +33,7 @@ class b4 extends a { } //// [collisionSuperAndPropertyNameAsConstuctorParameter.js] +"use strict"; class a { } class b1 extends a { diff --git a/tests/baselines/reference/collisionThisExpressionAndAliasInGlobal.js b/tests/baselines/reference/collisionThisExpressionAndAliasInGlobal.js index 3c6ed0ff92863..7edca36388e91 100644 --- a/tests/baselines/reference/collisionThisExpressionAndAliasInGlobal.js +++ b/tests/baselines/reference/collisionThisExpressionAndAliasInGlobal.js @@ -8,6 +8,7 @@ var f = () => this; import _this = a; // Error //// [collisionThisExpressionAndAliasInGlobal.js] +"use strict"; var a; (function (a) { a.b = 10; diff --git a/tests/baselines/reference/collisionThisExpressionAndAmbientClassInGlobal.js b/tests/baselines/reference/collisionThisExpressionAndAmbientClassInGlobal.js index 98b997b31d488..090ea9e8e538c 100644 --- a/tests/baselines/reference/collisionThisExpressionAndAmbientClassInGlobal.js +++ b/tests/baselines/reference/collisionThisExpressionAndAmbientClassInGlobal.js @@ -7,5 +7,6 @@ var f = () => this; var a = new _this(); // Error //// [collisionThisExpressionAndAmbientClassInGlobal.js] +"use strict"; var f = () => this; var a = new _this(); // Error diff --git a/tests/baselines/reference/collisionThisExpressionAndAmbientVarInGlobal.js b/tests/baselines/reference/collisionThisExpressionAndAmbientVarInGlobal.js index 8cb07e166bb23..f823d8e6197d8 100644 --- a/tests/baselines/reference/collisionThisExpressionAndAmbientVarInGlobal.js +++ b/tests/baselines/reference/collisionThisExpressionAndAmbientVarInGlobal.js @@ -6,5 +6,6 @@ var f = () => this; _this = 10; // Error //// [collisionThisExpressionAndAmbientVarInGlobal.js] +"use strict"; var f = () => this; _this = 10; // Error diff --git a/tests/baselines/reference/collisionThisExpressionAndClassInGlobal.js b/tests/baselines/reference/collisionThisExpressionAndClassInGlobal.js index e863abb3f1087..2eeda7bd260be 100644 --- a/tests/baselines/reference/collisionThisExpressionAndClassInGlobal.js +++ b/tests/baselines/reference/collisionThisExpressionAndClassInGlobal.js @@ -6,6 +6,7 @@ class _this { var f = () => this; //// [collisionThisExpressionAndClassInGlobal.js] +"use strict"; class _this { } var f = () => this; diff --git a/tests/baselines/reference/collisionThisExpressionAndEnumInGlobal.js b/tests/baselines/reference/collisionThisExpressionAndEnumInGlobal.js index d5f13a790b899..d0f2c6a06b690 100644 --- a/tests/baselines/reference/collisionThisExpressionAndEnumInGlobal.js +++ b/tests/baselines/reference/collisionThisExpressionAndEnumInGlobal.js @@ -8,6 +8,7 @@ enum _this { // Error var f = () => this; //// [collisionThisExpressionAndEnumInGlobal.js] +"use strict"; var _this; (function (_this) { _this[_this["_thisVal1"] = 0] = "_thisVal1"; diff --git a/tests/baselines/reference/collisionThisExpressionAndFunctionInGlobal.js b/tests/baselines/reference/collisionThisExpressionAndFunctionInGlobal.js index 925c25a2e0c34..9021e660d29b2 100644 --- a/tests/baselines/reference/collisionThisExpressionAndFunctionInGlobal.js +++ b/tests/baselines/reference/collisionThisExpressionAndFunctionInGlobal.js @@ -7,6 +7,7 @@ function _this() { //Error var f = () => this; //// [collisionThisExpressionAndFunctionInGlobal.js] +"use strict"; function _this() { return 10; } diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarInAccessors(target=es2015).js b/tests/baselines/reference/collisionThisExpressionAndLocalVarInAccessors(target=es2015).js index 0669546ebcc55..9a58529bf6675 100644 --- a/tests/baselines/reference/collisionThisExpressionAndLocalVarInAccessors(target=es2015).js +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarInAccessors(target=es2015).js @@ -46,6 +46,7 @@ class class2 { } //// [collisionThisExpressionAndLocalVarInAccessors.js] +"use strict"; class class1 { get a() { var x2 = { diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarInAccessors(target=es5).js b/tests/baselines/reference/collisionThisExpressionAndLocalVarInAccessors(target=es5).js index cf0a52a959cc1..659c60b45eb6b 100644 --- a/tests/baselines/reference/collisionThisExpressionAndLocalVarInAccessors(target=es5).js +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarInAccessors(target=es5).js @@ -46,6 +46,7 @@ class class2 { } //// [collisionThisExpressionAndLocalVarInAccessors.js] +"use strict"; var class1 = /** @class */ (function () { function class1() { } diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarInConstructor.js b/tests/baselines/reference/collisionThisExpressionAndLocalVarInConstructor.js index 09b24e1076b9a..f066e9087313a 100644 --- a/tests/baselines/reference/collisionThisExpressionAndLocalVarInConstructor.js +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarInConstructor.js @@ -24,6 +24,7 @@ class class2 { } //// [collisionThisExpressionAndLocalVarInConstructor.js] +"use strict"; class class1 { constructor() { var x2 = { diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarInFunction.js b/tests/baselines/reference/collisionThisExpressionAndLocalVarInFunction.js index 910f9012b0bb0..02632e0f3e321 100644 --- a/tests/baselines/reference/collisionThisExpressionAndLocalVarInFunction.js +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarInFunction.js @@ -10,6 +10,7 @@ function x() { } //// [collisionThisExpressionAndLocalVarInFunction.js] +"use strict"; var console; function x() { var _this = 5; diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarInLambda.js b/tests/baselines/reference/collisionThisExpressionAndLocalVarInLambda.js index 24287136090cc..0b9858300fb4c 100644 --- a/tests/baselines/reference/collisionThisExpressionAndLocalVarInLambda.js +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarInLambda.js @@ -12,6 +12,7 @@ var x = { alert(x.doStuff(x => alert(x))); //// [collisionThisExpressionAndLocalVarInLambda.js] +"use strict"; var x = { doStuff: (callback) => () => { var _this = 2; diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarInMethod.js b/tests/baselines/reference/collisionThisExpressionAndLocalVarInMethod.js index 5b6eb5ab35537..ff0a5c48d1466 100644 --- a/tests/baselines/reference/collisionThisExpressionAndLocalVarInMethod.js +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarInMethod.js @@ -21,6 +21,7 @@ class a { } //// [collisionThisExpressionAndLocalVarInMethod.js] +"use strict"; class a { method1() { return { diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarInProperty.js b/tests/baselines/reference/collisionThisExpressionAndLocalVarInProperty.js index fb70f62a99cdd..5fd745349dc93 100644 --- a/tests/baselines/reference/collisionThisExpressionAndLocalVarInProperty.js +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarInProperty.js @@ -22,6 +22,7 @@ class class2 { } //// [collisionThisExpressionAndLocalVarInProperty.js] +"use strict"; class class1 { constructor() { this.prop1 = { diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js b/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js index 7db94d5e494b9..baf1d1b9f1917 100644 --- a/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js @@ -21,6 +21,7 @@ class b2 extends a { } //// [collisionThisExpressionAndLocalVarWithSuperExperssion.js] +"use strict"; class a { foo() { } diff --git a/tests/baselines/reference/collisionThisExpressionAndModuleInGlobal.js b/tests/baselines/reference/collisionThisExpressionAndModuleInGlobal.js index e3041a647c85f..289cc78938e5a 100644 --- a/tests/baselines/reference/collisionThisExpressionAndModuleInGlobal.js +++ b/tests/baselines/reference/collisionThisExpressionAndModuleInGlobal.js @@ -8,6 +8,7 @@ namespace _this { //Error var f = () => this; //// [collisionThisExpressionAndModuleInGlobal.js] +"use strict"; var _this; (function (_this) { class c { diff --git a/tests/baselines/reference/collisionThisExpressionAndNameResolution.js b/tests/baselines/reference/collisionThisExpressionAndNameResolution.js index 63a5b3082cc1a..d826de863d19f 100644 --- a/tests/baselines/reference/collisionThisExpressionAndNameResolution.js +++ b/tests/baselines/reference/collisionThisExpressionAndNameResolution.js @@ -15,6 +15,7 @@ class Foo { } //// [collisionThisExpressionAndNameResolution.js] +"use strict"; var console; class Foo { x() { diff --git a/tests/baselines/reference/collisionThisExpressionAndParameter.js b/tests/baselines/reference/collisionThisExpressionAndParameter.js index f81dc298b30e5..3f67820bde3b1 100644 --- a/tests/baselines/reference/collisionThisExpressionAndParameter.js +++ b/tests/baselines/reference/collisionThisExpressionAndParameter.js @@ -96,6 +96,7 @@ declare function f4(_this: number); // no code gen - no error declare function f4(_this: string); // no code gen - no error //// [collisionThisExpressionAndParameter.js] +"use strict"; class Foo { x() { var _this = 10; // Local var. No this capture in x(), so no conflict. diff --git a/tests/baselines/reference/collisionThisExpressionAndPropertyNameAsConstuctorParameter.js b/tests/baselines/reference/collisionThisExpressionAndPropertyNameAsConstuctorParameter.js index 26ac71b32ddd8..b0ff487ecee51 100644 --- a/tests/baselines/reference/collisionThisExpressionAndPropertyNameAsConstuctorParameter.js +++ b/tests/baselines/reference/collisionThisExpressionAndPropertyNameAsConstuctorParameter.js @@ -38,6 +38,7 @@ class Foo5 { } //// [collisionThisExpressionAndPropertyNameAsConstuctorParameter.js] +"use strict"; class Foo2 { constructor(_this) { var lambda = () => { diff --git a/tests/baselines/reference/collisionThisExpressionAndVarInGlobal.js b/tests/baselines/reference/collisionThisExpressionAndVarInGlobal.js index 4be34994459e0..43f654dbd441e 100644 --- a/tests/baselines/reference/collisionThisExpressionAndVarInGlobal.js +++ b/tests/baselines/reference/collisionThisExpressionAndVarInGlobal.js @@ -5,5 +5,6 @@ var _this = 1; var f = () => this; //// [collisionThisExpressionAndVarInGlobal.js] +"use strict"; var _this = 1; var f = () => this; diff --git a/tests/baselines/reference/commaOperator1.js b/tests/baselines/reference/commaOperator1.js index 68613dfe26e64..28dc869fe8bac 100644 --- a/tests/baselines/reference/commaOperator1.js +++ b/tests/baselines/reference/commaOperator1.js @@ -9,6 +9,7 @@ function f1() { //// [commaOperator1.js] +"use strict"; var v1 = ((1, 2, 3), 4, 5, (6, 7)); function f1() { var a = 1; diff --git a/tests/baselines/reference/commaOperatorInConditionalExpression.js b/tests/baselines/reference/commaOperatorInConditionalExpression.js index 878d8777c0ce9..9e22dd5a01939 100644 --- a/tests/baselines/reference/commaOperatorInConditionalExpression.js +++ b/tests/baselines/reference/commaOperatorInConditionalExpression.js @@ -8,6 +8,7 @@ function f (m: string) { } //// [commaOperatorInConditionalExpression.js] +"use strict"; function f(m) { [1, 2, 3].map(i => { return true ? { [m]: i } : { [m]: i + 1 }; diff --git a/tests/baselines/reference/commaOperatorInvalidAssignmentType.js b/tests/baselines/reference/commaOperatorInvalidAssignmentType.js index c89be5e429951..ea2a591fe01cf 100644 --- a/tests/baselines/reference/commaOperatorInvalidAssignmentType.js +++ b/tests/baselines/reference/commaOperatorInvalidAssignmentType.js @@ -21,6 +21,7 @@ resultIsString = (STRING, NUMBER); //// [commaOperatorInvalidAssignmentType.js] +"use strict"; //Expect errors when the results type is different form the second operand resultIsBoolean = (BOOLEAN, STRING); resultIsBoolean = (BOOLEAN, NUMBER); diff --git a/tests/baselines/reference/commaOperatorLeftSideUnused.js b/tests/baselines/reference/commaOperatorLeftSideUnused.js index b416a2692e829..5a6d727ca12be 100644 --- a/tests/baselines/reference/commaOperatorLeftSideUnused.js +++ b/tests/baselines/reference/commaOperatorLeftSideUnused.js @@ -59,6 +59,7 @@ xx = (0, xx['fn'])(); xx = (0, xx.fn)``; //// [commaOperatorLeftSideUnused.js] +"use strict"; var xx; var yy; function fn() { diff --git a/tests/baselines/reference/commaOperatorLeftSideUnused.types b/tests/baselines/reference/commaOperatorLeftSideUnused.types index cedcd7377fef3..9ef46d36ade10 100644 --- a/tests/baselines/reference/commaOperatorLeftSideUnused.types +++ b/tests/baselines/reference/commaOperatorLeftSideUnused.types @@ -16,8 +16,8 @@ function fn() { let arr: any[] = []; >arr : any[] > : ^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ switch(arr.length) { >arr.length : number diff --git a/tests/baselines/reference/commaOperatorOtherInvalidOperation.errors.txt b/tests/baselines/reference/commaOperatorOtherInvalidOperation.errors.txt index 5bf3000cb5a93..d44d59c49c5a8 100644 --- a/tests/baselines/reference/commaOperatorOtherInvalidOperation.errors.txt +++ b/tests/baselines/reference/commaOperatorOtherInvalidOperation.errors.txt @@ -1,9 +1,11 @@ commaOperatorOtherInvalidOperation.ts(6,5): error TS2322: Type 'string' is not assignable to type 'number'. commaOperatorOtherInvalidOperation.ts(12,9): error TS2322: Type 'T2' is not assignable to type 'T1'. 'T1' could be instantiated with an arbitrary type which could be unrelated to 'T2'. +commaOperatorOtherInvalidOperation.ts(12,23): error TS2454: Variable 'x' is used before being assigned. +commaOperatorOtherInvalidOperation.ts(12,26): error TS2454: Variable 'y' is used before being assigned. -==== commaOperatorOtherInvalidOperation.ts (2 errors) ==== +==== commaOperatorOtherInvalidOperation.ts (4 errors) ==== //Expect to have compiler errors //Comma operator in function arguments and return function foo(x: number, y: string) { @@ -22,4 +24,8 @@ commaOperatorOtherInvalidOperation.ts(12,9): error TS2322: Type 'T2' is not assi !!! error TS2322: Type 'T2' is not assignable to type 'T1'. !!! error TS2322: 'T1' could be instantiated with an arbitrary type which could be unrelated to 'T2'. !!! related TS2208 commaOperatorOtherInvalidOperation.ts:9:19: This type parameter might need an `extends T1` constraint. + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + ~ +!!! error TS2454: Variable 'y' is used before being assigned. } \ No newline at end of file diff --git a/tests/baselines/reference/commaOperatorOtherInvalidOperation.js b/tests/baselines/reference/commaOperatorOtherInvalidOperation.js index 741ce87ee458a..a462d0c034e60 100644 --- a/tests/baselines/reference/commaOperatorOtherInvalidOperation.js +++ b/tests/baselines/reference/commaOperatorOtherInvalidOperation.js @@ -16,6 +16,7 @@ function foo1() { } //// [commaOperatorOtherInvalidOperation.js] +"use strict"; //Expect to have compiler errors //Comma operator in function arguments and return function foo(x, y) { diff --git a/tests/baselines/reference/commaOperatorOtherValidOperation.errors.txt b/tests/baselines/reference/commaOperatorOtherValidOperation.errors.txt new file mode 100644 index 0000000000000..60804d8f99359 --- /dev/null +++ b/tests/baselines/reference/commaOperatorOtherValidOperation.errors.txt @@ -0,0 +1,36 @@ +commaOperatorOtherValidOperation.ts(18,5): error TS2454: Variable 'x' is used before being assigned. +commaOperatorOtherValidOperation.ts(18,8): error TS2454: Variable 'y' is used before being assigned. +commaOperatorOtherValidOperation.ts(19,23): error TS2454: Variable 'y' is used before being assigned. +commaOperatorOtherValidOperation.ts(19,26): error TS2454: Variable 'x' is used before being assigned. + + +==== commaOperatorOtherValidOperation.ts (4 errors) ==== + //Comma operator in for loop + for (var i = 0, j = 10; i < j; i++, j--) + { + } + + //Comma operator in function arguments and return + function foo(x: number, y: string) + { + return x, y; + } + var resultIsString = foo(1, "123"); + + //TypeParameters + function foo1() + { + var x: T1; + var y: T2; + x, y; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + ~ +!!! error TS2454: Variable 'y' is used before being assigned. + var resultIsT1 = (y, x); + ~ +!!! error TS2454: Variable 'y' is used before being assigned. + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + } + \ No newline at end of file diff --git a/tests/baselines/reference/commaOperatorOtherValidOperation.js b/tests/baselines/reference/commaOperatorOtherValidOperation.js index f33960b00b943..2ee6940a0ccf0 100644 --- a/tests/baselines/reference/commaOperatorOtherValidOperation.js +++ b/tests/baselines/reference/commaOperatorOtherValidOperation.js @@ -24,6 +24,7 @@ function foo1() //// [commaOperatorOtherValidOperation.js] +"use strict"; //Comma operator in for loop for (var i = 0, j = 10; i < j; i++, j--) { } diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.js b/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.js index b552bf4383ff4..8f6f797146f17 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.js +++ b/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.js @@ -40,6 +40,7 @@ var resultIsAny11 = (!BOOLEAN, x.doSomeThing()); //// [commaOperatorWithSecondOperandAnyType.js] +"use strict"; var ANY; var BOOLEAN; var NUMBER; diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.errors.txt b/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.errors.txt new file mode 100644 index 0000000000000..8038c8db7f736 --- /dev/null +++ b/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.errors.txt @@ -0,0 +1,107 @@ +commaOperatorWithSecondOperandBooleanType.ts(8,6): error TS2454: Variable 'BOOLEAN' is used before being assigned. +commaOperatorWithSecondOperandBooleanType.ts(9,1): error TS2454: Variable 'BOOLEAN' is used before being assigned. +commaOperatorWithSecondOperandBooleanType.ts(9,10): error TS2454: Variable 'BOOLEAN' is used before being assigned. +commaOperatorWithSecondOperandBooleanType.ts(10,1): error TS2454: Variable 'NUMBER' is used before being assigned. +commaOperatorWithSecondOperandBooleanType.ts(10,9): error TS2454: Variable 'BOOLEAN' is used before being assigned. +commaOperatorWithSecondOperandBooleanType.ts(11,1): error TS2454: Variable 'STRING' is used before being assigned. +commaOperatorWithSecondOperandBooleanType.ts(11,9): error TS2454: Variable 'BOOLEAN' is used before being assigned. +commaOperatorWithSecondOperandBooleanType.ts(12,1): error TS2454: Variable 'OBJECT' is used before being assigned. +commaOperatorWithSecondOperandBooleanType.ts(12,9): error TS2454: Variable 'BOOLEAN' is used before being assigned. +commaOperatorWithSecondOperandBooleanType.ts(15,30): error TS2454: Variable 'BOOLEAN' is used before being assigned. +commaOperatorWithSecondOperandBooleanType.ts(16,25): error TS2454: Variable 'BOOLEAN' is used before being assigned. +commaOperatorWithSecondOperandBooleanType.ts(16,34): error TS2454: Variable 'BOOLEAN' is used before being assigned. +commaOperatorWithSecondOperandBooleanType.ts(17,25): error TS2454: Variable 'NUMBER' is used before being assigned. +commaOperatorWithSecondOperandBooleanType.ts(17,33): error TS2454: Variable 'BOOLEAN' is used before being assigned. +commaOperatorWithSecondOperandBooleanType.ts(18,25): error TS2454: Variable 'STRING' is used before being assigned. +commaOperatorWithSecondOperandBooleanType.ts(18,33): error TS2454: Variable 'BOOLEAN' is used before being assigned. +commaOperatorWithSecondOperandBooleanType.ts(19,25): error TS2454: Variable 'OBJECT' is used before being assigned. +commaOperatorWithSecondOperandBooleanType.ts(19,33): error TS2454: Variable 'BOOLEAN' is used before being assigned. +commaOperatorWithSecondOperandBooleanType.ts(22,7): error TS2454: Variable 'BOOLEAN' is used before being assigned. +commaOperatorWithSecondOperandBooleanType.ts(23,18): error TS2454: Variable 'BOOLEAN' is used before being assigned. +commaOperatorWithSecondOperandBooleanType.ts(25,3): error TS2454: Variable 'NUMBER' is used before being assigned. +commaOperatorWithSecondOperandBooleanType.ts(26,13): error TS2454: Variable 'BOOLEAN' is used before being assigned. +commaOperatorWithSecondOperandBooleanType.ts(32,27): error TS2454: Variable 'NUMBER' is used before being assigned. + + +==== commaOperatorWithSecondOperandBooleanType.ts (23 errors) ==== + var ANY: any; + var BOOLEAN: boolean; + var NUMBER: number; + var STRING: string; + var OBJECT: Object; + + //The second operand type is boolean + ANY, BOOLEAN; + ~~~~~~~ +!!! error TS2454: Variable 'BOOLEAN' is used before being assigned. + BOOLEAN, BOOLEAN; + ~~~~~~~ +!!! error TS2454: Variable 'BOOLEAN' is used before being assigned. + ~~~~~~~ +!!! error TS2454: Variable 'BOOLEAN' is used before being assigned. + NUMBER, BOOLEAN; + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + ~~~~~~~ +!!! error TS2454: Variable 'BOOLEAN' is used before being assigned. + STRING, BOOLEAN; + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + ~~~~~~~ +!!! error TS2454: Variable 'BOOLEAN' is used before being assigned. + OBJECT, BOOLEAN; + ~~~~~~ +!!! error TS2454: Variable 'OBJECT' is used before being assigned. + ~~~~~~~ +!!! error TS2454: Variable 'BOOLEAN' is used before being assigned. + + //Return type is boolean + var resultIsBoolean1 = (ANY, BOOLEAN); + ~~~~~~~ +!!! error TS2454: Variable 'BOOLEAN' is used before being assigned. + var resultIsBoolean2 = (BOOLEAN, BOOLEAN); + ~~~~~~~ +!!! error TS2454: Variable 'BOOLEAN' is used before being assigned. + ~~~~~~~ +!!! error TS2454: Variable 'BOOLEAN' is used before being assigned. + var resultIsBoolean3 = (NUMBER, BOOLEAN); + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + ~~~~~~~ +!!! error TS2454: Variable 'BOOLEAN' is used before being assigned. + var resultIsBoolean4 = (STRING, BOOLEAN); + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + ~~~~~~~ +!!! error TS2454: Variable 'BOOLEAN' is used before being assigned. + var resultIsBoolean5 = (OBJECT, BOOLEAN); + ~~~~~~ +!!! error TS2454: Variable 'OBJECT' is used before being assigned. + ~~~~~~~ +!!! error TS2454: Variable 'BOOLEAN' is used before being assigned. + + //Literal and expression + null, BOOLEAN; + ~~~~~~~ +!!! error TS2454: Variable 'BOOLEAN' is used before being assigned. + ANY = undefined, BOOLEAN; + ~~~~~~~ +!!! error TS2454: Variable 'BOOLEAN' is used before being assigned. + 1, true; + ++NUMBER, true; + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + [1, 2, 3], !BOOLEAN; + ~~~~~~~ +!!! error TS2454: Variable 'BOOLEAN' is used before being assigned. + OBJECT = [1, 2, 3], BOOLEAN = false; + + var resultIsBoolean6 = (null, BOOLEAN); + var resultIsBoolean7 = (ANY = undefined, BOOLEAN); + var resultIsBoolean8 = (1, true); + var resultIsBoolean9 = (++NUMBER, true); + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + var resultIsBoolean10 = ([1, 2, 3], !BOOLEAN); + var resultIsBoolean11 = (OBJECT = [1, 2, 3], BOOLEAN = false); + \ No newline at end of file diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.js b/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.js index b0a95e8ae7149..832f685fd0a27 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.js +++ b/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.js @@ -38,6 +38,7 @@ var resultIsBoolean11 = (OBJECT = [1, 2, 3], BOOLEAN = false); //// [commaOperatorWithSecondOperandBooleanType.js] +"use strict"; var ANY; var BOOLEAN; var NUMBER; diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.types b/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.types index e0e45202c1bbe..37b5c09a002c3 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.types +++ b/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.types @@ -3,6 +3,7 @@ === commaOperatorWithSecondOperandBooleanType.ts === var ANY: any; >ANY : any +> : ^^^ var BOOLEAN: boolean; >BOOLEAN : boolean @@ -25,6 +26,7 @@ ANY, BOOLEAN; >ANY, BOOLEAN : boolean > : ^^^^^^^ >ANY : any +> : ^^^ >BOOLEAN : boolean > : ^^^^^^^ @@ -69,6 +71,7 @@ var resultIsBoolean1 = (ANY, BOOLEAN); >ANY, BOOLEAN : boolean > : ^^^^^^^ >ANY : any +> : ^^^ >BOOLEAN : boolean > : ^^^^^^^ @@ -133,6 +136,7 @@ ANY = undefined, BOOLEAN; >ANY = undefined : undefined > : ^^^^^^^^^ >ANY : any +> : ^^^ >undefined : undefined > : ^^^^^^^^^ >BOOLEAN : boolean @@ -214,6 +218,7 @@ var resultIsBoolean7 = (ANY = undefined, BOOLEAN); >ANY = undefined : undefined > : ^^^^^^^^^ >ANY : any +> : ^^^ >undefined : undefined > : ^^^^^^^^^ >BOOLEAN : false diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.errors.txt b/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.errors.txt new file mode 100644 index 0000000000000..d20458fbec664 --- /dev/null +++ b/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.errors.txt @@ -0,0 +1,104 @@ +commaOperatorWithSecondOperandNumberType.ts(8,6): error TS2454: Variable 'NUMBER' is used before being assigned. +commaOperatorWithSecondOperandNumberType.ts(9,1): error TS2454: Variable 'BOOLEAN' is used before being assigned. +commaOperatorWithSecondOperandNumberType.ts(9,10): error TS2454: Variable 'NUMBER' is used before being assigned. +commaOperatorWithSecondOperandNumberType.ts(10,1): error TS2454: Variable 'NUMBER' is used before being assigned. +commaOperatorWithSecondOperandNumberType.ts(10,9): error TS2454: Variable 'NUMBER' is used before being assigned. +commaOperatorWithSecondOperandNumberType.ts(11,1): error TS2454: Variable 'STRING' is used before being assigned. +commaOperatorWithSecondOperandNumberType.ts(11,9): error TS2454: Variable 'NUMBER' is used before being assigned. +commaOperatorWithSecondOperandNumberType.ts(12,1): error TS2454: Variable 'OBJECT' is used before being assigned. +commaOperatorWithSecondOperandNumberType.ts(12,9): error TS2454: Variable 'NUMBER' is used before being assigned. +commaOperatorWithSecondOperandNumberType.ts(15,29): error TS2454: Variable 'NUMBER' is used before being assigned. +commaOperatorWithSecondOperandNumberType.ts(16,24): error TS2454: Variable 'BOOLEAN' is used before being assigned. +commaOperatorWithSecondOperandNumberType.ts(16,33): error TS2454: Variable 'NUMBER' is used before being assigned. +commaOperatorWithSecondOperandNumberType.ts(17,24): error TS2454: Variable 'NUMBER' is used before being assigned. +commaOperatorWithSecondOperandNumberType.ts(17,32): error TS2454: Variable 'NUMBER' is used before being assigned. +commaOperatorWithSecondOperandNumberType.ts(18,24): error TS2454: Variable 'STRING' is used before being assigned. +commaOperatorWithSecondOperandNumberType.ts(18,32): error TS2454: Variable 'NUMBER' is used before being assigned. +commaOperatorWithSecondOperandNumberType.ts(19,24): error TS2454: Variable 'OBJECT' is used before being assigned. +commaOperatorWithSecondOperandNumberType.ts(19,32): error TS2454: Variable 'NUMBER' is used before being assigned. +commaOperatorWithSecondOperandNumberType.ts(22,7): error TS2454: Variable 'NUMBER' is used before being assigned. +commaOperatorWithSecondOperandNumberType.ts(23,18): error TS2454: Variable 'NUMBER' is used before being assigned. +commaOperatorWithSecondOperandNumberType.ts(27,1): error TS2454: Variable 'STRING' is used before being assigned. +commaOperatorWithSecondOperandNumberType.ts(34,25): error TS2454: Variable 'STRING' is used before being assigned. + + +==== commaOperatorWithSecondOperandNumberType.ts (22 errors) ==== + var ANY: any; + var BOOLEAN: boolean; + var NUMBER: number; + var STRING: string; + var OBJECT: Object; + + //The second operand type is number + ANY, NUMBER; + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + BOOLEAN, NUMBER; + ~~~~~~~ +!!! error TS2454: Variable 'BOOLEAN' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + NUMBER, NUMBER; + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + STRING, NUMBER; + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + OBJECT, NUMBER; + ~~~~~~ +!!! error TS2454: Variable 'OBJECT' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + + //Return type is number + var resultIsNumber1 = (ANY, NUMBER); + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + var resultIsNumber2 = (BOOLEAN, NUMBER); + ~~~~~~~ +!!! error TS2454: Variable 'BOOLEAN' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + var resultIsNumber3 = (NUMBER, NUMBER); + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + var resultIsNumber4 = (STRING, NUMBER); + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + var resultIsNumber5 = (OBJECT, NUMBER); + ~~~~~~ +!!! error TS2454: Variable 'OBJECT' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + + //Literal and expression + null, NUMBER; + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + ANY = undefined, NUMBER; + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + true, 1; + BOOLEAN = false, 1; + "", NUMBER = 1; + STRING.trim(), NUMBER = 1; + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + + var resultIsNumber6 = (null, NUMBER); + var resultIsNumber7 = (ANY = undefined, NUMBER); + var resultIsNumber8 = (true, 1); + var resultIsNumber9 = (BOOLEAN = false, 1); + var resultIsNumber10 = ("", NUMBER = 1); + var resultIsNumber11 = (STRING.trim(), NUMBER = 1); + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + \ No newline at end of file diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.js b/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.js index 5654c0558a4fa..d4e73841bff33 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.js +++ b/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.js @@ -38,6 +38,7 @@ var resultIsNumber11 = (STRING.trim(), NUMBER = 1); //// [commaOperatorWithSecondOperandNumberType.js] +"use strict"; var ANY; var BOOLEAN; var NUMBER; diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.types b/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.types index c2525034bbef8..f1e3f73cf2b62 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.types +++ b/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.types @@ -3,6 +3,7 @@ === commaOperatorWithSecondOperandNumberType.ts === var ANY: any; >ANY : any +> : ^^^ var BOOLEAN: boolean; >BOOLEAN : boolean @@ -25,6 +26,7 @@ ANY, NUMBER; >ANY, NUMBER : number > : ^^^^^^ >ANY : any +> : ^^^ >NUMBER : number > : ^^^^^^ @@ -69,6 +71,7 @@ var resultIsNumber1 = (ANY, NUMBER); >ANY, NUMBER : number > : ^^^^^^ >ANY : any +> : ^^^ >NUMBER : number > : ^^^^^^ @@ -133,6 +136,7 @@ ANY = undefined, NUMBER; >ANY = undefined : undefined > : ^^^^^^^^^ >ANY : any +> : ^^^ >undefined : undefined > : ^^^^^^^^^ >NUMBER : number @@ -208,6 +212,7 @@ var resultIsNumber7 = (ANY = undefined, NUMBER); >ANY = undefined : undefined > : ^^^^^^^^^ >ANY : any +> : ^^^ >undefined : undefined > : ^^^^^^^^^ >NUMBER : number diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.errors.txt b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.errors.txt new file mode 100644 index 0000000000000..02974719c882b --- /dev/null +++ b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.errors.txt @@ -0,0 +1,123 @@ +commaOperatorWithSecondOperandObjectType.ts(8,5): error TS2564: Property 'num' has no initializer and is not definitely assigned in the constructor. +commaOperatorWithSecondOperandObjectType.ts(12,6): error TS2454: Variable 'OBJECT' is used before being assigned. +commaOperatorWithSecondOperandObjectType.ts(13,1): error TS2454: Variable 'BOOLEAN' is used before being assigned. +commaOperatorWithSecondOperandObjectType.ts(13,10): error TS2454: Variable 'OBJECT' is used before being assigned. +commaOperatorWithSecondOperandObjectType.ts(14,1): error TS2454: Variable 'NUMBER' is used before being assigned. +commaOperatorWithSecondOperandObjectType.ts(14,9): error TS2454: Variable 'OBJECT' is used before being assigned. +commaOperatorWithSecondOperandObjectType.ts(15,1): error TS2454: Variable 'STRING' is used before being assigned. +commaOperatorWithSecondOperandObjectType.ts(15,9): error TS2454: Variable 'OBJECT' is used before being assigned. +commaOperatorWithSecondOperandObjectType.ts(16,1): error TS2454: Variable 'OBJECT' is used before being assigned. +commaOperatorWithSecondOperandObjectType.ts(16,9): error TS2454: Variable 'OBJECT' is used before being assigned. +commaOperatorWithSecondOperandObjectType.ts(19,29): error TS2454: Variable 'OBJECT' is used before being assigned. +commaOperatorWithSecondOperandObjectType.ts(20,24): error TS2454: Variable 'BOOLEAN' is used before being assigned. +commaOperatorWithSecondOperandObjectType.ts(20,33): error TS2454: Variable 'OBJECT' is used before being assigned. +commaOperatorWithSecondOperandObjectType.ts(21,24): error TS2454: Variable 'NUMBER' is used before being assigned. +commaOperatorWithSecondOperandObjectType.ts(21,32): error TS2454: Variable 'OBJECT' is used before being assigned. +commaOperatorWithSecondOperandObjectType.ts(22,24): error TS2454: Variable 'STRING' is used before being assigned. +commaOperatorWithSecondOperandObjectType.ts(22,32): error TS2454: Variable 'OBJECT' is used before being assigned. +commaOperatorWithSecondOperandObjectType.ts(23,24): error TS2454: Variable 'OBJECT' is used before being assigned. +commaOperatorWithSecondOperandObjectType.ts(23,32): error TS2454: Variable 'OBJECT' is used before being assigned. +commaOperatorWithSecondOperandObjectType.ts(26,7): error TS2454: Variable 'OBJECT' is used before being assigned. +commaOperatorWithSecondOperandObjectType.ts(27,13): error TS2454: Variable 'OBJECT' is used before being assigned. +commaOperatorWithSecondOperandObjectType.ts(29,2): error TS2454: Variable 'BOOLEAN' is used before being assigned. +commaOperatorWithSecondOperandObjectType.ts(31,1): error TS2454: Variable 'STRING' is used before being assigned. +commaOperatorWithSecondOperandObjectType.ts(33,30): error TS2454: Variable 'OBJECT' is used before being assigned. +commaOperatorWithSecondOperandObjectType.ts(34,36): error TS2454: Variable 'OBJECT' is used before being assigned. +commaOperatorWithSecondOperandObjectType.ts(36,25): error TS2454: Variable 'BOOLEAN' is used before being assigned. +commaOperatorWithSecondOperandObjectType.ts(38,25): error TS2454: Variable 'STRING' is used before being assigned. + + +==== commaOperatorWithSecondOperandObjectType.ts (27 errors) ==== + var ANY: any; + var BOOLEAN: boolean; + var NUMBER: number; + var STRING: string; + var OBJECT: Object; + + class CLASS { + num: number; + ~~~ +!!! error TS2564: Property 'num' has no initializer and is not definitely assigned in the constructor. + } + + //The second operand type is Object + ANY, OBJECT; + ~~~~~~ +!!! error TS2454: Variable 'OBJECT' is used before being assigned. + BOOLEAN, OBJECT; + ~~~~~~~ +!!! error TS2454: Variable 'BOOLEAN' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'OBJECT' is used before being assigned. + NUMBER, OBJECT; + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'OBJECT' is used before being assigned. + STRING, OBJECT; + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'OBJECT' is used before being assigned. + OBJECT, OBJECT; + ~~~~~~ +!!! error TS2454: Variable 'OBJECT' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'OBJECT' is used before being assigned. + + //Return type is Object + var resultIsObject1 = (ANY, OBJECT); + ~~~~~~ +!!! error TS2454: Variable 'OBJECT' is used before being assigned. + var resultIsObject2 = (BOOLEAN, OBJECT); + ~~~~~~~ +!!! error TS2454: Variable 'BOOLEAN' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'OBJECT' is used before being assigned. + var resultIsObject3 = (NUMBER, OBJECT); + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'OBJECT' is used before being assigned. + var resultIsObject4 = (STRING, OBJECT); + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'OBJECT' is used before being assigned. + var resultIsObject5 = (OBJECT, OBJECT); + ~~~~~~ +!!! error TS2454: Variable 'OBJECT' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'OBJECT' is used before being assigned. + + //Literal and expression + null, OBJECT + ~~~~~~ +!!! error TS2454: Variable 'OBJECT' is used before being assigned. + ANY = null, OBJECT + ~~~~~~ +!!! error TS2454: Variable 'OBJECT' is used before being assigned. + true, {} + !BOOLEAN, [] + ~~~~~~~ +!!! error TS2454: Variable 'BOOLEAN' is used before being assigned. + "string", new Date() + STRING.toLowerCase(), new CLASS() + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + + var resultIsObject6 = (null, OBJECT); + ~~~~~~ +!!! error TS2454: Variable 'OBJECT' is used before being assigned. + var resultIsObject7 = (ANY = null, OBJECT); + ~~~~~~ +!!! error TS2454: Variable 'OBJECT' is used before being assigned. + var resultIsObject8 = (true, {}); + var resultIsObject9 = (!BOOLEAN, { a: 1, b: "s" }); + ~~~~~~~ +!!! error TS2454: Variable 'BOOLEAN' is used before being assigned. + var resultIsObject10 = ("string", new Date()); + var resultIsObject11 = (STRING.toLowerCase(), new CLASS()); + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + \ No newline at end of file diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.js b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.js index 3e9a3cdf18abd..9645ed96cf83e 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.js +++ b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.js @@ -42,6 +42,7 @@ var resultIsObject11 = (STRING.toLowerCase(), new CLASS()); //// [commaOperatorWithSecondOperandObjectType.js] +"use strict"; var ANY; var BOOLEAN; var NUMBER; diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.types b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.types index 83605d899c9be..72c77d6853ded 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.types +++ b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.types @@ -3,6 +3,7 @@ === commaOperatorWithSecondOperandObjectType.ts === var ANY: any; >ANY : any +> : ^^^ var BOOLEAN: boolean; >BOOLEAN : boolean @@ -34,6 +35,7 @@ ANY, OBJECT; >ANY, OBJECT : Object > : ^^^^^^ >ANY : any +> : ^^^ >OBJECT : Object > : ^^^^^^ @@ -78,6 +80,7 @@ var resultIsObject1 = (ANY, OBJECT); >ANY, OBJECT : Object > : ^^^^^^ >ANY : any +> : ^^^ >OBJECT : Object > : ^^^^^^ @@ -142,6 +145,7 @@ ANY = null, OBJECT >ANY = null : null > : ^^^^ >ANY : any +> : ^^^ >OBJECT : Object > : ^^^^^^ @@ -154,14 +158,14 @@ true, {} > : ^^ !BOOLEAN, [] ->!BOOLEAN, [] : undefined[] -> : ^^^^^^^^^^^ +>!BOOLEAN, [] : never[] +> : ^^^^^^^ >!BOOLEAN : boolean > : ^^^^^^^ >BOOLEAN : boolean > : ^^^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ "string", new Date() >"string", new Date() : Date @@ -209,6 +213,7 @@ var resultIsObject7 = (ANY = null, OBJECT); >ANY = null : null > : ^^^^ >ANY : any +> : ^^^ >OBJECT : Object > : ^^^^^^ diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandStringType.errors.txt b/tests/baselines/reference/commaOperatorWithSecondOperandStringType.errors.txt new file mode 100644 index 0000000000000..b576d9ad67fca --- /dev/null +++ b/tests/baselines/reference/commaOperatorWithSecondOperandStringType.errors.txt @@ -0,0 +1,124 @@ +commaOperatorWithSecondOperandStringType.ts(10,6): error TS2454: Variable 'STRING' is used before being assigned. +commaOperatorWithSecondOperandStringType.ts(11,1): error TS2454: Variable 'BOOLEAN' is used before being assigned. +commaOperatorWithSecondOperandStringType.ts(11,10): error TS2454: Variable 'STRING' is used before being assigned. +commaOperatorWithSecondOperandStringType.ts(12,1): error TS2454: Variable 'NUMBER' is used before being assigned. +commaOperatorWithSecondOperandStringType.ts(12,9): error TS2454: Variable 'STRING' is used before being assigned. +commaOperatorWithSecondOperandStringType.ts(13,1): error TS2454: Variable 'STRING' is used before being assigned. +commaOperatorWithSecondOperandStringType.ts(13,9): error TS2454: Variable 'STRING' is used before being assigned. +commaOperatorWithSecondOperandStringType.ts(14,1): error TS2454: Variable 'OBJECT' is used before being assigned. +commaOperatorWithSecondOperandStringType.ts(14,9): error TS2454: Variable 'STRING' is used before being assigned. +commaOperatorWithSecondOperandStringType.ts(17,29): error TS2454: Variable 'STRING' is used before being assigned. +commaOperatorWithSecondOperandStringType.ts(18,24): error TS2454: Variable 'BOOLEAN' is used before being assigned. +commaOperatorWithSecondOperandStringType.ts(18,33): error TS2454: Variable 'STRING' is used before being assigned. +commaOperatorWithSecondOperandStringType.ts(19,24): error TS2454: Variable 'NUMBER' is used before being assigned. +commaOperatorWithSecondOperandStringType.ts(19,32): error TS2454: Variable 'STRING' is used before being assigned. +commaOperatorWithSecondOperandStringType.ts(20,24): error TS2454: Variable 'STRING' is used before being assigned. +commaOperatorWithSecondOperandStringType.ts(20,32): error TS2454: Variable 'STRING' is used before being assigned. +commaOperatorWithSecondOperandStringType.ts(21,24): error TS2454: Variable 'OBJECT' is used before being assigned. +commaOperatorWithSecondOperandStringType.ts(21,32): error TS2454: Variable 'STRING' is used before being assigned. +commaOperatorWithSecondOperandStringType.ts(24,7): error TS2454: Variable 'STRING' is used before being assigned. +commaOperatorWithSecondOperandStringType.ts(25,19): error TS2454: Variable 'STRING' is used before being assigned. +commaOperatorWithSecondOperandStringType.ts(27,1): error TS2454: Variable 'BOOLEAN' is used before being assigned. +commaOperatorWithSecondOperandStringType.ts(28,13): error TS2454: Variable 'NUMBER' is used before being assigned. +commaOperatorWithSecondOperandStringType.ts(29,22): error TS2454: Variable 'STRING' is used before being assigned. +commaOperatorWithSecondOperandStringType.ts(31,30): error TS2454: Variable 'STRING' is used before being assigned. +commaOperatorWithSecondOperandStringType.ts(32,42): error TS2454: Variable 'STRING' is used before being assigned. +commaOperatorWithSecondOperandStringType.ts(34,24): error TS2454: Variable 'BOOLEAN' is used before being assigned. +commaOperatorWithSecondOperandStringType.ts(35,37): error TS2454: Variable 'NUMBER' is used before being assigned. +commaOperatorWithSecondOperandStringType.ts(36,37): error TS2454: Variable 'STRING' is used before being assigned. + + +==== commaOperatorWithSecondOperandStringType.ts (28 errors) ==== + var ANY: any; + var BOOLEAN: boolean; + var NUMBER: number; + var STRING: string; + var OBJECT: Object; + + var resultIsString: string; + + //The second operand is string + ANY, STRING; + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + BOOLEAN, STRING; + ~~~~~~~ +!!! error TS2454: Variable 'BOOLEAN' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + NUMBER, STRING; + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + STRING, STRING; + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + OBJECT, STRING; + ~~~~~~ +!!! error TS2454: Variable 'OBJECT' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + + //Return type is string + var resultIsString1 = (ANY, STRING); + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + var resultIsString2 = (BOOLEAN, STRING); + ~~~~~~~ +!!! error TS2454: Variable 'BOOLEAN' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + var resultIsString3 = (NUMBER, STRING); + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + var resultIsString4 = (STRING, STRING); + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + var resultIsString5 = (OBJECT, STRING); + ~~~~~~ +!!! error TS2454: Variable 'OBJECT' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + + //Literal and expression + null, STRING; + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + ANY = new Date(), STRING; + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + true, ""; + BOOLEAN == undefined, ""; + ~~~~~~~ +!!! error TS2454: Variable 'BOOLEAN' is used before being assigned. + ["a", "b"], NUMBER.toString(); + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + OBJECT = new Object, STRING + "string"; + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + + var resultIsString6 = (null, STRING); + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + var resultIsString7 = (ANY = new Date(), STRING); + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + var resultIsString8 = (true, ""); + var resultIsString9 = (BOOLEAN == undefined, ""); + ~~~~~~~ +!!! error TS2454: Variable 'BOOLEAN' is used before being assigned. + var resultIsString10 = (["a", "b"], NUMBER.toString()); + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + var resultIsString11 = (new Object, STRING + "string"); + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + \ No newline at end of file diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandStringType.js b/tests/baselines/reference/commaOperatorWithSecondOperandStringType.js index 86c594ddc2871..8bfbb99076a9a 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandStringType.js +++ b/tests/baselines/reference/commaOperatorWithSecondOperandStringType.js @@ -40,6 +40,7 @@ var resultIsString11 = (new Object, STRING + "string"); //// [commaOperatorWithSecondOperandStringType.js] +"use strict"; var ANY; var BOOLEAN; var NUMBER; diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandStringType.types b/tests/baselines/reference/commaOperatorWithSecondOperandStringType.types index e26c7bb76312f..aad4ca4bfa6ae 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandStringType.types +++ b/tests/baselines/reference/commaOperatorWithSecondOperandStringType.types @@ -3,6 +3,7 @@ === commaOperatorWithSecondOperandStringType.ts === var ANY: any; >ANY : any +> : ^^^ var BOOLEAN: boolean; >BOOLEAN : boolean @@ -29,6 +30,7 @@ ANY, STRING; >ANY, STRING : string > : ^^^^^^ >ANY : any +> : ^^^ >STRING : string > : ^^^^^^ @@ -73,6 +75,7 @@ var resultIsString1 = (ANY, STRING); >ANY, STRING : string > : ^^^^^^ >ANY : any +> : ^^^ >STRING : string > : ^^^^^^ @@ -137,6 +140,7 @@ ANY = new Date(), STRING; >ANY = new Date() : Date > : ^^^^ >ANY : any +> : ^^^ >new Date() : Date > : ^^^^ >Date : DateConstructor @@ -220,6 +224,7 @@ var resultIsString7 = (ANY = new Date(), STRING); >ANY = new Date() : Date > : ^^^^ >ANY : any +> : ^^^ >new Date() : Date > : ^^^^ >Date : DateConstructor diff --git a/tests/baselines/reference/commaOperatorWithoutOperand.js b/tests/baselines/reference/commaOperatorWithoutOperand.js index a90217ff2a70c..d7d3ced81b31f 100644 --- a/tests/baselines/reference/commaOperatorWithoutOperand.js +++ b/tests/baselines/reference/commaOperatorWithoutOperand.js @@ -26,6 +26,7 @@ declare var OBJECT: Object; ( , ); //// [commaOperatorWithoutOperand.js] +"use strict"; // Expect to have compiler errors // Missing the second operand (ANY, ); diff --git a/tests/baselines/reference/commaOperatorsMultipleOperators.errors.txt b/tests/baselines/reference/commaOperatorsMultipleOperators.errors.txt new file mode 100644 index 0000000000000..241b6aba19e56 --- /dev/null +++ b/tests/baselines/reference/commaOperatorsMultipleOperators.errors.txt @@ -0,0 +1,113 @@ +commaOperatorsMultipleOperators.ts(8,6): error TS2454: Variable 'BOOLEAN' is used before being assigned. +commaOperatorsMultipleOperators.ts(8,15): error TS2454: Variable 'NUMBER' is used before being assigned. +commaOperatorsMultipleOperators.ts(9,1): error TS2454: Variable 'BOOLEAN' is used before being assigned. +commaOperatorsMultipleOperators.ts(9,10): error TS2454: Variable 'NUMBER' is used before being assigned. +commaOperatorsMultipleOperators.ts(9,18): error TS2454: Variable 'STRING' is used before being assigned. +commaOperatorsMultipleOperators.ts(10,1): error TS2454: Variable 'NUMBER' is used before being assigned. +commaOperatorsMultipleOperators.ts(10,9): error TS2454: Variable 'STRING' is used before being assigned. +commaOperatorsMultipleOperators.ts(10,17): error TS2454: Variable 'OBJECT' is used before being assigned. +commaOperatorsMultipleOperators.ts(11,1): error TS2454: Variable 'STRING' is used before being assigned. +commaOperatorsMultipleOperators.ts(11,9): error TS2454: Variable 'OBJECT' is used before being assigned. +commaOperatorsMultipleOperators.ts(12,1): error TS2454: Variable 'OBJECT' is used before being assigned. +commaOperatorsMultipleOperators.ts(12,14): error TS2454: Variable 'BOOLEAN' is used before being assigned. +commaOperatorsMultipleOperators.ts(15,21): error TS2454: Variable 'STRING' is used before being assigned. +commaOperatorsMultipleOperators.ts(15,29): error TS2454: Variable 'OBJECT' is used before being assigned. +commaOperatorsMultipleOperators.ts(16,25): error TS2454: Variable 'OBJECT' is used before being assigned. +commaOperatorsMultipleOperators.ts(16,38): error TS2454: Variable 'BOOLEAN' is used before being assigned. +commaOperatorsMultipleOperators.ts(17,29): error TS2454: Variable 'BOOLEAN' is used before being assigned. +commaOperatorsMultipleOperators.ts(17,38): error TS2454: Variable 'NUMBER' is used before being assigned. +commaOperatorsMultipleOperators.ts(18,24): error TS2454: Variable 'BOOLEAN' is used before being assigned. +commaOperatorsMultipleOperators.ts(18,33): error TS2454: Variable 'NUMBER' is used before being assigned. +commaOperatorsMultipleOperators.ts(18,41): error TS2454: Variable 'STRING' is used before being assigned. +commaOperatorsMultipleOperators.ts(19,24): error TS2454: Variable 'NUMBER' is used before being assigned. +commaOperatorsMultipleOperators.ts(19,32): error TS2454: Variable 'STRING' is used before being assigned. +commaOperatorsMultipleOperators.ts(19,40): error TS2454: Variable 'OBJECT' is used before being assigned. +commaOperatorsMultipleOperators.ts(23,3): error TS2454: Variable 'NUMBER' is used before being assigned. +commaOperatorsMultipleOperators.ts(23,11): error TS2454: Variable 'STRING' is used before being assigned. +commaOperatorsMultipleOperators.ts(26,26): error TS2454: Variable 'NUMBER' is used before being assigned. +commaOperatorsMultipleOperators.ts(26,34): error TS2454: Variable 'STRING' is used before being assigned. + + +==== commaOperatorsMultipleOperators.ts (28 errors) ==== + var ANY: any; + var BOOLEAN: boolean; + var NUMBER: number; + var STRING: string; + var OBJECT: Object; + + //Expected: work well + ANY, BOOLEAN, NUMBER; + ~~~~~~~ +!!! error TS2454: Variable 'BOOLEAN' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + BOOLEAN, NUMBER, STRING; + ~~~~~~~ +!!! error TS2454: Variable 'BOOLEAN' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + NUMBER, STRING, OBJECT; + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'OBJECT' is used before being assigned. + STRING, OBJECT, ANY; + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'OBJECT' is used before being assigned. + OBJECT, ANY, BOOLEAN; + ~~~~~~ +!!! error TS2454: Variable 'OBJECT' is used before being assigned. + ~~~~~~~ +!!! error TS2454: Variable 'BOOLEAN' is used before being assigned. + + //Results should have the same type as the third operand + var resultIsAny1 = (STRING, OBJECT, ANY); + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'OBJECT' is used before being assigned. + var resultIsBoolean1 = (OBJECT, ANY, BOOLEAN); + ~~~~~~ +!!! error TS2454: Variable 'OBJECT' is used before being assigned. + ~~~~~~~ +!!! error TS2454: Variable 'BOOLEAN' is used before being assigned. + var resultIsNumber1 = (ANY, BOOLEAN, NUMBER); + ~~~~~~~ +!!! error TS2454: Variable 'BOOLEAN' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + var resultIsString1 = (BOOLEAN, NUMBER, STRING); + ~~~~~~~ +!!! error TS2454: Variable 'BOOLEAN' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + var resultIsObject1 = (NUMBER, STRING, OBJECT); + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'OBJECT' is used before being assigned. + + //Literal and expression + null, true, 1; + ++NUMBER, STRING.charAt(0), new Object(); + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. + + var resultIsNumber2 = (null, true, 1); + var resultIsObject2 = (++NUMBER, STRING.charAt(0), new Object()); + ~~~~~~ +!!! error TS2454: Variable 'NUMBER' is used before being assigned. + ~~~~~~ +!!! error TS2454: Variable 'STRING' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/commaOperatorsMultipleOperators.js b/tests/baselines/reference/commaOperatorsMultipleOperators.js index 9d22fd95553dc..41ff2bd6e1907 100644 --- a/tests/baselines/reference/commaOperatorsMultipleOperators.js +++ b/tests/baselines/reference/commaOperatorsMultipleOperators.js @@ -29,6 +29,7 @@ var resultIsNumber2 = (null, true, 1); var resultIsObject2 = (++NUMBER, STRING.charAt(0), new Object()); //// [commaOperatorsMultipleOperators.js] +"use strict"; var ANY; var BOOLEAN; var NUMBER; diff --git a/tests/baselines/reference/commaOperatorsMultipleOperators.types b/tests/baselines/reference/commaOperatorsMultipleOperators.types index 9eb2564e74422..ef07ab3936162 100644 --- a/tests/baselines/reference/commaOperatorsMultipleOperators.types +++ b/tests/baselines/reference/commaOperatorsMultipleOperators.types @@ -3,6 +3,7 @@ === commaOperatorsMultipleOperators.ts === var ANY: any; >ANY : any +> : ^^^ var BOOLEAN: boolean; >BOOLEAN : boolean @@ -27,6 +28,7 @@ ANY, BOOLEAN, NUMBER; >ANY, BOOLEAN : boolean > : ^^^^^^^ >ANY : any +> : ^^^ >BOOLEAN : boolean > : ^^^^^^^ >NUMBER : number @@ -58,6 +60,7 @@ NUMBER, STRING, OBJECT; STRING, OBJECT, ANY; >STRING, OBJECT, ANY : any +> : ^^^ >STRING, OBJECT : Object > : ^^^^^^ >STRING : string @@ -65,22 +68,28 @@ STRING, OBJECT, ANY; >OBJECT : Object > : ^^^^^^ >ANY : any +> : ^^^ OBJECT, ANY, BOOLEAN; >OBJECT, ANY, BOOLEAN : boolean > : ^^^^^^^ >OBJECT, ANY : any +> : ^^^ >OBJECT : Object > : ^^^^^^ >ANY : any +> : ^^^ >BOOLEAN : boolean > : ^^^^^^^ //Results should have the same type as the third operand var resultIsAny1 = (STRING, OBJECT, ANY); >resultIsAny1 : any +> : ^^^ >(STRING, OBJECT, ANY) : any +> : ^^^ >STRING, OBJECT, ANY : any +> : ^^^ >STRING, OBJECT : Object > : ^^^^^^ >STRING : string @@ -88,6 +97,7 @@ var resultIsAny1 = (STRING, OBJECT, ANY); >OBJECT : Object > : ^^^^^^ >ANY : any +> : ^^^ var resultIsBoolean1 = (OBJECT, ANY, BOOLEAN); >resultIsBoolean1 : boolean @@ -97,9 +107,11 @@ var resultIsBoolean1 = (OBJECT, ANY, BOOLEAN); >OBJECT, ANY, BOOLEAN : boolean > : ^^^^^^^ >OBJECT, ANY : any +> : ^^^ >OBJECT : Object > : ^^^^^^ >ANY : any +> : ^^^ >BOOLEAN : boolean > : ^^^^^^^ @@ -113,6 +125,7 @@ var resultIsNumber1 = (ANY, BOOLEAN, NUMBER); >ANY, BOOLEAN : boolean > : ^^^^^^^ >ANY : any +> : ^^^ >BOOLEAN : boolean > : ^^^^^^^ >NUMBER : number diff --git a/tests/baselines/reference/commentBeforeStaticMethod1.js b/tests/baselines/reference/commentBeforeStaticMethod1.js index 3cbf8ece654d5..27239defecae3 100644 --- a/tests/baselines/reference/commentBeforeStaticMethod1.js +++ b/tests/baselines/reference/commentBeforeStaticMethod1.js @@ -11,6 +11,7 @@ class C { } //// [commentBeforeStaticMethod1.js] +"use strict"; class C { /** * Returns bar diff --git a/tests/baselines/reference/commentEmitAtEndOfFile1.js b/tests/baselines/reference/commentEmitAtEndOfFile1.js index b5886883da81f..4709d885c9ef9 100644 --- a/tests/baselines/reference/commentEmitAtEndOfFile1.js +++ b/tests/baselines/reference/commentEmitAtEndOfFile1.js @@ -13,6 +13,7 @@ namespace empty { // test #4 //// [commentEmitAtEndOfFile1.js] +"use strict"; // test var f = ''; // test #2 diff --git a/tests/baselines/reference/commentEmitWithCommentOnLastLine.js b/tests/baselines/reference/commentEmitWithCommentOnLastLine.js index 3f15c3a3dd9bb..704d208e96dc9 100644 --- a/tests/baselines/reference/commentEmitWithCommentOnLastLine.js +++ b/tests/baselines/reference/commentEmitWithCommentOnLastLine.js @@ -7,6 +7,7 @@ var bar; */ //// [commentEmitWithCommentOnLastLine.js] +"use strict"; var x; /* var bar; diff --git a/tests/baselines/reference/commentInEmptyParameterList1.js b/tests/baselines/reference/commentInEmptyParameterList1.js index 59de3a84487fe..3e76a33e6bc34 100644 --- a/tests/baselines/reference/commentInEmptyParameterList1.js +++ b/tests/baselines/reference/commentInEmptyParameterList1.js @@ -5,5 +5,6 @@ function foo(/** nothing */) { } //// [commentInEmptyParameterList1.js] +"use strict"; function foo( /** nothing */) { } diff --git a/tests/baselines/reference/commentInMethodCall.errors.txt b/tests/baselines/reference/commentInMethodCall.errors.txt new file mode 100644 index 0000000000000..7345836a26c96 --- /dev/null +++ b/tests/baselines/reference/commentInMethodCall.errors.txt @@ -0,0 +1,11 @@ +commentInMethodCall.ts(3,1): error TS2454: Variable 's' is used before being assigned. + + +==== commentInMethodCall.ts (1 errors) ==== + //commment here + var s: string[]; + s.map(// do something + ~ +!!! error TS2454: Variable 's' is used before being assigned. + function () { }); + \ No newline at end of file diff --git a/tests/baselines/reference/commentInMethodCall.js b/tests/baselines/reference/commentInMethodCall.js index f748c36e76d3f..6cccda7c73357 100644 --- a/tests/baselines/reference/commentInMethodCall.js +++ b/tests/baselines/reference/commentInMethodCall.js @@ -8,6 +8,7 @@ s.map(// do something //// [commentInMethodCall.js] +"use strict"; //commment here var s; s.map(// do something diff --git a/tests/baselines/reference/commentInNamespaceDeclarationWithIdentifierPathName.js b/tests/baselines/reference/commentInNamespaceDeclarationWithIdentifierPathName.js index eba568e3c94eb..144146998baff 100644 --- a/tests/baselines/reference/commentInNamespaceDeclarationWithIdentifierPathName.js +++ b/tests/baselines/reference/commentInNamespaceDeclarationWithIdentifierPathName.js @@ -9,6 +9,7 @@ namespace hello.hi.world } //// [commentInNamespaceDeclarationWithIdentifierPathName.js] +"use strict"; var hello; (function (hello) { var hi; diff --git a/tests/baselines/reference/commentLeadingCloseBrace.js b/tests/baselines/reference/commentLeadingCloseBrace.js index 9ac7b1a2d15db..78c70513721fc 100644 --- a/tests/baselines/reference/commentLeadingCloseBrace.js +++ b/tests/baselines/reference/commentLeadingCloseBrace.js @@ -14,6 +14,7 @@ function ifelse() { } //// [commentLeadingCloseBrace.js] +"use strict"; function ifelse() { if (commentedParameters(1, 2)) { /*comment1*/ diff --git a/tests/baselines/reference/commentOnAmbientClass1.js b/tests/baselines/reference/commentOnAmbientClass1.js index 9837da4c371c4..897f73cdf08c4 100644 --- a/tests/baselines/reference/commentOnAmbientClass1.js +++ b/tests/baselines/reference/commentOnAmbientClass1.js @@ -20,9 +20,11 @@ declare class E extends C { } //// [a.js] +"use strict"; /*!========= Keep this pinned comment ========= */ //// [b.js] +"use strict"; /// diff --git a/tests/baselines/reference/commentOnAmbientEnum.js b/tests/baselines/reference/commentOnAmbientEnum.js index f6c9d92ebff45..08e182a787a51 100644 --- a/tests/baselines/reference/commentOnAmbientEnum.js +++ b/tests/baselines/reference/commentOnAmbientEnum.js @@ -23,9 +23,11 @@ declare enum E { } //// [a.js] +"use strict"; /*!========= Keep this pinned comment ========= */ //// [b.js] +"use strict"; /// diff --git a/tests/baselines/reference/commentOnAmbientModule.js b/tests/baselines/reference/commentOnAmbientModule.js index 34196ac4b84c5..4002c4c589cba 100644 --- a/tests/baselines/reference/commentOnAmbientModule.js +++ b/tests/baselines/reference/commentOnAmbientModule.js @@ -25,9 +25,11 @@ declare namespace E { } //// [a.js] +"use strict"; /*!========= Keep this pinned comment ========= */ //// [b.js] +"use strict"; /// diff --git a/tests/baselines/reference/commentOnAmbientVariable1.js b/tests/baselines/reference/commentOnAmbientVariable1.js index 5220f0f1b0c0f..f77ef6700a651 100644 --- a/tests/baselines/reference/commentOnAmbientVariable1.js +++ b/tests/baselines/reference/commentOnAmbientVariable1.js @@ -13,6 +13,7 @@ declare var v: number; declare var y: number; //// [commentOnAmbientVariable1.js] +"use strict"; /*!========= Keep this pinned comment ========= diff --git a/tests/baselines/reference/commentOnAmbientVariable2.js b/tests/baselines/reference/commentOnAmbientVariable2.js index 8aacecae0ef1a..725b62a968fec 100644 --- a/tests/baselines/reference/commentOnAmbientVariable2.js +++ b/tests/baselines/reference/commentOnAmbientVariable2.js @@ -9,7 +9,9 @@ declare var x: number; x = 2; //// [commentOnAmbientVariable2_1.js] +"use strict"; var y = 1; //// [commentOnAmbientVariable2_2.js] +"use strict"; /// x = 2; diff --git a/tests/baselines/reference/commentOnAmbientfunction.js b/tests/baselines/reference/commentOnAmbientfunction.js index 2261323694113..c7be06e41c266 100644 --- a/tests/baselines/reference/commentOnAmbientfunction.js +++ b/tests/baselines/reference/commentOnAmbientfunction.js @@ -17,9 +17,11 @@ declare function bar(); declare function foobar(a: typeof foo): typeof bar; //// [a.js] +"use strict"; /*!========= Keep this pinned comment ========= */ //// [b.js] +"use strict"; /// diff --git a/tests/baselines/reference/commentOnArrayElement1.js b/tests/baselines/reference/commentOnArrayElement1.js index 94d861c359fc0..9ae45d4bcf3a4 100644 --- a/tests/baselines/reference/commentOnArrayElement1.js +++ b/tests/baselines/reference/commentOnArrayElement1.js @@ -10,6 +10,7 @@ const array = [ ]; //// [commentOnArrayElement1.js] +"use strict"; const array = [ /* element 1*/ 1 diff --git a/tests/baselines/reference/commentOnArrayElement10.js b/tests/baselines/reference/commentOnArrayElement10.js index a93be02073caf..a8308f5f23bce 100644 --- a/tests/baselines/reference/commentOnArrayElement10.js +++ b/tests/baselines/reference/commentOnArrayElement10.js @@ -5,4 +5,5 @@ const array = [,, /* comment */]; //// [commentOnArrayElement10.js] +"use strict"; const array = [, , /* comment */]; diff --git a/tests/baselines/reference/commentOnArrayElement10.types b/tests/baselines/reference/commentOnArrayElement10.types index 1b15d44bd7dfc..27c3693c0c42f 100644 --- a/tests/baselines/reference/commentOnArrayElement10.types +++ b/tests/baselines/reference/commentOnArrayElement10.types @@ -2,8 +2,8 @@ === commentOnArrayElement10.ts === const array = [,, /* comment */]; ->array : any[] -> : ^^^^^ +>array : undefined[] +> : ^^^^^^^^^^^ >[,, /* comment */] : undefined[] > : ^^^^^^^^^^^ diff --git a/tests/baselines/reference/commentOnArrayElement11.js b/tests/baselines/reference/commentOnArrayElement11.js index d9de365ce1117..5192257b37774 100644 --- a/tests/baselines/reference/commentOnArrayElement11.js +++ b/tests/baselines/reference/commentOnArrayElement11.js @@ -7,6 +7,7 @@ const array = [ //// [commentOnArrayElement11.js] +"use strict"; const array = [ , /* comment */ ]; diff --git a/tests/baselines/reference/commentOnArrayElement11.types b/tests/baselines/reference/commentOnArrayElement11.types index a900037040037..db16b00957302 100644 --- a/tests/baselines/reference/commentOnArrayElement11.types +++ b/tests/baselines/reference/commentOnArrayElement11.types @@ -2,8 +2,8 @@ === commentOnArrayElement11.ts === const array = [ ->array : any[] -> : ^^^^^ +>array : undefined[] +> : ^^^^^^^^^^^ >[ , /* comment */] : undefined[] > : ^^^^^^^^^^^ diff --git a/tests/baselines/reference/commentOnArrayElement12.js b/tests/baselines/reference/commentOnArrayElement12.js index c2925f991f39a..31ad082c2275e 100644 --- a/tests/baselines/reference/commentOnArrayElement12.js +++ b/tests/baselines/reference/commentOnArrayElement12.js @@ -7,6 +7,7 @@ const array = [ //// [commentOnArrayElement12.js] +"use strict"; const array = [ , , /* comment */ diff --git a/tests/baselines/reference/commentOnArrayElement12.types b/tests/baselines/reference/commentOnArrayElement12.types index 666d5a1fa7ca7..dd2b2dfd29684 100644 --- a/tests/baselines/reference/commentOnArrayElement12.types +++ b/tests/baselines/reference/commentOnArrayElement12.types @@ -2,8 +2,8 @@ === commentOnArrayElement12.ts === const array = [ ->array : any[] -> : ^^^^^ +>array : undefined[] +> : ^^^^^^^^^^^ >[ ,, /* comment */] : undefined[] > : ^^^^^^^^^^^ diff --git a/tests/baselines/reference/commentOnArrayElement13.js b/tests/baselines/reference/commentOnArrayElement13.js index 8e47f580fdcda..c2762cb017bdf 100644 --- a/tests/baselines/reference/commentOnArrayElement13.js +++ b/tests/baselines/reference/commentOnArrayElement13.js @@ -5,4 +5,5 @@ const array = [/* comment */]; //// [commentOnArrayElement13.js] +"use strict"; const array = [ /* comment */]; diff --git a/tests/baselines/reference/commentOnArrayElement13.types b/tests/baselines/reference/commentOnArrayElement13.types index a3469ffd49c2f..45639d06c3533 100644 --- a/tests/baselines/reference/commentOnArrayElement13.types +++ b/tests/baselines/reference/commentOnArrayElement13.types @@ -4,6 +4,6 @@ const array = [/* comment */]; >array : any[] > : ^^^^^ ->[/* comment */] : undefined[] -> : ^^^^^^^^^^^ +>[/* comment */] : never[] +> : ^^^^^^^ diff --git a/tests/baselines/reference/commentOnArrayElement14.js b/tests/baselines/reference/commentOnArrayElement14.js index 2467f56d2b058..d3bc392bd8637 100644 --- a/tests/baselines/reference/commentOnArrayElement14.js +++ b/tests/baselines/reference/commentOnArrayElement14.js @@ -5,4 +5,5 @@ const array = [1 /* comment */]; //// [commentOnArrayElement14.js] +"use strict"; const array = [1 /* comment */]; diff --git a/tests/baselines/reference/commentOnArrayElement15.js b/tests/baselines/reference/commentOnArrayElement15.js index 768be8830411d..e080e93b1c604 100644 --- a/tests/baselines/reference/commentOnArrayElement15.js +++ b/tests/baselines/reference/commentOnArrayElement15.js @@ -5,4 +5,5 @@ const array = [/* comment */ 1 /* comment */]; //// [commentOnArrayElement15.js] +"use strict"; const array = [/* comment */ 1 /* comment */]; diff --git a/tests/baselines/reference/commentOnArrayElement16.js b/tests/baselines/reference/commentOnArrayElement16.js index 35d3aa81f1e62..f60b6aa6f7f28 100644 --- a/tests/baselines/reference/commentOnArrayElement16.js +++ b/tests/baselines/reference/commentOnArrayElement16.js @@ -10,6 +10,7 @@ const array = [ //// [commentOnArrayElement16.js] +"use strict"; const array = [ // comment start 1, diff --git a/tests/baselines/reference/commentOnArrayElement2.js b/tests/baselines/reference/commentOnArrayElement2.js index 5641206a5ed39..96e3763bbc068 100644 --- a/tests/baselines/reference/commentOnArrayElement2.js +++ b/tests/baselines/reference/commentOnArrayElement2.js @@ -9,6 +9,7 @@ const array = [ ]; //// [commentOnArrayElement2.js] +"use strict"; const array = [ /* element 1*/ 1 /* end of element 1 */, diff --git a/tests/baselines/reference/commentOnArrayElement3.js b/tests/baselines/reference/commentOnArrayElement3.js index d399206087d3c..4e0437d702424 100644 --- a/tests/baselines/reference/commentOnArrayElement3.js +++ b/tests/baselines/reference/commentOnArrayElement3.js @@ -11,6 +11,7 @@ const array = [ ]; //// [commentOnArrayElement3.js] +"use strict"; const array = [ /* element 1*/ 1 diff --git a/tests/baselines/reference/commentOnArrayElement3.types b/tests/baselines/reference/commentOnArrayElement3.types index d08db96832767..f3a45bade57a2 100644 --- a/tests/baselines/reference/commentOnArrayElement3.types +++ b/tests/baselines/reference/commentOnArrayElement3.types @@ -2,10 +2,10 @@ === commentOnArrayElement3.ts === const array = [ ->array : number[] -> : ^^^^^^^^ ->[ /* element 1*/ 1 /* end of element 1 */, 2 /* end of element 2 */, , /* extra comment */] : number[] -> : ^^^^^^^^ +>array : (number | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^^^ +>[ /* element 1*/ 1 /* end of element 1 */, 2 /* end of element 2 */, , /* extra comment */] : (number | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^^^ /* element 1*/ 1 diff --git a/tests/baselines/reference/commentOnArrayElement4.js b/tests/baselines/reference/commentOnArrayElement4.js index b993a0e4d9f54..b4fb8c668816d 100644 --- a/tests/baselines/reference/commentOnArrayElement4.js +++ b/tests/baselines/reference/commentOnArrayElement4.js @@ -9,6 +9,7 @@ const array = [ //// [commentOnArrayElement4.js] +"use strict"; const array = [ /* element 1 */ 1, diff --git a/tests/baselines/reference/commentOnArrayElement5.js b/tests/baselines/reference/commentOnArrayElement5.js index a1417698b1678..2c92759caba71 100644 --- a/tests/baselines/reference/commentOnArrayElement5.js +++ b/tests/baselines/reference/commentOnArrayElement5.js @@ -10,6 +10,7 @@ const array = [ //// [commentOnArrayElement5.js] +"use strict"; const array = [ /* element 1 */ 1, diff --git a/tests/baselines/reference/commentOnArrayElement6.js b/tests/baselines/reference/commentOnArrayElement6.js index b27bfff17ade9..74875497f6aba 100644 --- a/tests/baselines/reference/commentOnArrayElement6.js +++ b/tests/baselines/reference/commentOnArrayElement6.js @@ -5,4 +5,5 @@ const array = [1, /* comment */]; //// [commentOnArrayElement6.js] +"use strict"; const array = [1, /* comment */]; diff --git a/tests/baselines/reference/commentOnArrayElement7.js b/tests/baselines/reference/commentOnArrayElement7.js index 488e6f6699ca2..6b57a095341ec 100644 --- a/tests/baselines/reference/commentOnArrayElement7.js +++ b/tests/baselines/reference/commentOnArrayElement7.js @@ -5,4 +5,5 @@ const array = [/* element 1 */ 1, /* end of element 1 */]; //// [commentOnArrayElement7.js] +"use strict"; const array = [/* element 1 */ 1, /* end of element 1 */]; diff --git a/tests/baselines/reference/commentOnArrayElement8.js b/tests/baselines/reference/commentOnArrayElement8.js index 88f42435c0f26..747e7cb432169 100644 --- a/tests/baselines/reference/commentOnArrayElement8.js +++ b/tests/baselines/reference/commentOnArrayElement8.js @@ -7,6 +7,7 @@ const array = [ //// [commentOnArrayElement8.js] +"use strict"; const array = [ 1, /* comment */ ]; diff --git a/tests/baselines/reference/commentOnArrayElement9.js b/tests/baselines/reference/commentOnArrayElement9.js index 87bc9e322d650..ec44e34ade14f 100644 --- a/tests/baselines/reference/commentOnArrayElement9.js +++ b/tests/baselines/reference/commentOnArrayElement9.js @@ -7,6 +7,7 @@ const array = [ //// [commentOnArrayElement9.js] +"use strict"; const array = [ /* element 1 */ 1, /* end of element 1 */ ]; diff --git a/tests/baselines/reference/commentOnBinaryOperator1.js b/tests/baselines/reference/commentOnBinaryOperator1.js index e66ad54059b45..692f67c4839ca 100644 --- a/tests/baselines/reference/commentOnBinaryOperator1.js +++ b/tests/baselines/reference/commentOnBinaryOperator1.js @@ -15,6 +15,7 @@ var c = 'some' 'text'; //// [commentOnBinaryOperator1.js] +"use strict"; var a = 'some' // comment + 'text'; diff --git a/tests/baselines/reference/commentOnBinaryOperator2.js b/tests/baselines/reference/commentOnBinaryOperator2.js index 125a1757e6446..f062e2e5c707a 100644 --- a/tests/baselines/reference/commentOnBinaryOperator2.js +++ b/tests/baselines/reference/commentOnBinaryOperator2.js @@ -15,6 +15,7 @@ var c = 'some' 'text'; //// [commentOnBinaryOperator2.js] +"use strict"; var a = 'some' + 'text'; var b = 'some' diff --git a/tests/baselines/reference/commentOnBlock1.js b/tests/baselines/reference/commentOnBlock1.js index 614314e0d02d7..df0ac2aa39d97 100644 --- a/tests/baselines/reference/commentOnBlock1.js +++ b/tests/baselines/reference/commentOnBlock1.js @@ -7,6 +7,7 @@ function f() { } //// [commentOnBlock1.js] +"use strict"; // asdf function f() { /*asdf*/ { } diff --git a/tests/baselines/reference/commentOnClassAccessor1.js b/tests/baselines/reference/commentOnClassAccessor1.js index fd3ba9ac507d6..1e12566eca0c4 100644 --- a/tests/baselines/reference/commentOnClassAccessor1.js +++ b/tests/baselines/reference/commentOnClassAccessor1.js @@ -9,6 +9,7 @@ class C { } //// [commentOnClassAccessor1.js] +"use strict"; class C { /** * @type {number} diff --git a/tests/baselines/reference/commentOnClassAccessor2.js b/tests/baselines/reference/commentOnClassAccessor2.js index f3e55e161cee4..0a3a3dc170b02 100644 --- a/tests/baselines/reference/commentOnClassAccessor2.js +++ b/tests/baselines/reference/commentOnClassAccessor2.js @@ -14,6 +14,7 @@ class C { } //// [commentOnClassAccessor2.js] +"use strict"; class C { /** * Getter. diff --git a/tests/baselines/reference/commentOnClassMethod1.js b/tests/baselines/reference/commentOnClassMethod1.js index 65dfaa20910d5..e4998c21fed79 100644 --- a/tests/baselines/reference/commentOnClassMethod1.js +++ b/tests/baselines/reference/commentOnClassMethod1.js @@ -10,6 +10,7 @@ class WebControls { } //// [commentOnClassMethod1.js] +"use strict"; class WebControls { /** * Render a control diff --git a/tests/baselines/reference/commentOnDecoratedClassDeclaration.js b/tests/baselines/reference/commentOnDecoratedClassDeclaration.js index 0aacd28076ed5..761008575f966 100644 --- a/tests/baselines/reference/commentOnDecoratedClassDeclaration.js +++ b/tests/baselines/reference/commentOnDecoratedClassDeclaration.js @@ -19,6 +19,7 @@ class AnotherRomote { } //// [commentOnDecoratedClassDeclaration.js] +"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); diff --git a/tests/baselines/reference/commentOnElidedModule1.js b/tests/baselines/reference/commentOnElidedModule1.js index d75796cb1e2ae..03a565fc22a59 100644 --- a/tests/baselines/reference/commentOnElidedModule1.js +++ b/tests/baselines/reference/commentOnElidedModule1.js @@ -20,9 +20,11 @@ namespace ElidedModule3 { } //// [a.js] +"use strict"; /*!================= Keep this pinned ================= */ //// [b.js] +"use strict"; /// diff --git a/tests/baselines/reference/commentOnExpressionStatement1.js b/tests/baselines/reference/commentOnExpressionStatement1.js index 4ebafb88cffc0..ae32ed4906d86 100644 --- a/tests/baselines/reference/commentOnExpressionStatement1.js +++ b/tests/baselines/reference/commentOnExpressionStatement1.js @@ -4,4 +4,5 @@ 1 + 1; // Comment. //// [commentOnExpressionStatement1.js] +"use strict"; 1 + 1; // Comment. diff --git a/tests/baselines/reference/commentOnIfStatement1.js b/tests/baselines/reference/commentOnIfStatement1.js index 6905b0c216e59..a5b4de05078ab 100644 --- a/tests/baselines/reference/commentOnIfStatement1.js +++ b/tests/baselines/reference/commentOnIfStatement1.js @@ -6,6 +6,7 @@ if (true) { } //// [commentOnIfStatement1.js] +"use strict"; // Test if (true) { } diff --git a/tests/baselines/reference/commentOnInterface1.js b/tests/baselines/reference/commentOnInterface1.js index c51658e2dfa9b..14c71f554351d 100644 --- a/tests/baselines/reference/commentOnInterface1.js +++ b/tests/baselines/reference/commentOnInterface1.js @@ -20,9 +20,11 @@ interface I3 { } //// [a.js] +"use strict"; /*!================= Keep this pinned ================= */ //// [b.js] +"use strict"; /// diff --git a/tests/baselines/reference/commentOnParameter1.js b/tests/baselines/reference/commentOnParameter1.js index 46d99a5162004..f8655c9e95d93 100644 --- a/tests/baselines/reference/commentOnParameter1.js +++ b/tests/baselines/reference/commentOnParameter1.js @@ -12,6 +12,7 @@ b ){} //// [commentOnParameter1.js] +"use strict"; function commentedParameters( /* Parameter a */ a diff --git a/tests/baselines/reference/commentOnParameter2.js b/tests/baselines/reference/commentOnParameter2.js index 545200e12d9aa..1f4e08277b221 100644 --- a/tests/baselines/reference/commentOnParameter2.js +++ b/tests/baselines/reference/commentOnParameter2.js @@ -11,6 +11,7 @@ b ){} //// [commentOnParameter2.js] +"use strict"; function commentedParameters( /* Parameter a */ a /* End of parameter a */ diff --git a/tests/baselines/reference/commentOnParameter3.js b/tests/baselines/reference/commentOnParameter3.js index 75ce1556ff62f..9bcaf521d5bf0 100644 --- a/tests/baselines/reference/commentOnParameter3.js +++ b/tests/baselines/reference/commentOnParameter3.js @@ -8,4 +8,5 @@ b /* parameter b */, ) { } //// [commentOnParameter3.js] +"use strict"; function commentedParameters(a /* parameter a */, b /* parameter b */) { } diff --git a/tests/baselines/reference/commentOnParenthesizedExpressionOpenParen1.errors.txt b/tests/baselines/reference/commentOnParenthesizedExpressionOpenParen1.errors.txt new file mode 100644 index 0000000000000..3fdb15e37780f --- /dev/null +++ b/tests/baselines/reference/commentOnParenthesizedExpressionOpenParen1.errors.txt @@ -0,0 +1,10 @@ +commentOnParenthesizedExpressionOpenParen1.ts(3,27): error TS2454: Variable 'f' is used before being assigned. + + +==== commentOnParenthesizedExpressionOpenParen1.ts (1 errors) ==== + var j; + var f: () => any; + ( /* Preserve */ j = f()); + ~ +!!! error TS2454: Variable 'f' is used before being assigned. + \ No newline at end of file diff --git a/tests/baselines/reference/commentOnParenthesizedExpressionOpenParen1.js b/tests/baselines/reference/commentOnParenthesizedExpressionOpenParen1.js index f8b7ee90b0f89..7d426f7ae0557 100644 --- a/tests/baselines/reference/commentOnParenthesizedExpressionOpenParen1.js +++ b/tests/baselines/reference/commentOnParenthesizedExpressionOpenParen1.js @@ -7,6 +7,7 @@ var f: () => any; //// [commentOnParenthesizedExpressionOpenParen1.js] +"use strict"; var j; var f; ( /* Preserve */j = f()); diff --git a/tests/baselines/reference/commentOnParenthesizedExpressionOpenParen1.types b/tests/baselines/reference/commentOnParenthesizedExpressionOpenParen1.types index 64a0d0c329b1a..0d970cf70f270 100644 --- a/tests/baselines/reference/commentOnParenthesizedExpressionOpenParen1.types +++ b/tests/baselines/reference/commentOnParenthesizedExpressionOpenParen1.types @@ -3,6 +3,7 @@ === commentOnParenthesizedExpressionOpenParen1.ts === var j; >j : any +> : ^^^ var f: () => any; >f : () => any @@ -10,10 +11,15 @@ var f: () => any; ( /* Preserve */ j = f()); >( /* Preserve */ j = f()) : any +> : ^^^ >( /* Preserve */ j = f()) : any +> : ^^^ >j = f() : any +> : ^^^ >j : any +> : ^^^ >f() : any +> : ^^^ >f : () => any > : ^^^^^^ diff --git a/tests/baselines/reference/commentOnSignature1.js b/tests/baselines/reference/commentOnSignature1.js index 637e3b25b9de5..b0ca29011b883 100644 --- a/tests/baselines/reference/commentOnSignature1.js +++ b/tests/baselines/reference/commentOnSignature1.js @@ -38,6 +38,7 @@ function foo2(a: any): void { } //// [a.js] +"use strict"; /*!================= Keep this pinned ================= @@ -51,6 +52,7 @@ class c { } } //// [b.js] +"use strict"; /// function foo2(a) { } diff --git a/tests/baselines/reference/commentOnSimpleArrowFunctionBody1.js b/tests/baselines/reference/commentOnSimpleArrowFunctionBody1.js index fc96964ecd3a1..56a4f157c3921 100644 --- a/tests/baselines/reference/commentOnSimpleArrowFunctionBody1.js +++ b/tests/baselines/reference/commentOnSimpleArrowFunctionBody1.js @@ -11,6 +11,7 @@ Foo(() => //// [commentOnSimpleArrowFunctionBody1.js] +"use strict"; function Foo(x) { } Foo(() => diff --git a/tests/baselines/reference/commentOnStaticMember1.js b/tests/baselines/reference/commentOnStaticMember1.js index cc5937347498c..6288c02ff26c1 100644 --- a/tests/baselines/reference/commentOnStaticMember1.js +++ b/tests/baselines/reference/commentOnStaticMember1.js @@ -8,6 +8,7 @@ class Greeter { } //// [commentOnStaticMember1.js] +"use strict"; class Greeter { //Hello World static foo() { diff --git a/tests/baselines/reference/commentsAfterCaseClauses1.js b/tests/baselines/reference/commentsAfterCaseClauses1.js index b971a1f5ce187..1e69f0d40ca77 100644 --- a/tests/baselines/reference/commentsAfterCaseClauses1.js +++ b/tests/baselines/reference/commentsAfterCaseClauses1.js @@ -17,6 +17,7 @@ function getSecurity(level) { } //// [commentsAfterCaseClauses1.js] +"use strict"; function getSecurity(level) { switch (level) { case 0: // Zero diff --git a/tests/baselines/reference/commentsAfterCaseClauses2.js b/tests/baselines/reference/commentsAfterCaseClauses2.js index d3c4ab0a42bcf..aec58bd95d3e8 100644 --- a/tests/baselines/reference/commentsAfterCaseClauses2.js +++ b/tests/baselines/reference/commentsAfterCaseClauses2.js @@ -20,6 +20,7 @@ function getSecurity(level) { } //// [commentsAfterCaseClauses2.js] +"use strict"; function getSecurity(level) { switch (level) { case 0: // Zero diff --git a/tests/baselines/reference/commentsAfterCaseClauses3.js b/tests/baselines/reference/commentsAfterCaseClauses3.js index 5e0d4c5bd57c7..d13787a8b99b5 100644 --- a/tests/baselines/reference/commentsAfterCaseClauses3.js +++ b/tests/baselines/reference/commentsAfterCaseClauses3.js @@ -19,6 +19,7 @@ function getSecurity(level) { } //// [commentsAfterCaseClauses3.js] +"use strict"; function getSecurity(level) { switch (level) { case 0: /*Zero*/ diff --git a/tests/baselines/reference/commentsAfterFunctionExpression1.js b/tests/baselines/reference/commentsAfterFunctionExpression1.js index fbf2483d40bbc..f1b66d3336953 100644 --- a/tests/baselines/reference/commentsAfterFunctionExpression1.js +++ b/tests/baselines/reference/commentsAfterFunctionExpression1.js @@ -9,6 +9,7 @@ var v = { //// [commentsAfterFunctionExpression1.js] +"use strict"; var v = { f: a => 0 /*t1*/, g: (a => 0) /*t2*/, diff --git a/tests/baselines/reference/commentsAfterSpread.js b/tests/baselines/reference/commentsAfterSpread.js index d2d9b9277cb2b..be72d255adb39 100644 --- a/tests/baselines/reference/commentsAfterSpread.js +++ b/tests/baselines/reference/commentsAfterSpread.js @@ -81,6 +81,7 @@ function k ({ } //// [commentsAfterSpread.js] +"use strict"; const identity = (a) => a; const a = { ... /*#__PURE__*/identity({ diff --git a/tests/baselines/reference/commentsArgumentsOfCallExpression1.js b/tests/baselines/reference/commentsArgumentsOfCallExpression1.js index a389e7b308ccf..b8d8e42639ba3 100644 --- a/tests/baselines/reference/commentsArgumentsOfCallExpression1.js +++ b/tests/baselines/reference/commentsArgumentsOfCallExpression1.js @@ -18,6 +18,7 @@ foo( /*c8*/() => { }); //// [commentsArgumentsOfCallExpression1.js] +"use strict"; function foo(/*c1*/ x) { } foo(/*c2*/ 1); foo(/*c3*/ function () { }); diff --git a/tests/baselines/reference/commentsArgumentsOfCallExpression2.js b/tests/baselines/reference/commentsArgumentsOfCallExpression2.js index 569d987e6baba..9dee06e1597a3 100644 --- a/tests/baselines/reference/commentsArgumentsOfCallExpression2.js +++ b/tests/baselines/reference/commentsArgumentsOfCallExpression2.js @@ -13,6 +13,7 @@ foo( /*e5*/ "hello"); //// [commentsArgumentsOfCallExpression2.js] +"use strict"; function foo(/*c1*/ x, /*d1*/ y, /*e1*/ w) { } var a, b; foo(/*c2*/ 1, /*d2*/ 1 + 2, /*e1*/ a + b); diff --git a/tests/baselines/reference/commentsArgumentsOfCallExpression2.types b/tests/baselines/reference/commentsArgumentsOfCallExpression2.types index 3073dfe24ec14..c9ae02595eaad 100644 --- a/tests/baselines/reference/commentsArgumentsOfCallExpression2.types +++ b/tests/baselines/reference/commentsArgumentsOfCallExpression2.types @@ -26,7 +26,8 @@ foo(/*c2*/ 1, /*d2*/ 1 + 2, /*e1*/ a + b); >2 : 2 > : ^ >a + b : any ->a : any +>a : undefined +> : ^^^^^^^^^ >b : any foo(/*c3*/ function () { }, /*d2*/() => { }, /*e2*/ a + /*e3*/ b); @@ -39,7 +40,8 @@ foo(/*c3*/ function () { }, /*d2*/() => { }, /*e2*/ a + /*e3*/ b); >() => { } : () => void > : ^^^^^^^^^^ >a + /*e3*/ b : any ->a : any +>a : undefined +> : ^^^^^^^^^ >b : any foo(/*c3*/ function () { }, /*d3*/() => { }, /*e3*/(a + b)); @@ -53,7 +55,8 @@ foo(/*c3*/ function () { }, /*d3*/() => { }, /*e3*/(a + b)); > : ^^^^^^^^^^ >(a + b) : any >a + b : any ->a : any +>a : undefined +> : ^^^^^^^^^ >b : any foo( diff --git a/tests/baselines/reference/commentsAtEndOfFile1.js b/tests/baselines/reference/commentsAtEndOfFile1.js index 7bbcba2e78e81..8fd473cc23bfc 100644 --- a/tests/baselines/reference/commentsAtEndOfFile1.js +++ b/tests/baselines/reference/commentsAtEndOfFile1.js @@ -7,5 +7,6 @@ Input: //// [commentsAtEndOfFile1.js] +"use strict"; Input: ; //Testing two diff --git a/tests/baselines/reference/commentsBeforeFunctionExpression1.js b/tests/baselines/reference/commentsBeforeFunctionExpression1.js index ead9db1f279fc..7b07ef681f414 100644 --- a/tests/baselines/reference/commentsBeforeFunctionExpression1.js +++ b/tests/baselines/reference/commentsBeforeFunctionExpression1.js @@ -7,6 +7,7 @@ var v = { //// [commentsBeforeFunctionExpression1.js] +"use strict"; var v = { f: /**own f*/ (a) => 0 }; diff --git a/tests/baselines/reference/commentsClass(target=es2015).js b/tests/baselines/reference/commentsClass(target=es2015).js index 813749aac4d39..e581678bacad2 100644 --- a/tests/baselines/reference/commentsClass(target=es2015).js +++ b/tests/baselines/reference/commentsClass(target=es2015).js @@ -75,6 +75,7 @@ class c9 { //// [commentsClass.js] +"use strict"; /** This is class c2 without constuctor*/ class c2 { } // trailing comment1 diff --git a/tests/baselines/reference/commentsClass(target=es5).js b/tests/baselines/reference/commentsClass(target=es5).js index 037d69f3cbd7b..544ab8787e505 100644 --- a/tests/baselines/reference/commentsClass(target=es5).js +++ b/tests/baselines/reference/commentsClass(target=es5).js @@ -75,6 +75,7 @@ class c9 { //// [commentsClass.js] +"use strict"; /** This is class c2 without constuctor*/ var c2 = /** @class */ (function () { function c2() { diff --git a/tests/baselines/reference/commentsClassMembers(target=es2015).errors.txt b/tests/baselines/reference/commentsClassMembers(target=es2015).errors.txt new file mode 100644 index 0000000000000..bb9a83a2b3c11 --- /dev/null +++ b/tests/baselines/reference/commentsClassMembers(target=es2015).errors.txt @@ -0,0 +1,247 @@ +commentsClassMembers.ts(4,12): error TS2564: Property 'p1' has no initializer and is not definitely assigned in the constructor. +commentsClassMembers.ts(18,13): error TS2564: Property 'pp1' has no initializer and is not definitely assigned in the constructor. +commentsClassMembers.ts(48,12): error TS2564: Property 'nc_p1' has no initializer and is not definitely assigned in the constructor. +commentsClassMembers.ts(58,13): error TS2564: Property 'nc_pp1' has no initializer and is not definitely assigned in the constructor. +commentsClassMembers.ts(80,12): error TS2564: Property 'a_p1' has no initializer and is not definitely assigned in the constructor. +commentsClassMembers.ts(94,13): error TS2564: Property 'a_pp1' has no initializer and is not definitely assigned in the constructor. +commentsClassMembers.ts(125,12): error TS2564: Property 'b_p1' has no initializer and is not definitely assigned in the constructor. +commentsClassMembers.ts(139,13): error TS2564: Property 'b_pp1' has no initializer and is not definitely assigned in the constructor. +commentsClassMembers.ts(195,13): error TS2564: Property 'val' has no initializer and is not definitely assigned in the constructor. + + +==== commentsClassMembers.ts (9 errors) ==== + /** This is comment for c1*/ + class c1 { + /** p1 is property of c1*/ + public p1: number; + ~~ +!!! error TS2564: Property 'p1' has no initializer and is not definitely assigned in the constructor. + /** sum with property*/ + public p2(/** number to add*/b: number) { + return this.p1 + b; + } /* trailing comment of method*/ + /** getter property*/ + public get p3() { + return this.p2(this.p1); + }// trailing comment Getter + /** setter property*/ + public set p3(/** this is value*/value: number) { + this.p1 = this.p2(value); + }// trailing comment Setter + /** pp1 is property of c1*/ + private pp1: number; + ~~~ +!!! error TS2564: Property 'pp1' has no initializer and is not definitely assigned in the constructor. + /** sum with property*/ + private pp2(/** number to add*/b: number) { + return this.p1 + b; + } // trailing comment of method + /** getter property*/ + private get pp3() { + return this.pp2(this.pp1); + } + /** setter property*/ + private set pp3( /** this is value*/value: number) { + this.pp1 = this.pp2(value); + } + /** Constructor method*/ + constructor() { + } + /** s1 is static property of c1*/ + static s1: number; + /** static sum with property*/ + static s2(/** number to add*/b: number) { + return c1.s1 + b; + } + /** static getter property*/ + static get s3() { + return c1.s2(c1.s1); + } /*trailing comment 1 getter*/ + /** setter property*/ + static set s3( /** this is value*/value: number) { + c1.s1 = c1.s2(value); + }/*trailing comment 2 */ /*setter*/ + public nc_p1: number; + ~~~~~ +!!! error TS2564: Property 'nc_p1' has no initializer and is not definitely assigned in the constructor. + public nc_p2(b: number) { + return this.nc_p1 + b; + } + public get nc_p3() { + return this.nc_p2(this.nc_p1); + } + public set nc_p3(value: number) { + this.nc_p1 = this.nc_p2(value); + } + private nc_pp1: number; + ~~~~~~ +!!! error TS2564: Property 'nc_pp1' has no initializer and is not definitely assigned in the constructor. + private nc_pp2(b: number) { + return this.nc_pp1 + b; + } + private get nc_pp3() { + return this.nc_pp2(this.nc_pp1); + } + private set nc_pp3(value: number) { + this.nc_pp1 = this.nc_pp2(value); + } + static nc_s1: number; + static nc_s2(b: number) { + return c1.nc_s1 + b; + } + static get nc_s3() { + return c1.nc_s2(c1.nc_s1); + } + static set nc_s3(value: number) { + c1.nc_s1 = c1.nc_s2(value); + } + + // p1 is property of c1 + public a_p1: number; + ~~~~ +!!! error TS2564: Property 'a_p1' has no initializer and is not definitely assigned in the constructor. + // sum with property + public a_p2(b: number) { + return this.a_p1 + b; + } + // getter property + public get a_p3() { + return this.a_p2(this.a_p1); + } + // setter property + public set a_p3(value: number) { + this.a_p1 = this.a_p2(value); + } + // pp1 is property of c1 + private a_pp1: number; + ~~~~~ +!!! error TS2564: Property 'a_pp1' has no initializer and is not definitely assigned in the constructor. + // sum with property + private a_pp2(b: number) { + return this.a_p1 + b; + } + // getter property + private get a_pp3() { + return this.a_pp2(this.a_pp1); + } + // setter property + private set a_pp3(value: number) { + this.a_pp1 = this.a_pp2(value); + } + + // s1 is static property of c1 + static a_s1: number; + // static sum with property + static a_s2(b: number) { + return c1.a_s1 + b; + } + // static getter property + static get a_s3() { + return c1.s2(c1.s1); + } + + // setter property + static set a_s3(value: number) { + c1.a_s1 = c1.a_s2(value); + } + + /** p1 is property of c1 */ + public b_p1: number; + ~~~~ +!!! error TS2564: Property 'b_p1' has no initializer and is not definitely assigned in the constructor. + /** sum with property */ + public b_p2(b: number) { + return this.b_p1 + b; + } + /** getter property */ + public get b_p3() { + return this.b_p2(this.b_p1); + } + /** setter property */ + public set b_p3(value: number) { + this.b_p1 = this.b_p2(value); + } + /** pp1 is property of c1 */ + private b_pp1: number; + ~~~~~ +!!! error TS2564: Property 'b_pp1' has no initializer and is not definitely assigned in the constructor. + /** sum with property */ + private b_pp2(b: number) { + return this.b_p1 + b; + } + /** getter property */ + private get b_pp3() { + return this.b_pp2(this.b_pp1); + } + /** setter property */ + private set b_pp3(value: number) { + this.b_pp1 = this.b_pp2(value); + } + + /** s1 is static property of c1 */ + static b_s1: number; + /** static sum with property */ + static b_s2(b: number) { + return c1.b_s1 + b; + } + /** static getter property + */ + static get b_s3() { + return c1.s2(c1.s1); + } + + /** setter property + */ + static set b_s3(value: number) { + /** setter */ + c1.b_s1 = c1.b_s2(value); + } + } + var i1 = new c1(); + var i1_p = i1.p1; + var i1_f = i1.p2; + var i1_r = i1.p2(20); + var i1_prop = i1.p3; + i1.p3 = i1_prop; + var i1_nc_p = i1.nc_p1; + var i1_ncf = i1.nc_p2; + var i1_ncr = i1.nc_p2(20); + var i1_ncprop = i1.nc_p3; + i1.nc_p3 = i1_ncprop; + var i1_s_p = c1.s1; + var i1_s_f = c1.s2; + var i1_s_r = c1.s2(20); + var i1_s_prop = c1.s3; + c1.s3 = i1_s_prop; + var i1_s_nc_p = c1.nc_s1; + var i1_s_ncf = c1.nc_s2; + var i1_s_ncr = c1.nc_s2(20); + var i1_s_ncprop = c1.nc_s3; + c1.nc_s3 = i1_s_ncprop; + var i1_c = c1; + class cProperties { + private val: number; + ~~~ +!!! error TS2564: Property 'val' has no initializer and is not definitely assigned in the constructor. + /** getter only property*/ + public get p1() { + return this.val; + } // trailing comment of only getter + public get nc_p1() { + return this.val; + } + /**setter only property*/ + public set p2(value: number) { + this.val = value; + } + public set nc_p2(value: number) { + this.val = value; + } /* trailing comment of setter only*/ + + public x = 10; /*trailing comment for property*/ + private y = 10; // trailing comment of // style + } + var cProperties_i = new cProperties(); + cProperties_i.p2 = cProperties_i.p1; + cProperties_i.nc_p2 = cProperties_i.nc_p1; + \ No newline at end of file diff --git a/tests/baselines/reference/commentsClassMembers(target=es2015).js b/tests/baselines/reference/commentsClassMembers(target=es2015).js index 84849db7fcd55..2d27770cfe14d 100644 --- a/tests/baselines/reference/commentsClassMembers(target=es2015).js +++ b/tests/baselines/reference/commentsClassMembers(target=es2015).js @@ -220,6 +220,7 @@ cProperties_i.nc_p2 = cProperties_i.nc_p1; //// [commentsClassMembers.js] +"use strict"; /** This is comment for c1*/ class c1 { /** sum with property*/ diff --git a/tests/baselines/reference/commentsClassMembers(target=es5).errors.txt b/tests/baselines/reference/commentsClassMembers(target=es5).errors.txt index da3665cd12edf..a699725518171 100644 --- a/tests/baselines/reference/commentsClassMembers(target=es5).errors.txt +++ b/tests/baselines/reference/commentsClassMembers(target=es5).errors.txt @@ -1,12 +1,23 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +commentsClassMembers.ts(4,12): error TS2564: Property 'p1' has no initializer and is not definitely assigned in the constructor. +commentsClassMembers.ts(18,13): error TS2564: Property 'pp1' has no initializer and is not definitely assigned in the constructor. +commentsClassMembers.ts(48,12): error TS2564: Property 'nc_p1' has no initializer and is not definitely assigned in the constructor. +commentsClassMembers.ts(58,13): error TS2564: Property 'nc_pp1' has no initializer and is not definitely assigned in the constructor. +commentsClassMembers.ts(80,12): error TS2564: Property 'a_p1' has no initializer and is not definitely assigned in the constructor. +commentsClassMembers.ts(94,13): error TS2564: Property 'a_pp1' has no initializer and is not definitely assigned in the constructor. +commentsClassMembers.ts(125,12): error TS2564: Property 'b_p1' has no initializer and is not definitely assigned in the constructor. +commentsClassMembers.ts(139,13): error TS2564: Property 'b_pp1' has no initializer and is not definitely assigned in the constructor. +commentsClassMembers.ts(195,13): error TS2564: Property 'val' has no initializer and is not definitely assigned in the constructor. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== commentsClassMembers.ts (0 errors) ==== +==== commentsClassMembers.ts (9 errors) ==== /** This is comment for c1*/ class c1 { /** p1 is property of c1*/ public p1: number; + ~~ +!!! error TS2564: Property 'p1' has no initializer and is not definitely assigned in the constructor. /** sum with property*/ public p2(/** number to add*/b: number) { return this.p1 + b; @@ -21,6 +32,8 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in Typ }// trailing comment Setter /** pp1 is property of c1*/ private pp1: number; + ~~~ +!!! error TS2564: Property 'pp1' has no initializer and is not definitely assigned in the constructor. /** sum with property*/ private pp2(/** number to add*/b: number) { return this.p1 + b; @@ -51,6 +64,8 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in Typ c1.s1 = c1.s2(value); }/*trailing comment 2 */ /*setter*/ public nc_p1: number; + ~~~~~ +!!! error TS2564: Property 'nc_p1' has no initializer and is not definitely assigned in the constructor. public nc_p2(b: number) { return this.nc_p1 + b; } @@ -61,6 +76,8 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in Typ this.nc_p1 = this.nc_p2(value); } private nc_pp1: number; + ~~~~~~ +!!! error TS2564: Property 'nc_pp1' has no initializer and is not definitely assigned in the constructor. private nc_pp2(b: number) { return this.nc_pp1 + b; } @@ -83,6 +100,8 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in Typ // p1 is property of c1 public a_p1: number; + ~~~~ +!!! error TS2564: Property 'a_p1' has no initializer and is not definitely assigned in the constructor. // sum with property public a_p2(b: number) { return this.a_p1 + b; @@ -97,6 +116,8 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in Typ } // pp1 is property of c1 private a_pp1: number; + ~~~~~ +!!! error TS2564: Property 'a_pp1' has no initializer and is not definitely assigned in the constructor. // sum with property private a_pp2(b: number) { return this.a_p1 + b; @@ -128,6 +149,8 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in Typ /** p1 is property of c1 */ public b_p1: number; + ~~~~ +!!! error TS2564: Property 'b_p1' has no initializer and is not definitely assigned in the constructor. /** sum with property */ public b_p2(b: number) { return this.b_p1 + b; @@ -142,6 +165,8 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in Typ } /** pp1 is property of c1 */ private b_pp1: number; + ~~~~~ +!!! error TS2564: Property 'b_pp1' has no initializer and is not definitely assigned in the constructor. /** sum with property */ private b_pp2(b: number) { return this.b_p1 + b; @@ -198,6 +223,8 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in Typ var i1_c = c1; class cProperties { private val: number; + ~~~ +!!! error TS2564: Property 'val' has no initializer and is not definitely assigned in the constructor. /** getter only property*/ public get p1() { return this.val; diff --git a/tests/baselines/reference/commentsClassMembers(target=es5).js b/tests/baselines/reference/commentsClassMembers(target=es5).js index 3066e8b42d766..4a6d950e33d8f 100644 --- a/tests/baselines/reference/commentsClassMembers(target=es5).js +++ b/tests/baselines/reference/commentsClassMembers(target=es5).js @@ -220,6 +220,7 @@ cProperties_i.nc_p2 = cProperties_i.nc_p1; //// [commentsClassMembers.js] +"use strict"; /** This is comment for c1*/ var c1 = /** @class */ (function () { /** Constructor method*/ diff --git a/tests/baselines/reference/commentsCommentParsing(target=es2015).js b/tests/baselines/reference/commentsCommentParsing(target=es2015).js index 8ae1611e41ece..d398fea166bcc 100644 --- a/tests/baselines/reference/commentsCommentParsing(target=es2015).js +++ b/tests/baselines/reference/commentsCommentParsing(target=es2015).js @@ -156,6 +156,7 @@ class NoQuickInfoClass { } //// [commentsCommentParsing.js] +"use strict"; /// This is simple /// comments function simple() { } diff --git a/tests/baselines/reference/commentsCommentParsing(target=es5).js b/tests/baselines/reference/commentsCommentParsing(target=es5).js index 27074e85ffafd..7ecc49bffd1e5 100644 --- a/tests/baselines/reference/commentsCommentParsing(target=es5).js +++ b/tests/baselines/reference/commentsCommentParsing(target=es5).js @@ -156,6 +156,7 @@ class NoQuickInfoClass { } //// [commentsCommentParsing.js] +"use strict"; /// This is simple /// comments function simple() { } diff --git a/tests/baselines/reference/commentsEnums(target=es2015).js b/tests/baselines/reference/commentsEnums(target=es2015).js index 41e0c655b0230..09e1021817c1e 100644 --- a/tests/baselines/reference/commentsEnums(target=es2015).js +++ b/tests/baselines/reference/commentsEnums(target=es2015).js @@ -14,6 +14,7 @@ x = Colors.FancyPink; //// [commentsEnums.js] +"use strict"; /** Enum of colors*/ var Colors; (function (Colors) { diff --git a/tests/baselines/reference/commentsEnums(target=es5).js b/tests/baselines/reference/commentsEnums(target=es5).js index 41e0c655b0230..09e1021817c1e 100644 --- a/tests/baselines/reference/commentsEnums(target=es5).js +++ b/tests/baselines/reference/commentsEnums(target=es5).js @@ -14,6 +14,7 @@ x = Colors.FancyPink; //// [commentsEnums.js] +"use strict"; /** Enum of colors*/ var Colors; (function (Colors) { diff --git a/tests/baselines/reference/commentsFormatting(target=es2015).js b/tests/baselines/reference/commentsFormatting(target=es2015).js index 752e32f5b0661..893313df23bc6 100644 --- a/tests/baselines/reference/commentsFormatting(target=es2015).js +++ b/tests/baselines/reference/commentsFormatting(target=es2015).js @@ -88,6 +88,7 @@ this is 4 spaces left aligned but above line is empty } //// [commentsFormatting.js] +"use strict"; var m; (function (m) { /** this is first line - aligned to class declaration diff --git a/tests/baselines/reference/commentsFormatting(target=es5).js b/tests/baselines/reference/commentsFormatting(target=es5).js index 1674dc2ab43c0..88b6887cd0fd7 100644 --- a/tests/baselines/reference/commentsFormatting(target=es5).js +++ b/tests/baselines/reference/commentsFormatting(target=es5).js @@ -88,6 +88,7 @@ this is 4 spaces left aligned but above line is empty } //// [commentsFormatting.js] +"use strict"; var m; (function (m) { /** this is first line - aligned to class declaration diff --git a/tests/baselines/reference/commentsFunction(target=es2015).js b/tests/baselines/reference/commentsFunction(target=es2015).js index 3fa990c4f5631..98b32a717f8da 100644 --- a/tests/baselines/reference/commentsFunction(target=es2015).js +++ b/tests/baselines/reference/commentsFunction(target=es2015).js @@ -57,6 +57,7 @@ function foo2() { //// [commentsFunction.js] +"use strict"; /** This comment should appear for foo*/ function foo() { } /* trailing comment of function */ diff --git a/tests/baselines/reference/commentsFunction(target=es5).js b/tests/baselines/reference/commentsFunction(target=es5).js index bc1e901995cd9..8ac00cbca58a6 100644 --- a/tests/baselines/reference/commentsFunction(target=es5).js +++ b/tests/baselines/reference/commentsFunction(target=es5).js @@ -57,6 +57,7 @@ function foo2() { //// [commentsFunction.js] +"use strict"; /** This comment should appear for foo*/ function foo() { } /* trailing comment of function */ diff --git a/tests/baselines/reference/commentsInheritance(target=es2015).errors.txt b/tests/baselines/reference/commentsInheritance(target=es2015).errors.txt new file mode 100644 index 0000000000000..cfa77b0e118ae --- /dev/null +++ b/tests/baselines/reference/commentsInheritance(target=es2015).errors.txt @@ -0,0 +1,195 @@ +commentsInheritance.ts(21,12): error TS2564: Property 'i1_p1' has no initializer and is not definitely assigned in the constructor. +commentsInheritance.ts(25,12): error TS2564: Property 'i1_l1' has no initializer and is not definitely assigned in the constructor. +commentsInheritance.ts(26,12): error TS2564: Property 'i1_nc_p1' has no initializer and is not definitely assigned in the constructor. +commentsInheritance.ts(29,12): error TS2564: Property 'i1_nc_l1' has no initializer and is not definitely assigned in the constructor. +commentsInheritance.ts(31,12): error TS2564: Property 'p1' has no initializer and is not definitely assigned in the constructor. +commentsInheritance.ts(36,12): error TS2564: Property 'l1' has no initializer and is not definitely assigned in the constructor. +commentsInheritance.ts(38,12): error TS2564: Property 'nc_p1' has no initializer and is not definitely assigned in the constructor. +commentsInheritance.ts(43,12): error TS2564: Property 'nc_l1' has no initializer and is not definitely assigned in the constructor. +commentsInheritance.ts(59,12): error TS2564: Property 'c2_nc_p1' has no initializer and is not definitely assigned in the constructor. +commentsInheritance.ts(66,12): error TS2564: Property 'p1' has no initializer and is not definitely assigned in the constructor. +commentsInheritance.ts(74,12): error TS2564: Property 'nc_p1' has no initializer and is not definitely assigned in the constructor. +commentsInheritance.ts(90,12): error TS2564: Property 'p1' has no initializer and is not definitely assigned in the constructor. +commentsInheritance.ts(98,12): error TS2564: Property 'nc_p1' has no initializer and is not definitely assigned in the constructor. +commentsInheritance.ts(149,8): error TS2454: Variable 'i3_i' is used before being assigned. + + +==== commentsInheritance.ts (14 errors) ==== + /** i1 is interface with properties*/ + interface i1 { + /** i1_p1*/ + i1_p1: number; + /** i1_f1*/ + i1_f1(): void; + /** i1_l1*/ + i1_l1: () => void; + // il_nc_p1 + i1_nc_p1: number; + i1_nc_f1(): void; + i1_nc_l1: () => void; + p1: number; + f1(): void; + l1: () => void; + nc_p1: number; + nc_f1(): void; + nc_l1: () => void; + } + class c1 implements i1 { + public i1_p1: number; + ~~~~~ +!!! error TS2564: Property 'i1_p1' has no initializer and is not definitely assigned in the constructor. + // i1_f1 + public i1_f1() { + } + public i1_l1: () => void; + ~~~~~ +!!! error TS2564: Property 'i1_l1' has no initializer and is not definitely assigned in the constructor. + public i1_nc_p1: number; + ~~~~~~~~ +!!! error TS2564: Property 'i1_nc_p1' has no initializer and is not definitely assigned in the constructor. + public i1_nc_f1() { + } + public i1_nc_l1: () => void; + ~~~~~~~~ +!!! error TS2564: Property 'i1_nc_l1' has no initializer and is not definitely assigned in the constructor. + /** c1_p1*/ + public p1: number; + ~~ +!!! error TS2564: Property 'p1' has no initializer and is not definitely assigned in the constructor. + /** c1_f1*/ + public f1() { + } + /** c1_l1*/ + public l1: () => void; + ~~ +!!! error TS2564: Property 'l1' has no initializer and is not definitely assigned in the constructor. + /** c1_nc_p1*/ + public nc_p1: number; + ~~~~~ +!!! error TS2564: Property 'nc_p1' has no initializer and is not definitely assigned in the constructor. + /** c1_nc_f1*/ + public nc_f1() { + } + /** c1_nc_l1*/ + public nc_l1: () => void; + ~~~~~ +!!! error TS2564: Property 'nc_l1' has no initializer and is not definitely assigned in the constructor. + } + var i1_i: i1; + var c1_i = new c1(); + // assign to interface + i1_i = c1_i; + class c2 { + /** c2 c2_p1*/ + public c2_p1: number; + /** c2 c2_f1*/ + public c2_f1() { + } + /** c2 c2_prop*/ + public get c2_prop() { + return 10; + } + public c2_nc_p1: number; + ~~~~~~~~ +!!! error TS2564: Property 'c2_nc_p1' has no initializer and is not definitely assigned in the constructor. + public c2_nc_f1() { + } + public get c2_nc_prop() { + return 10; + } + /** c2 p1*/ + public p1: number; + ~~ +!!! error TS2564: Property 'p1' has no initializer and is not definitely assigned in the constructor. + /** c2 f1*/ + public f1() { + } + /** c2 prop*/ + public get prop() { + return 10; + } + public nc_p1: number; + ~~~~~ +!!! error TS2564: Property 'nc_p1' has no initializer and is not definitely assigned in the constructor. + public nc_f1() { + } + public get nc_prop() { + return 10; + } + /** c2 constructor*/ + constructor(a: number) { + this.c2_p1 = a; + } + } + class c3 extends c2 { + constructor() { + super(10); + } + /** c3 p1*/ + public p1: number; + ~~ +!!! error TS2564: Property 'p1' has no initializer and is not definitely assigned in the constructor. + /** c3 f1*/ + public f1() { + } + /** c3 prop*/ + public get prop() { + return 10; + } + public nc_p1: number; + ~~~~~ +!!! error TS2564: Property 'nc_p1' has no initializer and is not definitely assigned in the constructor. + public nc_f1() { + } + public get nc_prop() { + return 10; + } + } + var c2_i = new c2(10); + var c3_i = new c3(); + // assign + c2_i = c3_i; + class c4 extends c2 { + } + var c4_i = new c4(10); + interface i2 { + /** i2_p1*/ + i2_p1: number; + /** i2_f1*/ + i2_f1(): void; + /** i2_l1*/ + i2_l1: () => void; + // i2_nc_p1 + i2_nc_p1: number; + i2_nc_f1(): void; + i2_nc_l1: () => void; + /** i2 p1*/ + p1: number; + /** i2 f1*/ + f1(): void; + /** i2 l1*/ + l1: () => void; + nc_p1: number; + nc_f1(): void; + nc_l1: () => void; + } + interface i3 extends i2 { + /** i3 p1 */ + p1: number; + /** + * i3 f1 + */ + f1(): void; + /** i3 l1*/ + l1: () => void; + nc_p1: number; + nc_f1(): void; + nc_l1: () => void; + } + var i2_i: i2; + var i3_i: i3; + // assign to interface + i2_i = i3_i; + ~~~~ +!!! error TS2454: Variable 'i3_i' is used before being assigned. + \ No newline at end of file diff --git a/tests/baselines/reference/commentsInheritance(target=es2015).js b/tests/baselines/reference/commentsInheritance(target=es2015).js index b0805bc49afd1..7649b59792673 100644 --- a/tests/baselines/reference/commentsInheritance(target=es2015).js +++ b/tests/baselines/reference/commentsInheritance(target=es2015).js @@ -153,6 +153,7 @@ i2_i = i3_i; //// [commentsInheritance.js] +"use strict"; class c1 { // i1_f1 i1_f1() { diff --git a/tests/baselines/reference/commentsInheritance(target=es5).errors.txt b/tests/baselines/reference/commentsInheritance(target=es5).errors.txt index d57ceb905754f..8f96c9ad8b0c3 100644 --- a/tests/baselines/reference/commentsInheritance(target=es5).errors.txt +++ b/tests/baselines/reference/commentsInheritance(target=es5).errors.txt @@ -1,8 +1,22 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +commentsInheritance.ts(21,12): error TS2564: Property 'i1_p1' has no initializer and is not definitely assigned in the constructor. +commentsInheritance.ts(25,12): error TS2564: Property 'i1_l1' has no initializer and is not definitely assigned in the constructor. +commentsInheritance.ts(26,12): error TS2564: Property 'i1_nc_p1' has no initializer and is not definitely assigned in the constructor. +commentsInheritance.ts(29,12): error TS2564: Property 'i1_nc_l1' has no initializer and is not definitely assigned in the constructor. +commentsInheritance.ts(31,12): error TS2564: Property 'p1' has no initializer and is not definitely assigned in the constructor. +commentsInheritance.ts(36,12): error TS2564: Property 'l1' has no initializer and is not definitely assigned in the constructor. +commentsInheritance.ts(38,12): error TS2564: Property 'nc_p1' has no initializer and is not definitely assigned in the constructor. +commentsInheritance.ts(43,12): error TS2564: Property 'nc_l1' has no initializer and is not definitely assigned in the constructor. +commentsInheritance.ts(59,12): error TS2564: Property 'c2_nc_p1' has no initializer and is not definitely assigned in the constructor. +commentsInheritance.ts(66,12): error TS2564: Property 'p1' has no initializer and is not definitely assigned in the constructor. +commentsInheritance.ts(74,12): error TS2564: Property 'nc_p1' has no initializer and is not definitely assigned in the constructor. +commentsInheritance.ts(90,12): error TS2564: Property 'p1' has no initializer and is not definitely assigned in the constructor. +commentsInheritance.ts(98,12): error TS2564: Property 'nc_p1' has no initializer and is not definitely assigned in the constructor. +commentsInheritance.ts(149,8): error TS2454: Variable 'i3_i' is used before being assigned. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== commentsInheritance.ts (0 errors) ==== +==== commentsInheritance.ts (14 errors) ==== /** i1 is interface with properties*/ interface i1 { /** i1_p1*/ @@ -24,28 +38,44 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in Typ } class c1 implements i1 { public i1_p1: number; + ~~~~~ +!!! error TS2564: Property 'i1_p1' has no initializer and is not definitely assigned in the constructor. // i1_f1 public i1_f1() { } public i1_l1: () => void; + ~~~~~ +!!! error TS2564: Property 'i1_l1' has no initializer and is not definitely assigned in the constructor. public i1_nc_p1: number; + ~~~~~~~~ +!!! error TS2564: Property 'i1_nc_p1' has no initializer and is not definitely assigned in the constructor. public i1_nc_f1() { } public i1_nc_l1: () => void; + ~~~~~~~~ +!!! error TS2564: Property 'i1_nc_l1' has no initializer and is not definitely assigned in the constructor. /** c1_p1*/ public p1: number; + ~~ +!!! error TS2564: Property 'p1' has no initializer and is not definitely assigned in the constructor. /** c1_f1*/ public f1() { } /** c1_l1*/ public l1: () => void; + ~~ +!!! error TS2564: Property 'l1' has no initializer and is not definitely assigned in the constructor. /** c1_nc_p1*/ public nc_p1: number; + ~~~~~ +!!! error TS2564: Property 'nc_p1' has no initializer and is not definitely assigned in the constructor. /** c1_nc_f1*/ public nc_f1() { } /** c1_nc_l1*/ public nc_l1: () => void; + ~~~~~ +!!! error TS2564: Property 'nc_l1' has no initializer and is not definitely assigned in the constructor. } var i1_i: i1; var c1_i = new c1(); @@ -62,6 +92,8 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in Typ return 10; } public c2_nc_p1: number; + ~~~~~~~~ +!!! error TS2564: Property 'c2_nc_p1' has no initializer and is not definitely assigned in the constructor. public c2_nc_f1() { } public get c2_nc_prop() { @@ -69,6 +101,8 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in Typ } /** c2 p1*/ public p1: number; + ~~ +!!! error TS2564: Property 'p1' has no initializer and is not definitely assigned in the constructor. /** c2 f1*/ public f1() { } @@ -77,6 +111,8 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in Typ return 10; } public nc_p1: number; + ~~~~~ +!!! error TS2564: Property 'nc_p1' has no initializer and is not definitely assigned in the constructor. public nc_f1() { } public get nc_prop() { @@ -93,6 +129,8 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in Typ } /** c3 p1*/ public p1: number; + ~~ +!!! error TS2564: Property 'p1' has no initializer and is not definitely assigned in the constructor. /** c3 f1*/ public f1() { } @@ -101,6 +139,8 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in Typ return 10; } public nc_p1: number; + ~~~~~ +!!! error TS2564: Property 'nc_p1' has no initializer and is not definitely assigned in the constructor. public nc_f1() { } public get nc_prop() { @@ -152,4 +192,6 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in Typ var i3_i: i3; // assign to interface i2_i = i3_i; + ~~~~ +!!! error TS2454: Variable 'i3_i' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/commentsInheritance(target=es5).js b/tests/baselines/reference/commentsInheritance(target=es5).js index 005acd6f69360..d3db3c2d84d87 100644 --- a/tests/baselines/reference/commentsInheritance(target=es5).js +++ b/tests/baselines/reference/commentsInheritance(target=es5).js @@ -153,6 +153,7 @@ i2_i = i3_i; //// [commentsInheritance.js] +"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || diff --git a/tests/baselines/reference/commentsInterface(target=es2015).js b/tests/baselines/reference/commentsInterface(target=es2015).js index b9c2653782936..9f495ef26171f 100644 --- a/tests/baselines/reference/commentsInterface(target=es2015).js +++ b/tests/baselines/reference/commentsInterface(target=es2015).js @@ -72,6 +72,7 @@ i3_i.nc_l(10); //// [commentsInterface.js] +"use strict"; var i1_i; var nc_i1_i; var i2_i; diff --git a/tests/baselines/reference/commentsInterface(target=es5).js b/tests/baselines/reference/commentsInterface(target=es5).js index 6ef89589c09ea..48aa5d370eeea 100644 --- a/tests/baselines/reference/commentsInterface(target=es5).js +++ b/tests/baselines/reference/commentsInterface(target=es5).js @@ -72,6 +72,7 @@ i3_i.nc_l(10); //// [commentsInterface.js] +"use strict"; var i1_i; var nc_i1_i; var i2_i; diff --git a/tests/baselines/reference/commentsModules(target=es2015).js b/tests/baselines/reference/commentsModules(target=es2015).js index 53a4a542e6722..0c1087d07a55f 100644 --- a/tests/baselines/reference/commentsModules(target=es2015).js +++ b/tests/baselines/reference/commentsModules(target=es2015).js @@ -100,6 +100,7 @@ namespace m7.m8 { new m7.m8.m9.c(); //// [commentsModules.js] +"use strict"; /** Module comment*/ var m1; (function (m1) { diff --git a/tests/baselines/reference/commentsModules(target=es5).js b/tests/baselines/reference/commentsModules(target=es5).js index 760d86d6c8c27..cdac6cc3f0cdf 100644 --- a/tests/baselines/reference/commentsModules(target=es5).js +++ b/tests/baselines/reference/commentsModules(target=es5).js @@ -100,6 +100,7 @@ namespace m7.m8 { new m7.m8.m9.c(); //// [commentsModules.js] +"use strict"; /** Module comment*/ var m1; (function (m1) { diff --git a/tests/baselines/reference/commentsMultiModuleSingleFile(target=es2015).js b/tests/baselines/reference/commentsMultiModuleSingleFile(target=es2015).js index 7a99c4fd60690..01c7c17f3b135 100644 --- a/tests/baselines/reference/commentsMultiModuleSingleFile(target=es2015).js +++ b/tests/baselines/reference/commentsMultiModuleSingleFile(target=es2015).js @@ -26,6 +26,7 @@ new multiM.b(); new multiM.c(); //// [commentsMultiModuleSingleFile.js] +"use strict"; /** this is multi declare module*/ var multiM; (function (multiM) { diff --git a/tests/baselines/reference/commentsMultiModuleSingleFile(target=es5).js b/tests/baselines/reference/commentsMultiModuleSingleFile(target=es5).js index 1466e96154cd4..8ed520d9e58e7 100644 --- a/tests/baselines/reference/commentsMultiModuleSingleFile(target=es5).js +++ b/tests/baselines/reference/commentsMultiModuleSingleFile(target=es5).js @@ -26,6 +26,7 @@ new multiM.b(); new multiM.c(); //// [commentsMultiModuleSingleFile.js] +"use strict"; /** this is multi declare module*/ var multiM; (function (multiM) { diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=commonjs,moduledetection=auto).errors.txt b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=commonjs,moduledetection=auto).errors.txt new file mode 100644 index 0000000000000..78d92b3ea26d8 --- /dev/null +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=commonjs,moduledetection=auto).errors.txt @@ -0,0 +1,29 @@ +commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. +commentsOnJSXExpressionsArePreserved.tsx(18,9): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + + +==== commentsOnJSXExpressionsArePreserved.tsx (2 errors) ==== + // file is intentionally not a module - this tests for a crash in the module/system transforms alongside the `react-jsx` and `react-jsxdev` outputs + namespace JSX {} + class Component { + render() { + return
+ ~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + {/* missing */} + {null/* preserved */} + { + // ??? 1 + } + { // ??? 2 + } + {// ??? 3 + } + { + // ??? 4 + /* ??? 5 */} +
; + ~~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=commonjs,moduledetection=auto).js b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=commonjs,moduledetection=auto).js index 2a03d6c2d9a73..83f9d926767b6 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=commonjs,moduledetection=auto).js +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=commonjs,moduledetection=auto).js @@ -23,6 +23,7 @@ class Component { } //// [commentsOnJSXExpressionsArePreserved.jsx] +"use strict"; class Component { render() { return
diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=commonjs,moduledetection=auto).types b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=commonjs,moduledetection=auto).types index bdb53395ee523..f4ceb70601f1e 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=commonjs,moduledetection=auto).types +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=commonjs,moduledetection=auto).types @@ -12,7 +12,8 @@ class Component { > : ^^^^^^^^^ return
->
{/* missing */} {null/* preserved */} { // ??? 1 } { // ??? 2 } {// ??? 3 } { // ??? 4 /* ??? 5 */}
: error +>
{/* missing */} {null/* preserved */} { // ??? 1 } { // ??? 2 } {// ??? 3 } { // ??? 4 /* ??? 5 */}
: any +> : ^^^ >div : any > : ^^^ diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=commonjs,moduledetection=force).errors.txt b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=commonjs,moduledetection=force).errors.txt new file mode 100644 index 0000000000000..78d92b3ea26d8 --- /dev/null +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=commonjs,moduledetection=force).errors.txt @@ -0,0 +1,29 @@ +commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. +commentsOnJSXExpressionsArePreserved.tsx(18,9): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + + +==== commentsOnJSXExpressionsArePreserved.tsx (2 errors) ==== + // file is intentionally not a module - this tests for a crash in the module/system transforms alongside the `react-jsx` and `react-jsxdev` outputs + namespace JSX {} + class Component { + render() { + return
+ ~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + {/* missing */} + {null/* preserved */} + { + // ??? 1 + } + { // ??? 2 + } + {// ??? 3 + } + { + // ??? 4 + /* ??? 5 */} +
; + ~~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=commonjs,moduledetection=force).types b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=commonjs,moduledetection=force).types index bdb53395ee523..f4ceb70601f1e 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=commonjs,moduledetection=force).types +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=commonjs,moduledetection=force).types @@ -12,7 +12,8 @@ class Component { > : ^^^^^^^^^ return
->
{/* missing */} {null/* preserved */} { // ??? 1 } { // ??? 2 } {// ??? 3 } { // ??? 4 /* ??? 5 */}
: error +>
{/* missing */} {null/* preserved */} { // ??? 1 } { // ??? 2 } {// ??? 3 } { // ??? 4 /* ??? 5 */}
: any +> : ^^^ >div : any > : ^^^ diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=commonjs,moduledetection=legacy).errors.txt b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=commonjs,moduledetection=legacy).errors.txt new file mode 100644 index 0000000000000..78d92b3ea26d8 --- /dev/null +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=commonjs,moduledetection=legacy).errors.txt @@ -0,0 +1,29 @@ +commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. +commentsOnJSXExpressionsArePreserved.tsx(18,9): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + + +==== commentsOnJSXExpressionsArePreserved.tsx (2 errors) ==== + // file is intentionally not a module - this tests for a crash in the module/system transforms alongside the `react-jsx` and `react-jsxdev` outputs + namespace JSX {} + class Component { + render() { + return
+ ~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + {/* missing */} + {null/* preserved */} + { + // ??? 1 + } + { // ??? 2 + } + {// ??? 3 + } + { + // ??? 4 + /* ??? 5 */} +
; + ~~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=commonjs,moduledetection=legacy).js b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=commonjs,moduledetection=legacy).js index 2a03d6c2d9a73..83f9d926767b6 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=commonjs,moduledetection=legacy).js +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=commonjs,moduledetection=legacy).js @@ -23,6 +23,7 @@ class Component { } //// [commentsOnJSXExpressionsArePreserved.jsx] +"use strict"; class Component { render() { return
diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=commonjs,moduledetection=legacy).types b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=commonjs,moduledetection=legacy).types index bdb53395ee523..f4ceb70601f1e 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=commonjs,moduledetection=legacy).types +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=commonjs,moduledetection=legacy).types @@ -12,7 +12,8 @@ class Component { > : ^^^^^^^^^ return
->
{/* missing */} {null/* preserved */} { // ??? 1 } { // ??? 2 } {// ??? 3 } { // ??? 4 /* ??? 5 */}
: error +>
{/* missing */} {null/* preserved */} { // ??? 1 } { // ??? 2 } {// ??? 3 } { // ??? 4 /* ??? 5 */}
: any +> : ^^^ >div : any > : ^^^ diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=system,moduledetection=auto).errors.txt b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=system,moduledetection=auto).errors.txt index 0ab9bcb53b3e2..3135b10870f4f 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=system,moduledetection=auto).errors.txt +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=system,moduledetection=auto).errors.txt @@ -1,13 +1,17 @@ error TS5107: Option 'module=System' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. +commentsOnJSXExpressionsArePreserved.tsx(18,9): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. !!! error TS5107: Option 'module=System' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== commentsOnJSXExpressionsArePreserved.tsx (0 errors) ==== +==== commentsOnJSXExpressionsArePreserved.tsx (2 errors) ==== // file is intentionally not a module - this tests for a crash in the module/system transforms alongside the `react-jsx` and `react-jsxdev` outputs namespace JSX {} class Component { render() { return
+ ~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. {/* missing */} {null/* preserved */} { @@ -21,5 +25,7 @@ error TS5107: Option 'module=System' is deprecated and will stop functioning in // ??? 4 /* ??? 5 */}
; + ~~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. } } \ No newline at end of file diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=system,moduledetection=auto).js b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=system,moduledetection=auto).js index 2a03d6c2d9a73..83f9d926767b6 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=system,moduledetection=auto).js +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=system,moduledetection=auto).js @@ -23,6 +23,7 @@ class Component { } //// [commentsOnJSXExpressionsArePreserved.jsx] +"use strict"; class Component { render() { return
diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=system,moduledetection=force).errors.txt b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=system,moduledetection=force).errors.txt index 0ab9bcb53b3e2..3135b10870f4f 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=system,moduledetection=force).errors.txt +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=system,moduledetection=force).errors.txt @@ -1,13 +1,17 @@ error TS5107: Option 'module=System' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. +commentsOnJSXExpressionsArePreserved.tsx(18,9): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. !!! error TS5107: Option 'module=System' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== commentsOnJSXExpressionsArePreserved.tsx (0 errors) ==== +==== commentsOnJSXExpressionsArePreserved.tsx (2 errors) ==== // file is intentionally not a module - this tests for a crash in the module/system transforms alongside the `react-jsx` and `react-jsxdev` outputs namespace JSX {} class Component { render() { return
+ ~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. {/* missing */} {null/* preserved */} { @@ -21,5 +25,7 @@ error TS5107: Option 'module=System' is deprecated and will stop functioning in // ??? 4 /* ??? 5 */}
; + ~~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. } } \ No newline at end of file diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=system,moduledetection=legacy).errors.txt b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=system,moduledetection=legacy).errors.txt index 0ab9bcb53b3e2..3135b10870f4f 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=system,moduledetection=legacy).errors.txt +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=system,moduledetection=legacy).errors.txt @@ -1,13 +1,17 @@ error TS5107: Option 'module=System' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. +commentsOnJSXExpressionsArePreserved.tsx(18,9): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. !!! error TS5107: Option 'module=System' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== commentsOnJSXExpressionsArePreserved.tsx (0 errors) ==== +==== commentsOnJSXExpressionsArePreserved.tsx (2 errors) ==== // file is intentionally not a module - this tests for a crash in the module/system transforms alongside the `react-jsx` and `react-jsxdev` outputs namespace JSX {} class Component { render() { return
+ ~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. {/* missing */} {null/* preserved */} { @@ -21,5 +25,7 @@ error TS5107: Option 'module=System' is deprecated and will stop functioning in // ??? 4 /* ??? 5 */}
; + ~~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. } } \ No newline at end of file diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=system,moduledetection=legacy).js b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=system,moduledetection=legacy).js index 2a03d6c2d9a73..83f9d926767b6 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=system,moduledetection=legacy).js +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=preserve,module=system,moduledetection=legacy).js @@ -23,6 +23,7 @@ class Component { } //// [commentsOnJSXExpressionsArePreserved.jsx] +"use strict"; class Component { render() { return
diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=auto).errors.txt b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=auto).errors.txt index b0f02293888ef..9727c25f38a70 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=auto).errors.txt +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=auto).errors.txt @@ -1,12 +1,16 @@ +commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. commentsOnJSXExpressionsArePreserved.tsx(5,17): error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. +commentsOnJSXExpressionsArePreserved.tsx(18,9): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. -==== commentsOnJSXExpressionsArePreserved.tsx (1 errors) ==== +==== commentsOnJSXExpressionsArePreserved.tsx (3 errors) ==== // file is intentionally not a module - this tests for a crash in the module/system transforms alongside the `react-jsx` and `react-jsxdev` outputs namespace JSX {} class Component { render() { return
+ ~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. ~~~ !!! error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. {/* missing */} @@ -22,5 +26,7 @@ commentsOnJSXExpressionsArePreserved.tsx(5,17): error TS2874: This JSX tag requi // ??? 4 /* ??? 5 */}
; + ~~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. } } \ No newline at end of file diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=auto).js b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=auto).js index 173d9cd34d21c..edb42d7e2e441 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=auto).js +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=auto).js @@ -23,6 +23,7 @@ class Component { } //// [commentsOnJSXExpressionsArePreserved.js] +"use strict"; class Component { render() { return React.createElement("div", null, null /* preserved */); diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=force).errors.txt b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=force).errors.txt index b0f02293888ef..9727c25f38a70 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=force).errors.txt +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=force).errors.txt @@ -1,12 +1,16 @@ +commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. commentsOnJSXExpressionsArePreserved.tsx(5,17): error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. +commentsOnJSXExpressionsArePreserved.tsx(18,9): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. -==== commentsOnJSXExpressionsArePreserved.tsx (1 errors) ==== +==== commentsOnJSXExpressionsArePreserved.tsx (3 errors) ==== // file is intentionally not a module - this tests for a crash in the module/system transforms alongside the `react-jsx` and `react-jsxdev` outputs namespace JSX {} class Component { render() { return
+ ~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. ~~~ !!! error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. {/* missing */} @@ -22,5 +26,7 @@ commentsOnJSXExpressionsArePreserved.tsx(5,17): error TS2874: This JSX tag requi // ??? 4 /* ??? 5 */}
; + ~~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. } } \ No newline at end of file diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=legacy).errors.txt b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=legacy).errors.txt index b0f02293888ef..9727c25f38a70 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=legacy).errors.txt +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=legacy).errors.txt @@ -1,12 +1,16 @@ +commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. commentsOnJSXExpressionsArePreserved.tsx(5,17): error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. +commentsOnJSXExpressionsArePreserved.tsx(18,9): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. -==== commentsOnJSXExpressionsArePreserved.tsx (1 errors) ==== +==== commentsOnJSXExpressionsArePreserved.tsx (3 errors) ==== // file is intentionally not a module - this tests for a crash in the module/system transforms alongside the `react-jsx` and `react-jsxdev` outputs namespace JSX {} class Component { render() { return
+ ~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. ~~~ !!! error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. {/* missing */} @@ -22,5 +26,7 @@ commentsOnJSXExpressionsArePreserved.tsx(5,17): error TS2874: This JSX tag requi // ??? 4 /* ??? 5 */}
; + ~~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. } } \ No newline at end of file diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=legacy).js b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=legacy).js index 173d9cd34d21c..edb42d7e2e441 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=legacy).js +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=commonjs,moduledetection=legacy).js @@ -23,6 +23,7 @@ class Component { } //// [commentsOnJSXExpressionsArePreserved.js] +"use strict"; class Component { render() { return React.createElement("div", null, null /* preserved */); diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=auto).errors.txt b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=auto).errors.txt index b338d2b06acca..3540074080fad 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=auto).errors.txt +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=auto).errors.txt @@ -1,14 +1,18 @@ error TS5107: Option 'module=System' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. commentsOnJSXExpressionsArePreserved.tsx(5,17): error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. +commentsOnJSXExpressionsArePreserved.tsx(18,9): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. !!! error TS5107: Option 'module=System' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== commentsOnJSXExpressionsArePreserved.tsx (1 errors) ==== +==== commentsOnJSXExpressionsArePreserved.tsx (3 errors) ==== // file is intentionally not a module - this tests for a crash in the module/system transforms alongside the `react-jsx` and `react-jsxdev` outputs namespace JSX {} class Component { render() { return
+ ~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. ~~~ !!! error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. {/* missing */} @@ -24,5 +28,7 @@ commentsOnJSXExpressionsArePreserved.tsx(5,17): error TS2874: This JSX tag requi // ??? 4 /* ??? 5 */}
; + ~~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. } } \ No newline at end of file diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=auto).js b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=auto).js index 173d9cd34d21c..edb42d7e2e441 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=auto).js +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=auto).js @@ -23,6 +23,7 @@ class Component { } //// [commentsOnJSXExpressionsArePreserved.js] +"use strict"; class Component { render() { return React.createElement("div", null, null /* preserved */); diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=force).errors.txt b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=force).errors.txt index b338d2b06acca..3540074080fad 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=force).errors.txt +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=force).errors.txt @@ -1,14 +1,18 @@ error TS5107: Option 'module=System' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. commentsOnJSXExpressionsArePreserved.tsx(5,17): error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. +commentsOnJSXExpressionsArePreserved.tsx(18,9): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. !!! error TS5107: Option 'module=System' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== commentsOnJSXExpressionsArePreserved.tsx (1 errors) ==== +==== commentsOnJSXExpressionsArePreserved.tsx (3 errors) ==== // file is intentionally not a module - this tests for a crash in the module/system transforms alongside the `react-jsx` and `react-jsxdev` outputs namespace JSX {} class Component { render() { return
+ ~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. ~~~ !!! error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. {/* missing */} @@ -24,5 +28,7 @@ commentsOnJSXExpressionsArePreserved.tsx(5,17): error TS2874: This JSX tag requi // ??? 4 /* ??? 5 */}
; + ~~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. } } \ No newline at end of file diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=legacy).errors.txt b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=legacy).errors.txt index b338d2b06acca..3540074080fad 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=legacy).errors.txt +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=legacy).errors.txt @@ -1,14 +1,18 @@ error TS5107: Option 'module=System' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. commentsOnJSXExpressionsArePreserved.tsx(5,17): error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. +commentsOnJSXExpressionsArePreserved.tsx(18,9): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. !!! error TS5107: Option 'module=System' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== commentsOnJSXExpressionsArePreserved.tsx (1 errors) ==== +==== commentsOnJSXExpressionsArePreserved.tsx (3 errors) ==== // file is intentionally not a module - this tests for a crash in the module/system transforms alongside the `react-jsx` and `react-jsxdev` outputs namespace JSX {} class Component { render() { return
+ ~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. ~~~ !!! error TS2874: This JSX tag requires 'React' to be in scope, but it could not be found. {/* missing */} @@ -24,5 +28,7 @@ commentsOnJSXExpressionsArePreserved.tsx(5,17): error TS2874: This JSX tag requi // ??? 4 /* ??? 5 */}
; + ~~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. } } \ No newline at end of file diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=legacy).js b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=legacy).js index 173d9cd34d21c..edb42d7e2e441 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=legacy).js +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react,module=system,moduledetection=legacy).js @@ -23,6 +23,7 @@ class Component { } //// [commentsOnJSXExpressionsArePreserved.js] +"use strict"; class Component { render() { return React.createElement("div", null, null /* preserved */); diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=auto).errors.txt b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=auto).errors.txt index f62e9505b45a3..f710481bd1f17 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=auto).errors.txt +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=auto).errors.txt @@ -1,13 +1,17 @@ +commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS2875: This JSX tag requires the module path 'react/jsx-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. +commentsOnJSXExpressionsArePreserved.tsx(18,9): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. -==== commentsOnJSXExpressionsArePreserved.tsx (1 errors) ==== +==== commentsOnJSXExpressionsArePreserved.tsx (3 errors) ==== // file is intentionally not a module - this tests for a crash in the module/system transforms alongside the `react-jsx` and `react-jsxdev` outputs namespace JSX {} class Component { render() { return
~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + ~~~~~ {/* missing */} ~~~~~~~~~~~~~~~~~~~~~~~~~~~ {null/* preserved */} @@ -35,5 +39,7 @@ commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS2875: This JSX tag requi
; ~~~~~~~~~~~~~~ !!! error TS2875: This JSX tag requires the module path 'react/jsx-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. + ~~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. } } \ No newline at end of file diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=force).errors.txt b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=force).errors.txt index f62e9505b45a3..f710481bd1f17 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=force).errors.txt +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=force).errors.txt @@ -1,13 +1,17 @@ +commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS2875: This JSX tag requires the module path 'react/jsx-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. +commentsOnJSXExpressionsArePreserved.tsx(18,9): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. -==== commentsOnJSXExpressionsArePreserved.tsx (1 errors) ==== +==== commentsOnJSXExpressionsArePreserved.tsx (3 errors) ==== // file is intentionally not a module - this tests for a crash in the module/system transforms alongside the `react-jsx` and `react-jsxdev` outputs namespace JSX {} class Component { render() { return
~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + ~~~~~ {/* missing */} ~~~~~~~~~~~~~~~~~~~~~~~~~~~ {null/* preserved */} @@ -35,5 +39,7 @@ commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS2875: This JSX tag requi
; ~~~~~~~~~~~~~~ !!! error TS2875: This JSX tag requires the module path 'react/jsx-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. + ~~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. } } \ No newline at end of file diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=legacy).errors.txt b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=legacy).errors.txt index f62e9505b45a3..f710481bd1f17 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=legacy).errors.txt +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=legacy).errors.txt @@ -1,13 +1,17 @@ +commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS2875: This JSX tag requires the module path 'react/jsx-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. +commentsOnJSXExpressionsArePreserved.tsx(18,9): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. -==== commentsOnJSXExpressionsArePreserved.tsx (1 errors) ==== +==== commentsOnJSXExpressionsArePreserved.tsx (3 errors) ==== // file is intentionally not a module - this tests for a crash in the module/system transforms alongside the `react-jsx` and `react-jsxdev` outputs namespace JSX {} class Component { render() { return
~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + ~~~~~ {/* missing */} ~~~~~~~~~~~~~~~~~~~~~~~~~~~ {null/* preserved */} @@ -35,5 +39,7 @@ commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS2875: This JSX tag requi
; ~~~~~~~~~~~~~~ !!! error TS2875: This JSX tag requires the module path 'react/jsx-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. + ~~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. } } \ No newline at end of file diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=legacy).js b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=legacy).js index d8c36794f9e2f..7549a78d9e929 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=legacy).js +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=commonjs,moduledetection=legacy).js @@ -23,6 +23,7 @@ class Component { } //// [commentsOnJSXExpressionsArePreserved.js] +"use strict"; class Component { render() { return (0, _a.jsx)("div", { children: null /* preserved */ }); diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=auto).errors.txt b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=auto).errors.txt index df6ef89966412..67341751de399 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=auto).errors.txt +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=auto).errors.txt @@ -1,15 +1,19 @@ error TS5107: Option 'module=System' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS2792: Cannot find module 'react/jsx-runtime'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? +commentsOnJSXExpressionsArePreserved.tsx(18,9): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. !!! error TS5107: Option 'module=System' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== commentsOnJSXExpressionsArePreserved.tsx (1 errors) ==== +==== commentsOnJSXExpressionsArePreserved.tsx (3 errors) ==== // file is intentionally not a module - this tests for a crash in the module/system transforms alongside the `react-jsx` and `react-jsxdev` outputs namespace JSX {} class Component { render() { return
~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + ~~~~~ {/* missing */} ~~~~~~~~~~~~~~~~~~~~~~~~~~~ {null/* preserved */} @@ -37,5 +41,7 @@ commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS2792: Cannot find module
; ~~~~~~~~~~~~~~ !!! error TS2792: Cannot find module 'react/jsx-runtime'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? + ~~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. } } \ No newline at end of file diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=force).errors.txt b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=force).errors.txt index df6ef89966412..67341751de399 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=force).errors.txt +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=force).errors.txt @@ -1,15 +1,19 @@ error TS5107: Option 'module=System' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS2792: Cannot find module 'react/jsx-runtime'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? +commentsOnJSXExpressionsArePreserved.tsx(18,9): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. !!! error TS5107: Option 'module=System' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== commentsOnJSXExpressionsArePreserved.tsx (1 errors) ==== +==== commentsOnJSXExpressionsArePreserved.tsx (3 errors) ==== // file is intentionally not a module - this tests for a crash in the module/system transforms alongside the `react-jsx` and `react-jsxdev` outputs namespace JSX {} class Component { render() { return
~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + ~~~~~ {/* missing */} ~~~~~~~~~~~~~~~~~~~~~~~~~~~ {null/* preserved */} @@ -37,5 +41,7 @@ commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS2792: Cannot find module
; ~~~~~~~~~~~~~~ !!! error TS2792: Cannot find module 'react/jsx-runtime'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? + ~~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. } } \ No newline at end of file diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=legacy).errors.txt b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=legacy).errors.txt index df6ef89966412..67341751de399 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=legacy).errors.txt +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=legacy).errors.txt @@ -1,15 +1,19 @@ error TS5107: Option 'module=System' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS2792: Cannot find module 'react/jsx-runtime'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? +commentsOnJSXExpressionsArePreserved.tsx(18,9): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. !!! error TS5107: Option 'module=System' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== commentsOnJSXExpressionsArePreserved.tsx (1 errors) ==== +==== commentsOnJSXExpressionsArePreserved.tsx (3 errors) ==== // file is intentionally not a module - this tests for a crash in the module/system transforms alongside the `react-jsx` and `react-jsxdev` outputs namespace JSX {} class Component { render() { return
~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + ~~~~~ {/* missing */} ~~~~~~~~~~~~~~~~~~~~~~~~~~~ {null/* preserved */} @@ -37,5 +41,7 @@ commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS2792: Cannot find module
; ~~~~~~~~~~~~~~ !!! error TS2792: Cannot find module 'react/jsx-runtime'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? + ~~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. } } \ No newline at end of file diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=legacy).js b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=legacy).js index 398425b87787a..e0e280c348bd8 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=legacy).js +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsx,module=system,moduledetection=legacy).js @@ -23,6 +23,7 @@ class Component { } //// [commentsOnJSXExpressionsArePreserved.js] +"use strict"; class Component { render() { return _jsx("div", { children: null /* preserved */ }); diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=auto).errors.txt b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=auto).errors.txt index d417296efa4f7..164f9da0004b7 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=auto).errors.txt +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=auto).errors.txt @@ -1,13 +1,17 @@ +commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS2875: This JSX tag requires the module path 'react/jsx-dev-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. +commentsOnJSXExpressionsArePreserved.tsx(18,9): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. -==== commentsOnJSXExpressionsArePreserved.tsx (1 errors) ==== +==== commentsOnJSXExpressionsArePreserved.tsx (3 errors) ==== // file is intentionally not a module - this tests for a crash in the module/system transforms alongside the `react-jsx` and `react-jsxdev` outputs namespace JSX {} class Component { render() { return
~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + ~~~~~ {/* missing */} ~~~~~~~~~~~~~~~~~~~~~~~~~~~ {null/* preserved */} @@ -35,5 +39,7 @@ commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS2875: This JSX tag requi
; ~~~~~~~~~~~~~~ !!! error TS2875: This JSX tag requires the module path 'react/jsx-dev-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. + ~~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. } } \ No newline at end of file diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=force).errors.txt b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=force).errors.txt index d417296efa4f7..164f9da0004b7 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=force).errors.txt +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=force).errors.txt @@ -1,13 +1,17 @@ +commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS2875: This JSX tag requires the module path 'react/jsx-dev-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. +commentsOnJSXExpressionsArePreserved.tsx(18,9): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. -==== commentsOnJSXExpressionsArePreserved.tsx (1 errors) ==== +==== commentsOnJSXExpressionsArePreserved.tsx (3 errors) ==== // file is intentionally not a module - this tests for a crash in the module/system transforms alongside the `react-jsx` and `react-jsxdev` outputs namespace JSX {} class Component { render() { return
~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + ~~~~~ {/* missing */} ~~~~~~~~~~~~~~~~~~~~~~~~~~~ {null/* preserved */} @@ -35,5 +39,7 @@ commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS2875: This JSX tag requi
; ~~~~~~~~~~~~~~ !!! error TS2875: This JSX tag requires the module path 'react/jsx-dev-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. + ~~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. } } \ No newline at end of file diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=legacy).errors.txt b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=legacy).errors.txt index d417296efa4f7..164f9da0004b7 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=legacy).errors.txt +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=legacy).errors.txt @@ -1,13 +1,17 @@ +commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS2875: This JSX tag requires the module path 'react/jsx-dev-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. +commentsOnJSXExpressionsArePreserved.tsx(18,9): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. -==== commentsOnJSXExpressionsArePreserved.tsx (1 errors) ==== +==== commentsOnJSXExpressionsArePreserved.tsx (3 errors) ==== // file is intentionally not a module - this tests for a crash in the module/system transforms alongside the `react-jsx` and `react-jsxdev` outputs namespace JSX {} class Component { render() { return
~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + ~~~~~ {/* missing */} ~~~~~~~~~~~~~~~~~~~~~~~~~~~ {null/* preserved */} @@ -35,5 +39,7 @@ commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS2875: This JSX tag requi
; ~~~~~~~~~~~~~~ !!! error TS2875: This JSX tag requires the module path 'react/jsx-dev-runtime' to exist, but none could be found. Make sure you have types for the appropriate package installed. + ~~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. } } \ No newline at end of file diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=legacy).js b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=legacy).js index a3a31b9137b43..9f75f42fe7377 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=legacy).js +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=commonjs,moduledetection=legacy).js @@ -23,6 +23,7 @@ class Component { } //// [commentsOnJSXExpressionsArePreserved.js] +"use strict"; const _jsxFileName = "commentsOnJSXExpressionsArePreserved.tsx"; class Component { render() { diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=auto).errors.txt b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=auto).errors.txt index d87ec056015c4..79793085f175d 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=auto).errors.txt +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=auto).errors.txt @@ -1,15 +1,19 @@ error TS5107: Option 'module=System' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS2792: Cannot find module 'react/jsx-dev-runtime'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? +commentsOnJSXExpressionsArePreserved.tsx(18,9): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. !!! error TS5107: Option 'module=System' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== commentsOnJSXExpressionsArePreserved.tsx (1 errors) ==== +==== commentsOnJSXExpressionsArePreserved.tsx (3 errors) ==== // file is intentionally not a module - this tests for a crash in the module/system transforms alongside the `react-jsx` and `react-jsxdev` outputs namespace JSX {} class Component { render() { return
~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + ~~~~~ {/* missing */} ~~~~~~~~~~~~~~~~~~~~~~~~~~~ {null/* preserved */} @@ -37,5 +41,7 @@ commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS2792: Cannot find module
; ~~~~~~~~~~~~~~ !!! error TS2792: Cannot find module 'react/jsx-dev-runtime'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? + ~~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. } } \ No newline at end of file diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=force).errors.txt b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=force).errors.txt index d87ec056015c4..79793085f175d 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=force).errors.txt +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=force).errors.txt @@ -1,15 +1,19 @@ error TS5107: Option 'module=System' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS2792: Cannot find module 'react/jsx-dev-runtime'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? +commentsOnJSXExpressionsArePreserved.tsx(18,9): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. !!! error TS5107: Option 'module=System' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== commentsOnJSXExpressionsArePreserved.tsx (1 errors) ==== +==== commentsOnJSXExpressionsArePreserved.tsx (3 errors) ==== // file is intentionally not a module - this tests for a crash in the module/system transforms alongside the `react-jsx` and `react-jsxdev` outputs namespace JSX {} class Component { render() { return
~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + ~~~~~ {/* missing */} ~~~~~~~~~~~~~~~~~~~~~~~~~~~ {null/* preserved */} @@ -37,5 +41,7 @@ commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS2792: Cannot find module
; ~~~~~~~~~~~~~~ !!! error TS2792: Cannot find module 'react/jsx-dev-runtime'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? + ~~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. } } \ No newline at end of file diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=legacy).errors.txt b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=legacy).errors.txt index d87ec056015c4..79793085f175d 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=legacy).errors.txt +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=legacy).errors.txt @@ -1,15 +1,19 @@ error TS5107: Option 'module=System' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS2792: Cannot find module 'react/jsx-dev-runtime'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? +commentsOnJSXExpressionsArePreserved.tsx(18,9): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. !!! error TS5107: Option 'module=System' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== commentsOnJSXExpressionsArePreserved.tsx (1 errors) ==== +==== commentsOnJSXExpressionsArePreserved.tsx (3 errors) ==== // file is intentionally not a module - this tests for a crash in the module/system transforms alongside the `react-jsx` and `react-jsxdev` outputs namespace JSX {} class Component { render() { return
~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + ~~~~~ {/* missing */} ~~~~~~~~~~~~~~~~~~~~~~~~~~~ {null/* preserved */} @@ -37,5 +41,7 @@ commentsOnJSXExpressionsArePreserved.tsx(5,16): error TS2792: Cannot find module
; ~~~~~~~~~~~~~~ !!! error TS2792: Cannot find module 'react/jsx-dev-runtime'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? + ~~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. } } \ No newline at end of file diff --git a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=legacy).js b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=legacy).js index 8ff8ded1d7b36..0f429e8c9d043 100644 --- a/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=legacy).js +++ b/tests/baselines/reference/commentsOnJSXExpressionsArePreserved(jsx=react-jsxdev,module=system,moduledetection=legacy).js @@ -23,6 +23,7 @@ class Component { } //// [commentsOnJSXExpressionsArePreserved.js] +"use strict"; const _jsxFileName = "commentsOnJSXExpressionsArePreserved.tsx"; class Component { render() { diff --git a/tests/baselines/reference/commentsOnObjectLiteral1.js b/tests/baselines/reference/commentsOnObjectLiteral1.js index f807f3e1e023c..8b2603b490b77 100644 --- a/tests/baselines/reference/commentsOnObjectLiteral1.js +++ b/tests/baselines/reference/commentsOnObjectLiteral1.js @@ -10,6 +10,7 @@ var Person = makeClass( ); //// [commentsOnObjectLiteral1.js] +"use strict"; var Person = makeClass( /** @scope Person diff --git a/tests/baselines/reference/commentsOnObjectLiteral2.js b/tests/baselines/reference/commentsOnObjectLiteral2.js index 35a732210698a..2ac04dcf47b6f 100644 --- a/tests/baselines/reference/commentsOnObjectLiteral2.js +++ b/tests/baselines/reference/commentsOnObjectLiteral2.js @@ -15,6 +15,7 @@ var Person = makeClass( ); //// [commentsOnObjectLiteral2.js] +"use strict"; var Person = makeClass({ /** This is just another way to define a constructor. diff --git a/tests/baselines/reference/commentsOnObjectLiteral3(target=es2015).js b/tests/baselines/reference/commentsOnObjectLiteral3(target=es2015).js index 79eb0fb59184c..9ce282303db4f 100644 --- a/tests/baselines/reference/commentsOnObjectLiteral3(target=es2015).js +++ b/tests/baselines/reference/commentsOnObjectLiteral3(target=es2015).js @@ -21,6 +21,7 @@ var v = { //// [commentsOnObjectLiteral3.js] +"use strict"; var v = { //property prop: 1 /* multiple trailing comments */ /*trailing comments*/, diff --git a/tests/baselines/reference/commentsOnObjectLiteral3(target=es2015).symbols b/tests/baselines/reference/commentsOnObjectLiteral3(target=es2015).symbols index d2ff2764532ed..2ee346777aa98 100644 --- a/tests/baselines/reference/commentsOnObjectLiteral3(target=es2015).symbols +++ b/tests/baselines/reference/commentsOnObjectLiteral3(target=es2015).symbols @@ -22,6 +22,10 @@ var v = { >a : Symbol(a, Decl(commentsOnObjectLiteral3.ts, 7, 13), Decl(commentsOnObjectLiteral3.ts, 11, 18)) return this.prop; +>this.prop : Symbol(prop, Decl(commentsOnObjectLiteral3.ts, 0, 9)) +>this : Symbol(v, Decl(commentsOnObjectLiteral3.ts, 0, 7)) +>prop : Symbol(prop, Decl(commentsOnObjectLiteral3.ts, 0, 9)) + } /*trailing 1*/, //setter set a(value) { @@ -29,6 +33,9 @@ var v = { >value : Symbol(value, Decl(commentsOnObjectLiteral3.ts, 13, 7)) this.prop = value; +>this.prop : Symbol(prop, Decl(commentsOnObjectLiteral3.ts, 0, 9)) +>this : Symbol(v, Decl(commentsOnObjectLiteral3.ts, 0, 7)) +>prop : Symbol(prop, Decl(commentsOnObjectLiteral3.ts, 0, 9)) >value : Symbol(value, Decl(commentsOnObjectLiteral3.ts, 13, 7)) } // trailing 2 diff --git a/tests/baselines/reference/commentsOnObjectLiteral3(target=es2015).types b/tests/baselines/reference/commentsOnObjectLiteral3(target=es2015).types index abdf46a8f723f..67a45de4536ba 100644 --- a/tests/baselines/reference/commentsOnObjectLiteral3(target=es2015).types +++ b/tests/baselines/reference/commentsOnObjectLiteral3(target=es2015).types @@ -2,10 +2,10 @@ === commentsOnObjectLiteral3.ts === var v = { ->v : { prop: number; func: () => void; func1(): void; a: any; } -> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->{ //property prop: 1 /* multiple trailing comments */ /*trailing comments*/, //property func: function () { }, //PropertyName + CallSignature func1() { }, //getter get a() { return this.prop; } /*trailing 1*/, //setter set a(value) { this.prop = value; } // trailing 2} : { prop: number; func: () => void; func1(): void; a: any; } -> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>v : { prop: number; func: () => void; func1(): void; a: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ //property prop: 1 /* multiple trailing comments */ /*trailing comments*/, //property func: function () { }, //PropertyName + CallSignature func1() { }, //getter get a() { return this.prop; } /*trailing 1*/, //setter set a(value) { this.prop = value; } // trailing 2} : { prop: number; func: () => void; func1(): void; a: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //property prop: 1 /* multiple trailing comments */ /*trailing comments*/, @@ -29,29 +29,36 @@ var v = { //getter get a() { ->a : any +>a : number +> : ^^^^^^ return this.prop; ->this.prop : any ->this : any -> : ^^^ ->prop : any -> : ^^^ +>this.prop : number +> : ^^^^^^ +>this : { prop: number; func: () => void; func1(): void; a: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>prop : number +> : ^^^^^^ } /*trailing 1*/, //setter set a(value) { ->a : any ->value : any +>a : number +> : ^^^^^^ +>value : number +> : ^^^^^^ this.prop = value; ->this.prop = value : any ->this.prop : any ->this : any -> : ^^^ ->prop : any -> : ^^^ ->value : any +>this.prop = value : number +> : ^^^^^^ +>this.prop : number +> : ^^^^^^ +>this : { prop: number; func: () => void; func1(): void; a: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>prop : number +> : ^^^^^^ +>value : number +> : ^^^^^^ } // trailing 2 }; diff --git a/tests/baselines/reference/commentsOnObjectLiteral3(target=es5).js b/tests/baselines/reference/commentsOnObjectLiteral3(target=es5).js index 83cf9eebcb9a7..1b40f51905259 100644 --- a/tests/baselines/reference/commentsOnObjectLiteral3(target=es5).js +++ b/tests/baselines/reference/commentsOnObjectLiteral3(target=es5).js @@ -21,6 +21,7 @@ var v = { //// [commentsOnObjectLiteral3.js] +"use strict"; var v = { //property prop: 1 /* multiple trailing comments */ /*trailing comments*/, diff --git a/tests/baselines/reference/commentsOnObjectLiteral3(target=es5).symbols b/tests/baselines/reference/commentsOnObjectLiteral3(target=es5).symbols index d2ff2764532ed..2ee346777aa98 100644 --- a/tests/baselines/reference/commentsOnObjectLiteral3(target=es5).symbols +++ b/tests/baselines/reference/commentsOnObjectLiteral3(target=es5).symbols @@ -22,6 +22,10 @@ var v = { >a : Symbol(a, Decl(commentsOnObjectLiteral3.ts, 7, 13), Decl(commentsOnObjectLiteral3.ts, 11, 18)) return this.prop; +>this.prop : Symbol(prop, Decl(commentsOnObjectLiteral3.ts, 0, 9)) +>this : Symbol(v, Decl(commentsOnObjectLiteral3.ts, 0, 7)) +>prop : Symbol(prop, Decl(commentsOnObjectLiteral3.ts, 0, 9)) + } /*trailing 1*/, //setter set a(value) { @@ -29,6 +33,9 @@ var v = { >value : Symbol(value, Decl(commentsOnObjectLiteral3.ts, 13, 7)) this.prop = value; +>this.prop : Symbol(prop, Decl(commentsOnObjectLiteral3.ts, 0, 9)) +>this : Symbol(v, Decl(commentsOnObjectLiteral3.ts, 0, 7)) +>prop : Symbol(prop, Decl(commentsOnObjectLiteral3.ts, 0, 9)) >value : Symbol(value, Decl(commentsOnObjectLiteral3.ts, 13, 7)) } // trailing 2 diff --git a/tests/baselines/reference/commentsOnObjectLiteral3(target=es5).types b/tests/baselines/reference/commentsOnObjectLiteral3(target=es5).types index db56ce9f48621..67a45de4536ba 100644 --- a/tests/baselines/reference/commentsOnObjectLiteral3(target=es5).types +++ b/tests/baselines/reference/commentsOnObjectLiteral3(target=es5).types @@ -2,10 +2,10 @@ === commentsOnObjectLiteral3.ts === var v = { ->v : { prop: number; func: () => void; func1(): void; a: any; } -> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->{ //property prop: 1 /* multiple trailing comments */ /*trailing comments*/, //property func: function () { }, //PropertyName + CallSignature func1() { }, //getter get a() { return this.prop; } /*trailing 1*/, //setter set a(value) { this.prop = value; } // trailing 2} : { prop: number; func: () => void; func1(): void; a: any; } -> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>v : { prop: number; func: () => void; func1(): void; a: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>{ //property prop: 1 /* multiple trailing comments */ /*trailing comments*/, //property func: function () { }, //PropertyName + CallSignature func1() { }, //getter get a() { return this.prop; } /*trailing 1*/, //setter set a(value) { this.prop = value; } // trailing 2} : { prop: number; func: () => void; func1(): void; a: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //property prop: 1 /* multiple trailing comments */ /*trailing comments*/, @@ -29,36 +29,36 @@ var v = { //getter get a() { ->a : any -> : ^^^ +>a : number +> : ^^^^^^ return this.prop; ->this.prop : any -> : ^^^ ->this : any -> : ^^^ ->prop : any -> : ^^^ +>this.prop : number +> : ^^^^^^ +>this : { prop: number; func: () => void; func1(): void; a: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>prop : number +> : ^^^^^^ } /*trailing 1*/, //setter set a(value) { ->a : any -> : ^^^ ->value : any -> : ^^^ +>a : number +> : ^^^^^^ +>value : number +> : ^^^^^^ this.prop = value; ->this.prop = value : any -> : ^^^ ->this.prop : any -> : ^^^ ->this : any -> : ^^^ ->prop : any -> : ^^^ ->value : any -> : ^^^ +>this.prop = value : number +> : ^^^^^^ +>this.prop : number +> : ^^^^^^ +>this : { prop: number; func: () => void; func1(): void; a: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>prop : number +> : ^^^^^^ +>value : number +> : ^^^^^^ } // trailing 2 }; diff --git a/tests/baselines/reference/commentsOnObjectLiteral4(target=es2015).js b/tests/baselines/reference/commentsOnObjectLiteral4(target=es2015).js index cc0bfe8591785..b7650f7f2ceb4 100644 --- a/tests/baselines/reference/commentsOnObjectLiteral4(target=es2015).js +++ b/tests/baselines/reference/commentsOnObjectLiteral4(target=es2015).js @@ -12,6 +12,7 @@ var v = { //// [commentsOnObjectLiteral4.js] +"use strict"; var v = { /** * @type {number} diff --git a/tests/baselines/reference/commentsOnObjectLiteral4(target=es5).js b/tests/baselines/reference/commentsOnObjectLiteral4(target=es5).js index cc0bfe8591785..b7650f7f2ceb4 100644 --- a/tests/baselines/reference/commentsOnObjectLiteral4(target=es5).js +++ b/tests/baselines/reference/commentsOnObjectLiteral4(target=es5).js @@ -12,6 +12,7 @@ var v = { //// [commentsOnObjectLiteral4.js] +"use strict"; var v = { /** * @type {number} diff --git a/tests/baselines/reference/commentsOnObjectLiteral5(target=es2015).js b/tests/baselines/reference/commentsOnObjectLiteral5(target=es2015).js index 0986e9058e875..efdf9e455d470 100644 --- a/tests/baselines/reference/commentsOnObjectLiteral5(target=es2015).js +++ b/tests/baselines/reference/commentsOnObjectLiteral5(target=es2015).js @@ -10,6 +10,7 @@ const a = { //// [commentsOnObjectLiteral5.js] +"use strict"; const a = { p0: 0, // Comment 0 p1: 0, /* Comment 1 diff --git a/tests/baselines/reference/commentsOnObjectLiteral5(target=es5).js b/tests/baselines/reference/commentsOnObjectLiteral5(target=es5).js index 0bb52c712a212..137fc540f7832 100644 --- a/tests/baselines/reference/commentsOnObjectLiteral5(target=es5).js +++ b/tests/baselines/reference/commentsOnObjectLiteral5(target=es5).js @@ -10,6 +10,7 @@ const a = { //// [commentsOnObjectLiteral5.js] +"use strict"; var a = { p0: 0, // Comment 0 p1: 0, /* Comment 1 diff --git a/tests/baselines/reference/commentsOnPropertyOfObjectLiteral1.js b/tests/baselines/reference/commentsOnPropertyOfObjectLiteral1.js index 9a7518f8371d5..d8b10047b62a1 100644 --- a/tests/baselines/reference/commentsOnPropertyOfObjectLiteral1.js +++ b/tests/baselines/reference/commentsOnPropertyOfObjectLiteral1.js @@ -16,6 +16,7 @@ var resolve = { }; //// [commentsOnPropertyOfObjectLiteral1.js] +"use strict"; var resolve = { id: /*! @ngInject */ (details) => details.id, id1: /* c1 */ "hello", diff --git a/tests/baselines/reference/commentsOnReturnStatement1.js b/tests/baselines/reference/commentsOnReturnStatement1.js index 8c2bed1e2d7a4..55484cf8497a0 100644 --- a/tests/baselines/reference/commentsOnReturnStatement1.js +++ b/tests/baselines/reference/commentsOnReturnStatement1.js @@ -12,6 +12,7 @@ class DebugClass { } //// [commentsOnReturnStatement1.js] +"use strict"; class DebugClass { static debugFunc() { // Start Debugger Test Code diff --git a/tests/baselines/reference/commentsOnStaticMembers.js b/tests/baselines/reference/commentsOnStaticMembers.js index d7d53d4885e5c..499cf9e1bd785 100644 --- a/tests/baselines/reference/commentsOnStaticMembers.js +++ b/tests/baselines/reference/commentsOnStaticMembers.js @@ -22,6 +22,7 @@ class test { } //// [commentsOnStaticMembers.js] +"use strict"; class test { } /** diff --git a/tests/baselines/reference/commentsOverloads(target=es2015).js b/tests/baselines/reference/commentsOverloads(target=es2015).js index 841f94fce628d..fcc9b8e028920 100644 --- a/tests/baselines/reference/commentsOverloads(target=es2015).js +++ b/tests/baselines/reference/commentsOverloads(target=es2015).js @@ -177,6 +177,7 @@ var c5_i_2 = new c5("hello"); //// [commentsOverloads.js] +"use strict"; function f1(aOrb) { return 10; } diff --git a/tests/baselines/reference/commentsOverloads(target=es5).js b/tests/baselines/reference/commentsOverloads(target=es5).js index 334c809bba9c4..fecff552d39e3 100644 --- a/tests/baselines/reference/commentsOverloads(target=es5).js +++ b/tests/baselines/reference/commentsOverloads(target=es5).js @@ -177,6 +177,7 @@ var c5_i_2 = new c5("hello"); //// [commentsOverloads.js] +"use strict"; function f1(aOrb) { return 10; } diff --git a/tests/baselines/reference/commentsPropertySignature1.js b/tests/baselines/reference/commentsPropertySignature1.js index 9a0126db2de44..91bd2168f78b4 100644 --- a/tests/baselines/reference/commentsPropertySignature1.js +++ b/tests/baselines/reference/commentsPropertySignature1.js @@ -8,6 +8,7 @@ var a = { //// [commentsPropertySignature1.js] +"use strict"; var a = { /** own x*/ x: 0 diff --git a/tests/baselines/reference/commentsTypeParameters.js b/tests/baselines/reference/commentsTypeParameters.js index 32a7a0181580c..89522b1327b7d 100644 --- a/tests/baselines/reference/commentsTypeParameters.js +++ b/tests/baselines/reference/commentsTypeParameters.js @@ -18,6 +18,7 @@ function compare(a: T, b: T) { } //// [commentsTypeParameters.js] +"use strict"; class C { method(a) { } diff --git a/tests/baselines/reference/commentsVarDecl(target=es2015).errors.txt b/tests/baselines/reference/commentsVarDecl(target=es2015).errors.txt new file mode 100644 index 0000000000000..933b883b04768 --- /dev/null +++ b/tests/baselines/reference/commentsVarDecl(target=es2015).errors.txt @@ -0,0 +1,51 @@ +commentsVarDecl.ts(39,10): error TS2454: Variable 'z2' is used before being assigned. +commentsVarDecl.ts(42,6): error TS2454: Variable 'z2' is used before being assigned. + + +==== commentsVarDecl.ts (2 errors) ==== + /** Variable comments*/ + var myVariable = 10; // This trailing Comment1 + + /** This is another variable comment*/ + var anotherVariable = 30; + + // shouldn't appear + var aVar = ""; + + /** this is multiline comment + * All these variables are of number type */ + var anotherAnotherVariable = 70; /* these are multiple trailing comments */ /* multiple trailing comments */ + + /** Triple slash multiline comment*/ + /** another line in the comment*/ + /** comment line 2*/ + var x = 70; /* multiline trailing comment + this is multiline trailing comment */ + /** Triple slash comment on the assignment shouldnt be in .d.ts file*/ + x = myVariable; + + /** triple slash comment1*/ + /** jsdocstyle comment - only this comment should be in .d.ts file*/ + var n = 30; + + /** var deckaration with comment on type as well*/ + var y = /** value comment */ 20; + + /// var deckaration with comment on type as well + var yy = + /// value comment + 20; + + /** comment2 */ + var z = /** lambda comment */ (x: number, y: number) => x + y; + + var z2: /** type comment*/ (x: number) => string; + + var x2 = z2; + ~~ +!!! error TS2454: Variable 'z2' is used before being assigned. + + var n4: (x: number) => string; + n4 = z2; + ~~ +!!! error TS2454: Variable 'z2' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/commentsVarDecl(target=es2015).js b/tests/baselines/reference/commentsVarDecl(target=es2015).js index 6ac87852dbc06..a45ca80658c6b 100644 --- a/tests/baselines/reference/commentsVarDecl(target=es2015).js +++ b/tests/baselines/reference/commentsVarDecl(target=es2015).js @@ -45,6 +45,7 @@ var n4: (x: number) => string; n4 = z2; //// [commentsVarDecl.js] +"use strict"; /** Variable comments*/ var myVariable = 10; // This trailing Comment1 /** This is another variable comment*/ diff --git a/tests/baselines/reference/commentsVarDecl(target=es5).errors.txt b/tests/baselines/reference/commentsVarDecl(target=es5).errors.txt index c02d105ab3066..7aaaef956eb59 100644 --- a/tests/baselines/reference/commentsVarDecl(target=es5).errors.txt +++ b/tests/baselines/reference/commentsVarDecl(target=es5).errors.txt @@ -1,8 +1,10 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +commentsVarDecl.ts(39,10): error TS2454: Variable 'z2' is used before being assigned. +commentsVarDecl.ts(42,6): error TS2454: Variable 'z2' is used before being assigned. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== commentsVarDecl.ts (0 errors) ==== +==== commentsVarDecl.ts (2 errors) ==== /** Variable comments*/ var myVariable = 10; // This trailing Comment1 @@ -42,6 +44,10 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in Typ var z2: /** type comment*/ (x: number) => string; var x2 = z2; + ~~ +!!! error TS2454: Variable 'z2' is used before being assigned. var n4: (x: number) => string; - n4 = z2; \ No newline at end of file + n4 = z2; + ~~ +!!! error TS2454: Variable 'z2' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/commentsVarDecl(target=es5).js b/tests/baselines/reference/commentsVarDecl(target=es5).js index 7c4df2bd0a7ad..36a2305c0a1ba 100644 --- a/tests/baselines/reference/commentsVarDecl(target=es5).js +++ b/tests/baselines/reference/commentsVarDecl(target=es5).js @@ -45,6 +45,7 @@ var n4: (x: number) => string; n4 = z2; //// [commentsVarDecl.js] +"use strict"; /** Variable comments*/ var myVariable = 10; // This trailing Comment1 /** This is another variable comment*/ diff --git a/tests/baselines/reference/commentsVariableStatement1.js b/tests/baselines/reference/commentsVariableStatement1.js index 1d3d18d59b10a..be300e6c1f8a4 100644 --- a/tests/baselines/reference/commentsVariableStatement1.js +++ b/tests/baselines/reference/commentsVariableStatement1.js @@ -5,6 +5,7 @@ var v = 1; //// [commentsVariableStatement1.js] +"use strict"; /** Comment */ var v = 1; diff --git a/tests/baselines/reference/commentsdoNotEmitComments(target=es2015).js b/tests/baselines/reference/commentsdoNotEmitComments(target=es2015).js index 5ece0c2831850..e74a5afde3a07 100644 --- a/tests/baselines/reference/commentsdoNotEmitComments(target=es2015).js +++ b/tests/baselines/reference/commentsdoNotEmitComments(target=es2015).js @@ -95,6 +95,7 @@ var shade: color = color.green; //// [commentsdoNotEmitComments.js] +"use strict"; var myVariable = 10; function foo(p) { } diff --git a/tests/baselines/reference/commentsdoNotEmitComments(target=es5).js b/tests/baselines/reference/commentsdoNotEmitComments(target=es5).js index 8eb367586d069..503a4071cb6c9 100644 --- a/tests/baselines/reference/commentsdoNotEmitComments(target=es5).js +++ b/tests/baselines/reference/commentsdoNotEmitComments(target=es5).js @@ -95,6 +95,7 @@ var shade: color = color.green; //// [commentsdoNotEmitComments.js] +"use strict"; var myVariable = 10; function foo(p) { } diff --git a/tests/baselines/reference/commentsemitComments(target=es2015).js b/tests/baselines/reference/commentsemitComments(target=es2015).js index e8bf5211c8edb..0015a9c5caaa0 100644 --- a/tests/baselines/reference/commentsemitComments(target=es2015).js +++ b/tests/baselines/reference/commentsemitComments(target=es2015).js @@ -90,6 +90,7 @@ declare var x; //// [commentsemitComments.js] +"use strict"; /** Variable comments*/ var myVariable = 10; /** function comments*/ diff --git a/tests/baselines/reference/commentsemitComments(target=es5).js b/tests/baselines/reference/commentsemitComments(target=es5).js index 678d8ff9dafb8..dd0fa2b04f63e 100644 --- a/tests/baselines/reference/commentsemitComments(target=es5).js +++ b/tests/baselines/reference/commentsemitComments(target=es5).js @@ -90,6 +90,7 @@ declare var x; //// [commentsemitComments.js] +"use strict"; /** Variable comments*/ var myVariable = 10; /** function comments*/ diff --git a/tests/baselines/reference/commonJSAliasedExport.js b/tests/baselines/reference/commonJSAliasedExport.js index 8612e4f80e1d3..310a2b6ce3f0a 100644 --- a/tests/baselines/reference/commonJSAliasedExport.js +++ b/tests/baselines/reference/commonJSAliasedExport.js @@ -18,6 +18,7 @@ var diddy = funky(1) //// [commonJSAliasedExport.js] +"use strict"; const donkey = (ast) => ast; function funky(declaration) { return false; @@ -25,6 +26,7 @@ function funky(declaration) { module.exports = donkey; module.exports.funky = funky; //// [bug43713.js] +"use strict"; const { funky } = require('./commonJSAliasedExport'); /** @type {boolean} */ var diddy; diff --git a/tests/baselines/reference/commonJsExportTypeDeclarationError(target=es2015).js b/tests/baselines/reference/commonJsExportTypeDeclarationError(target=es2015).js index 6120833035872..8c909402ddccc 100644 --- a/tests/baselines/reference/commonJsExportTypeDeclarationError(target=es2015).js +++ b/tests/baselines/reference/commonJsExportTypeDeclarationError(target=es2015).js @@ -19,6 +19,7 @@ export type test = test; //// [test.js] +"use strict"; module.exports = { message: "" }; diff --git a/tests/baselines/reference/commonJsExportTypeDeclarationError(target=es5).js b/tests/baselines/reference/commonJsExportTypeDeclarationError(target=es5).js index 6120833035872..8c909402ddccc 100644 --- a/tests/baselines/reference/commonJsExportTypeDeclarationError(target=es5).js +++ b/tests/baselines/reference/commonJsExportTypeDeclarationError(target=es5).js @@ -19,6 +19,7 @@ export type test = test; //// [test.js] +"use strict"; module.exports = { message: "" }; diff --git a/tests/baselines/reference/commonJsIsolatedModules.js b/tests/baselines/reference/commonJsIsolatedModules.js index 78c32617947f1..0062ce5774c08 100644 --- a/tests/baselines/reference/commonJsIsolatedModules.js +++ b/tests/baselines/reference/commonJsIsolatedModules.js @@ -6,5 +6,6 @@ var x = 1 //// [index.js] +"use strict"; module.exports = {}; var x = 1; diff --git a/tests/baselines/reference/commonSourceDir1.js b/tests/baselines/reference/commonSourceDir1.js index 68833aed49db0..609fb8720c5ae 100644 --- a/tests/baselines/reference/commonSourceDir1.js +++ b/tests/baselines/reference/commonSourceDir1.js @@ -8,6 +8,8 @@ var y: number; //// [bar.js] +"use strict"; var x; //// [baz.js] +"use strict"; var y; diff --git a/tests/baselines/reference/commonSourceDir2.js b/tests/baselines/reference/commonSourceDir2.js index cf263b51fb60b..52c5b20881030 100644 --- a/tests/baselines/reference/commonSourceDir2.js +++ b/tests/baselines/reference/commonSourceDir2.js @@ -7,6 +7,8 @@ var x: number; var y: number; //// [bar.js] +"use strict"; var x; //// [baz.js] +"use strict"; var y; diff --git a/tests/baselines/reference/commonSourceDir3.js b/tests/baselines/reference/commonSourceDir3.js index 0535d51f4bf08..50930b1364981 100644 --- a/tests/baselines/reference/commonSourceDir3.js +++ b/tests/baselines/reference/commonSourceDir3.js @@ -7,6 +7,8 @@ var x: number; var y: number; //// [bar.js] +"use strict"; var x; //// [baz.js] +"use strict"; var y; diff --git a/tests/baselines/reference/commonSourceDir4.js b/tests/baselines/reference/commonSourceDir4.js index 2f2af9f68b2d9..502611a79aaea 100644 --- a/tests/baselines/reference/commonSourceDir4.js +++ b/tests/baselines/reference/commonSourceDir4.js @@ -7,6 +7,8 @@ var x: number; var y: number; //// [bar.js] +"use strict"; var x; //// [baz.js] +"use strict"; var y; diff --git a/tests/baselines/reference/commonTypeIntersection.errors.txt b/tests/baselines/reference/commonTypeIntersection.errors.txt index 99f2f28d04a07..55f892691ce80 100644 --- a/tests/baselines/reference/commonTypeIntersection.errors.txt +++ b/tests/baselines/reference/commonTypeIntersection.errors.txt @@ -1,26 +1,30 @@ -commonTypeIntersection.ts(2,5): error TS2322: Type '{ __typename?: "TypeTwo"; } & { a: boolean; }' is not assignable to type '{ __typename?: "TypeOne"; } & { a: boolean; }'. - Type '{ __typename?: "TypeTwo"; } & { a: boolean; }' is not assignable to type '{ __typename?: "TypeOne"; }'. +commonTypeIntersection.ts(2,5): error TS2322: Type '{ __typename?: "TypeTwo" | undefined; } & { a: boolean; }' is not assignable to type '{ __typename?: "TypeOne" | undefined; } & { a: boolean; }'. + Type '{ __typename?: "TypeTwo" | undefined; } & { a: boolean; }' is not assignable to type '{ __typename?: "TypeOne" | undefined; }'. Types of property '__typename' are incompatible. - Type '"TypeTwo"' is not assignable to type '"TypeOne"'. -commonTypeIntersection.ts(4,5): error TS2322: Type '{ __typename?: "TypeTwo"; } & string' is not assignable to type '{ __typename?: "TypeOne"; } & string'. - Type '{ __typename?: "TypeTwo"; } & string' is not assignable to type '{ __typename?: "TypeOne"; }'. + Type '"TypeTwo" | undefined' is not assignable to type '"TypeOne" | undefined'. + Type '"TypeTwo"' is not assignable to type '"TypeOne"'. +commonTypeIntersection.ts(4,5): error TS2322: Type '{ __typename?: "TypeTwo" | undefined; } & string' is not assignable to type '{ __typename?: "TypeOne" | undefined; } & string'. + Type '{ __typename?: "TypeTwo" | undefined; } & string' is not assignable to type '{ __typename?: "TypeOne" | undefined; }'. Types of property '__typename' are incompatible. - Type '"TypeTwo"' is not assignable to type '"TypeOne"'. + Type '"TypeTwo" | undefined' is not assignable to type '"TypeOne" | undefined'. + Type '"TypeTwo"' is not assignable to type '"TypeOne"'. ==== commonTypeIntersection.ts (2 errors) ==== declare let x1: { __typename?: 'TypeTwo' } & { a: boolean }; let y1: { __typename?: 'TypeOne' } & { a: boolean} = x1; // should error here ~~ -!!! error TS2322: Type '{ __typename?: "TypeTwo"; } & { a: boolean; }' is not assignable to type '{ __typename?: "TypeOne"; } & { a: boolean; }'. -!!! error TS2322: Type '{ __typename?: "TypeTwo"; } & { a: boolean; }' is not assignable to type '{ __typename?: "TypeOne"; }'. +!!! error TS2322: Type '{ __typename?: "TypeTwo" | undefined; } & { a: boolean; }' is not assignable to type '{ __typename?: "TypeOne" | undefined; } & { a: boolean; }'. +!!! error TS2322: Type '{ __typename?: "TypeTwo" | undefined; } & { a: boolean; }' is not assignable to type '{ __typename?: "TypeOne" | undefined; }'. !!! error TS2322: Types of property '__typename' are incompatible. -!!! error TS2322: Type '"TypeTwo"' is not assignable to type '"TypeOne"'. +!!! error TS2322: Type '"TypeTwo" | undefined' is not assignable to type '"TypeOne" | undefined'. +!!! error TS2322: Type '"TypeTwo"' is not assignable to type '"TypeOne"'. declare let x2: { __typename?: 'TypeTwo' } & string; let y2: { __typename?: 'TypeOne' } & string = x2; // should error here ~~ -!!! error TS2322: Type '{ __typename?: "TypeTwo"; } & string' is not assignable to type '{ __typename?: "TypeOne"; } & string'. -!!! error TS2322: Type '{ __typename?: "TypeTwo"; } & string' is not assignable to type '{ __typename?: "TypeOne"; }'. +!!! error TS2322: Type '{ __typename?: "TypeTwo" | undefined; } & string' is not assignable to type '{ __typename?: "TypeOne" | undefined; } & string'. +!!! error TS2322: Type '{ __typename?: "TypeTwo" | undefined; } & string' is not assignable to type '{ __typename?: "TypeOne" | undefined; }'. !!! error TS2322: Types of property '__typename' are incompatible. -!!! error TS2322: Type '"TypeTwo"' is not assignable to type '"TypeOne"'. +!!! error TS2322: Type '"TypeTwo" | undefined' is not assignable to type '"TypeOne" | undefined'. +!!! error TS2322: Type '"TypeTwo"' is not assignable to type '"TypeOne"'. \ No newline at end of file diff --git a/tests/baselines/reference/commonTypeIntersection.js b/tests/baselines/reference/commonTypeIntersection.js index 268a2bd06e260..ba7f2bd6e38a0 100644 --- a/tests/baselines/reference/commonTypeIntersection.js +++ b/tests/baselines/reference/commonTypeIntersection.js @@ -8,5 +8,6 @@ let y2: { __typename?: 'TypeOne' } & string = x2; // should error here //// [commonTypeIntersection.js] +"use strict"; let y1 = x1; // should error here let y2 = x2; // should error here diff --git a/tests/baselines/reference/commonTypeIntersection.types b/tests/baselines/reference/commonTypeIntersection.types index 447530c1e1119..8c567a9cce265 100644 --- a/tests/baselines/reference/commonTypeIntersection.types +++ b/tests/baselines/reference/commonTypeIntersection.types @@ -4,16 +4,16 @@ declare let x1: { __typename?: 'TypeTwo' } & { a: boolean }; >x1 : { __typename?: "TypeTwo"; } & { a: boolean; } > : ^^^^^^^^^^^^^^^ ^^^^^^^^^^^ ^^^ ->__typename : "TypeTwo" -> : ^^^^^^^^^ +>__typename : "TypeTwo" | undefined +> : ^^^^^^^^^^^^^^^^^^^^^ >a : boolean > : ^^^^^^^ let y1: { __typename?: 'TypeOne' } & { a: boolean} = x1; // should error here >y1 : { __typename?: "TypeOne"; } & { a: boolean; } > : ^^^^^^^^^^^^^^^ ^^^^^^^^^^^ ^^^ ->__typename : "TypeOne" -> : ^^^^^^^^^ +>__typename : "TypeOne" | undefined +> : ^^^^^^^^^^^^^^^^^^^^^ >a : boolean > : ^^^^^^^ >x1 : { __typename?: "TypeTwo"; } & { a: boolean; } @@ -22,14 +22,14 @@ let y1: { __typename?: 'TypeOne' } & { a: boolean} = x1; // should error here declare let x2: { __typename?: 'TypeTwo' } & string; >x2 : { __typename?: "TypeTwo"; } & string > : ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ ->__typename : "TypeTwo" -> : ^^^^^^^^^ +>__typename : "TypeTwo" | undefined +> : ^^^^^^^^^^^^^^^^^^^^^ let y2: { __typename?: 'TypeOne' } & string = x2; // should error here >y2 : { __typename?: "TypeOne"; } & string > : ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ ->__typename : "TypeOne" -> : ^^^^^^^^^ +>__typename : "TypeOne" | undefined +> : ^^^^^^^^^^^^^^^^^^^^^ >x2 : { __typename?: "TypeTwo"; } & string > : ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ diff --git a/tests/baselines/reference/comparabilityTypeParametersRelatedByUnion.js b/tests/baselines/reference/comparabilityTypeParametersRelatedByUnion.js index cde3d47c1fa39..d33ca4b1389ed 100644 --- a/tests/baselines/reference/comparabilityTypeParametersRelatedByUnion.js +++ b/tests/baselines/reference/comparabilityTypeParametersRelatedByUnion.js @@ -15,6 +15,7 @@ class C { //// [comparabilityTypeParametersRelatedByUnion.js] +"use strict"; class C { constructor(x) { this.x = x; diff --git a/tests/baselines/reference/compareTypeParameterConstrainedByLiteralToLiteral.js b/tests/baselines/reference/compareTypeParameterConstrainedByLiteralToLiteral.js index 3ed38c0ccd85c..ce9ad79d5e2e0 100644 --- a/tests/baselines/reference/compareTypeParameterConstrainedByLiteralToLiteral.js +++ b/tests/baselines/reference/compareTypeParameterConstrainedByLiteralToLiteral.js @@ -10,6 +10,7 @@ function foo(t: T) { //// [compareTypeParameterConstrainedByLiteralToLiteral.js] +"use strict"; // Test for #26758 function foo(t) { t === "a"; // Should be allowed diff --git a/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.errors.txt b/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.errors.txt new file mode 100644 index 0000000000000..70587e061c6eb --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.errors.txt @@ -0,0 +1,905 @@ +comparisonOperatorWithIdenticalObjects.ts(2,12): error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. +comparisonOperatorWithIdenticalObjects.ts(3,12): error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. +comparisonOperatorWithIdenticalObjects.ts(4,12): error TS2564: Property 'c' has no initializer and is not definitely assigned in the constructor. +comparisonOperatorWithIdenticalObjects.ts(6,12): error TS2564: Property 'e' has no initializer and is not definitely assigned in the constructor. +comparisonOperatorWithIdenticalObjects.ts(8,9): error TS2322: Type 'null' is not assignable to type 'string'. +comparisonOperatorWithIdenticalObjects.ts(12,12): error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. +comparisonOperatorWithIdenticalObjects.ts(13,12): error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. +comparisonOperatorWithIdenticalObjects.ts(14,12): error TS2564: Property 'c' has no initializer and is not definitely assigned in the constructor. +comparisonOperatorWithIdenticalObjects.ts(16,12): error TS2564: Property 'e' has no initializer and is not definitely assigned in the constructor. +comparisonOperatorWithIdenticalObjects.ts(18,9): error TS2322: Type 'null' is not assignable to type 'string'. +comparisonOperatorWithIdenticalObjects.ts(23,13): error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. +comparisonOperatorWithIdenticalObjects.ts(25,9): error TS2322: Type 'null' is not assignable to type 'string'. +comparisonOperatorWithIdenticalObjects.ts(61,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(61,17): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(62,12): error TS2454: Variable 'base1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(62,20): error TS2454: Variable 'base2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(63,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(63,17): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(64,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(64,17): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(65,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(65,17): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(66,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(66,17): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(67,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(67,17): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(69,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(69,17): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(70,12): error TS2454: Variable 'base2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(70,20): error TS2454: Variable 'base1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(71,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(71,17): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(72,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(72,17): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(73,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(73,17): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(74,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(74,17): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(75,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(75,17): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(78,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(78,17): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(79,12): error TS2454: Variable 'base1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(79,20): error TS2454: Variable 'base2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(80,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(80,17): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(81,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(81,17): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(82,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(82,17): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(83,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(83,17): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(84,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(84,17): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(86,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(86,17): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(87,12): error TS2454: Variable 'base2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(87,20): error TS2454: Variable 'base1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(88,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(88,17): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(89,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(89,17): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(90,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(90,17): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(91,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(91,17): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(92,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(92,17): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(95,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(95,18): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(96,12): error TS2454: Variable 'base1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(96,21): error TS2454: Variable 'base2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(97,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(97,18): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(98,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(98,18): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(99,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(99,18): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(100,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(100,18): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(101,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(101,18): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(103,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(103,18): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(104,12): error TS2454: Variable 'base2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(104,21): error TS2454: Variable 'base1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(105,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(105,18): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(106,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(106,18): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(107,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(107,18): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(108,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(108,18): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(109,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(109,18): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(112,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(112,18): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(113,12): error TS2454: Variable 'base1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(113,21): error TS2454: Variable 'base2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(114,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(114,18): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(115,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(115,18): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(116,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(116,18): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(117,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(117,18): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(118,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(118,18): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(120,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(120,18): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(121,12): error TS2454: Variable 'base2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(121,21): error TS2454: Variable 'base1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(122,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(122,18): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(123,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(123,18): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(124,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(124,18): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(125,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(125,18): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(126,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(126,18): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(129,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(129,18): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(130,12): error TS2454: Variable 'base1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(130,21): error TS2454: Variable 'base2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(131,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(131,18): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(132,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(132,18): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(133,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(133,18): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(134,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(134,18): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(135,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(135,18): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(137,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(137,18): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(138,12): error TS2454: Variable 'base2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(138,21): error TS2454: Variable 'base1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(139,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(139,18): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(140,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(140,18): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(141,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(141,18): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(142,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(142,18): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(143,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(143,18): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(146,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(146,18): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(147,12): error TS2454: Variable 'base1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(147,21): error TS2454: Variable 'base2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(148,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(148,18): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(149,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(149,18): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(150,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(150,18): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(151,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(151,18): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(152,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(152,18): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(154,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(154,18): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(155,12): error TS2454: Variable 'base2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(155,21): error TS2454: Variable 'base1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(156,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(156,18): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(157,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(157,18): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(158,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(158,18): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(159,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(159,18): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(160,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(160,18): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(163,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(163,19): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(164,12): error TS2454: Variable 'base1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(164,22): error TS2454: Variable 'base2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(165,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(165,19): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(166,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(166,19): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(167,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(167,19): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(168,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(168,19): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(169,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(169,19): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(171,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(171,19): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(172,12): error TS2454: Variable 'base2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(172,22): error TS2454: Variable 'base1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(173,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(173,19): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(174,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(174,19): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(175,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(175,19): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(176,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(176,19): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(177,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(177,19): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(180,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(180,19): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(181,12): error TS2454: Variable 'base1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(181,22): error TS2454: Variable 'base2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(182,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(182,19): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(183,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(183,19): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(184,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(184,19): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(185,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(185,19): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(186,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(186,19): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(188,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(188,19): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(189,12): error TS2454: Variable 'base2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(189,22): error TS2454: Variable 'base1' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(190,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(190,19): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(191,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(191,19): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(192,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(192,19): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(193,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(193,19): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(194,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithIdenticalObjects.ts(194,19): error TS2454: Variable 'a6' is used before being assigned. + + +==== comparisonOperatorWithIdenticalObjects.ts (236 errors) ==== + class A1 { + public a: string; + ~ +!!! error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. + public b: number; + ~ +!!! error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. + public c: boolean; + ~ +!!! error TS2564: Property 'c' has no initializer and is not definitely assigned in the constructor. + public d: any; + public e: Object; + ~ +!!! error TS2564: Property 'e' has no initializer and is not definitely assigned in the constructor. + public fn(a: string): string { + return null; + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'string'. + } + } + class B1 { + public a: string; + ~ +!!! error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. + public b: number; + ~ +!!! error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. + public c: boolean; + ~ +!!! error TS2564: Property 'c' has no initializer and is not definitely assigned in the constructor. + public d: any; + public e: Object; + ~ +!!! error TS2564: Property 'e' has no initializer and is not definitely assigned in the constructor. + public fn(b: string): string { + return null; + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'string'. + } + } + + class Base { + private a: string; + ~ +!!! error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. + private fn(b: string): string { + return null; + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'string'. + } + } + class A2 extends Base { } + class B2 extends Base { } + + interface A3 { f(a: number): string; } + interface B3 { f(a: number): string; } + + interface A4 { new (a: string): A1; } + interface B4 { new (a: string): B1; } + + interface A5 { [x: number]: number; } + interface B5 { [x: number]: number; } + + interface A6 { [x: string]: string; } + interface B6 { [x: string]: string; } + + var a1: A1; + var a2: A2; + var a3: A3; + var a4: A4; + var a5: A5; + var a6: A6; + + var b1: B1; + var b2: B2; + var b3: B3; + var b4: B4; + var b5: B5; + var b6: B6; + + var base1: Base; + var base2: Base; + + // operator < + var r1a1 = a1 < b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r1a2 = base1 < base2; + ~~~~~ +!!! error TS2454: Variable 'base1' is used before being assigned. + ~~~~~ +!!! error TS2454: Variable 'base2' is used before being assigned. + var r1a3 = a2 < b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r1a4 = a3 < b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r1a5 = a4 < b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r1a6 = a5 < b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r1a7 = a6 < b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + + var r1b1 = b1 < a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r1b2 = base2 < base1; + ~~~~~ +!!! error TS2454: Variable 'base2' is used before being assigned. + ~~~~~ +!!! error TS2454: Variable 'base1' is used before being assigned. + var r1b3 = b2 < a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r1b4 = b3 < a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r1b5 = b4 < a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r1b6 = b5 < a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r1b7 = b6 < a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + + // operator > + var r2a1 = a1 > b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r2a2 = base1 > base2; + ~~~~~ +!!! error TS2454: Variable 'base1' is used before being assigned. + ~~~~~ +!!! error TS2454: Variable 'base2' is used before being assigned. + var r2a3 = a2 > b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r2a4 = a3 > b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r2a5 = a4 > b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r2a6 = a5 > b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r2a7 = a6 > b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + + var r2b1 = b1 > a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r2b2 = base2 > base1; + ~~~~~ +!!! error TS2454: Variable 'base2' is used before being assigned. + ~~~~~ +!!! error TS2454: Variable 'base1' is used before being assigned. + var r2b3 = b2 > a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r2b4 = b3 > a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r2b5 = b4 > a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r2b6 = b5 > a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r2b7 = b6 > a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + + // operator <= + var r3a1 = a1 <= b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r3a2 = base1 <= base2; + ~~~~~ +!!! error TS2454: Variable 'base1' is used before being assigned. + ~~~~~ +!!! error TS2454: Variable 'base2' is used before being assigned. + var r3a3 = a2 <= b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r3a4 = a3 <= b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r3a5 = a4 <= b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r3a6 = a5 <= b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r3a7 = a6 <= b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + + var r3b1 = b1 <= a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r3b2 = base2 <= base1; + ~~~~~ +!!! error TS2454: Variable 'base2' is used before being assigned. + ~~~~~ +!!! error TS2454: Variable 'base1' is used before being assigned. + var r3b3 = b2 <= a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r3b4 = b3 <= a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r3b5 = b4 <= a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r3b6 = b5 <= a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r3b7 = b6 <= a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + + // operator >= + var r4a1 = a1 >= b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r4a2 = base1 >= base2; + ~~~~~ +!!! error TS2454: Variable 'base1' is used before being assigned. + ~~~~~ +!!! error TS2454: Variable 'base2' is used before being assigned. + var r4a3 = a2 >= b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r4a4 = a3 >= b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r4a5 = a4 >= b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r4a6 = a5 >= b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r4a7 = a6 >= b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + + var r4b1 = b1 >= a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r4b2 = base2 >= base1; + ~~~~~ +!!! error TS2454: Variable 'base2' is used before being assigned. + ~~~~~ +!!! error TS2454: Variable 'base1' is used before being assigned. + var r4b3 = b2 >= a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r4b4 = b3 >= a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r4b5 = b4 >= a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r4b6 = b5 >= a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r4b7 = b6 >= a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + + // operator == + var r5a1 = a1 == b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r5a2 = base1 == base2; + ~~~~~ +!!! error TS2454: Variable 'base1' is used before being assigned. + ~~~~~ +!!! error TS2454: Variable 'base2' is used before being assigned. + var r5a3 = a2 == b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r5a4 = a3 == b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r5a5 = a4 == b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r5a6 = a5 == b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r5a7 = a6 == b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + + var r5b1 = b1 == a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r5b2 = base2 == base1; + ~~~~~ +!!! error TS2454: Variable 'base2' is used before being assigned. + ~~~~~ +!!! error TS2454: Variable 'base1' is used before being assigned. + var r5b3 = b2 == a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r5b4 = b3 == a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r5b5 = b4 == a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r5b6 = b5 == a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r5b7 = b6 == a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + + // operator != + var r6a1 = a1 != b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r6a2 = base1 != base2; + ~~~~~ +!!! error TS2454: Variable 'base1' is used before being assigned. + ~~~~~ +!!! error TS2454: Variable 'base2' is used before being assigned. + var r6a3 = a2 != b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r6a4 = a3 != b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r6a5 = a4 != b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r6a6 = a5 != b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r6a7 = a6 != b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + + var r6b1 = b1 != a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r6b2 = base2 != base1; + ~~~~~ +!!! error TS2454: Variable 'base2' is used before being assigned. + ~~~~~ +!!! error TS2454: Variable 'base1' is used before being assigned. + var r6b3 = b2 != a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r6b4 = b3 != a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r6b5 = b4 != a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r6b6 = b5 != a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r6b7 = b6 != a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + + // operator === + var r7a1 = a1 === b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r7a2 = base1 === base2; + ~~~~~ +!!! error TS2454: Variable 'base1' is used before being assigned. + ~~~~~ +!!! error TS2454: Variable 'base2' is used before being assigned. + var r7a3 = a2 === b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r7a4 = a3 === b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r7a5 = a4 === b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r7a6 = a5 === b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r7a7 = a6 === b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + + var r7b1 = b1 === a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r7b2 = base2 === base1; + ~~~~~ +!!! error TS2454: Variable 'base2' is used before being assigned. + ~~~~~ +!!! error TS2454: Variable 'base1' is used before being assigned. + var r7b3 = b2 === a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r7b4 = b3 === a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r7b5 = b4 === a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r7b6 = b5 === a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r7b7 = b6 === a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + + // operator !== + var r8a1 = a1 !== b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r8a2 = base1 !== base2; + ~~~~~ +!!! error TS2454: Variable 'base1' is used before being assigned. + ~~~~~ +!!! error TS2454: Variable 'base2' is used before being assigned. + var r8a3 = a2 !== b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r8a4 = a3 !== b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r8a5 = a4 !== b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r8a6 = a5 !== b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r8a7 = a6 !== b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + + var r8b1 = b1 !== a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r8b2 = base2 !== base1; + ~~~~~ +!!! error TS2454: Variable 'base2' is used before being assigned. + ~~~~~ +!!! error TS2454: Variable 'base1' is used before being assigned. + var r8b3 = b2 !== a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r8b4 = b3 !== a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r8b5 = b4 !== a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r8b6 = b5 !== a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r8b7 = b6 !== a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.js b/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.js index 0c3c4dc0b5b10..f51447ee1d7a4 100644 --- a/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.js +++ b/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.js @@ -197,6 +197,7 @@ var r8b6 = b5 !== a5; var r8b7 = b6 !== a6; //// [comparisonOperatorWithIdenticalObjects.js] +"use strict"; class A1 { fn(a) { return null; diff --git a/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.types b/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.types index 6bee8061e794c..6e0f65d34329e 100644 --- a/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.types +++ b/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.types @@ -19,6 +19,7 @@ class A1 { public d: any; >d : any +> : ^^^ public e: Object; >e : Object @@ -51,6 +52,7 @@ class B1 { public d: any; >d : any +> : ^^^ public e: Object; >e : Object diff --git a/tests/baselines/reference/comparisonOperatorWithIdenticalPrimitiveType.js b/tests/baselines/reference/comparisonOperatorWithIdenticalPrimitiveType.js index 52bf9ad1d3246..32d6ed39347be 100644 --- a/tests/baselines/reference/comparisonOperatorWithIdenticalPrimitiveType.js +++ b/tests/baselines/reference/comparisonOperatorWithIdenticalPrimitiveType.js @@ -82,6 +82,7 @@ var rh6 = null !== null; var rh7 = undefined !== undefined; //// [comparisonOperatorWithIdenticalPrimitiveType.js] +"use strict"; var E; (function (E) { E[E["a"] = 0] = "a"; diff --git a/tests/baselines/reference/comparisonOperatorWithIdenticalTypeParameter.js b/tests/baselines/reference/comparisonOperatorWithIdenticalTypeParameter.js index 0d9fc9b4a2363..a045110e54bde 100644 --- a/tests/baselines/reference/comparisonOperatorWithIdenticalTypeParameter.js +++ b/tests/baselines/reference/comparisonOperatorWithIdenticalTypeParameter.js @@ -13,6 +13,7 @@ function foo(t: T) { } //// [comparisonOperatorWithIdenticalTypeParameter.js] +"use strict"; function foo(t) { var r1 = t < t; var r2 = t > t; diff --git a/tests/baselines/reference/comparisonOperatorWithIntersectionType.js b/tests/baselines/reference/comparisonOperatorWithIntersectionType.js index 31b8bfff83f6b..af92c5ba1f248 100644 --- a/tests/baselines/reference/comparisonOperatorWithIntersectionType.js +++ b/tests/baselines/reference/comparisonOperatorWithIntersectionType.js @@ -9,5 +9,6 @@ b > 1; //// [comparisonOperatorWithIntersectionType.js] +"use strict"; a > 1; b > 1; diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.errors.txt b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.errors.txt index 9272b7b0c4479..24413cbbc7321 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.errors.txt +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.errors.txt @@ -1,112 +1,105 @@ +comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(2,12): error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. +comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(6,12): error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. +comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(10,12): error TS2564: Property 'c' has no initializer and is not definitely assigned in the constructor. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(35,12): error TS2365: Operator '<' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(36,12): error TS2365: Operator '<' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(37,12): error TS2365: Operator '<' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(38,12): error TS2365: Operator '<' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. -comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(39,12): error TS2365: Operator '<' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(40,12): error TS2365: Operator '<' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(43,12): error TS2365: Operator '<' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(44,12): error TS2365: Operator '<' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(45,12): error TS2365: Operator '<' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(46,12): error TS2365: Operator '<' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. -comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(47,12): error TS2365: Operator '<' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(48,12): error TS2365: Operator '<' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(52,12): error TS2365: Operator '>' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(53,12): error TS2365: Operator '>' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(54,12): error TS2365: Operator '>' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(55,12): error TS2365: Operator '>' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. -comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(56,12): error TS2365: Operator '>' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(57,12): error TS2365: Operator '>' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(60,12): error TS2365: Operator '>' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(61,12): error TS2365: Operator '>' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(62,12): error TS2365: Operator '>' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(63,12): error TS2365: Operator '>' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. -comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(64,12): error TS2365: Operator '>' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(65,12): error TS2365: Operator '>' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(69,12): error TS2365: Operator '<=' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(70,12): error TS2365: Operator '<=' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(71,12): error TS2365: Operator '<=' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(72,12): error TS2365: Operator '<=' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. -comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(73,12): error TS2365: Operator '<=' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(74,12): error TS2365: Operator '<=' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(77,12): error TS2365: Operator '<=' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(78,12): error TS2365: Operator '<=' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(79,12): error TS2365: Operator '<=' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(80,12): error TS2365: Operator '<=' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. -comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(81,12): error TS2365: Operator '<=' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(82,12): error TS2365: Operator '<=' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(86,12): error TS2365: Operator '>=' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(87,12): error TS2365: Operator '>=' cannot be applied to types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(88,12): error TS2365: Operator '>=' cannot be applied to types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(89,12): error TS2365: Operator '>=' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. -comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(90,12): error TS2365: Operator '>=' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(91,12): error TS2365: Operator '>=' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(94,12): error TS2365: Operator '>=' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(95,12): error TS2365: Operator '>=' cannot be applied to types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(96,12): error TS2365: Operator '>=' cannot be applied to types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(97,12): error TS2365: Operator '>=' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. -comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(98,12): error TS2365: Operator '>=' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(99,12): error TS2365: Operator '>=' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(103,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(): Base; }' and 'new () => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(104,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(105,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(106,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(): Base; }' and '{ fn(): C; }' have no overlap. -comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(107,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(108,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(111,12): error TS2367: This comparison appears to be unintentional because the types 'new () => Base' and '{ fn(): Base; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(112,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(113,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(114,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(): C; }' and '{ fn(): Base; }' have no overlap. -comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(115,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(116,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(120,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(): Base; }' and 'new () => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(121,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(122,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(123,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(): Base; }' and '{ fn(): C; }' have no overlap. -comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(124,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(125,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(128,12): error TS2367: This comparison appears to be unintentional because the types 'new () => Base' and '{ fn(): Base; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(129,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(130,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(131,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(): C; }' and '{ fn(): Base; }' have no overlap. -comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(132,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(133,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(137,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(): Base; }' and 'new () => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(138,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(139,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(140,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(): Base; }' and '{ fn(): C; }' have no overlap. -comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(141,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(142,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(145,12): error TS2367: This comparison appears to be unintentional because the types 'new () => Base' and '{ fn(): Base; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(146,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(147,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(148,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(): C; }' and '{ fn(): Base; }' have no overlap. -comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(149,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(150,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(154,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(): Base; }' and 'new () => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(155,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(a: number, b: string): void; }' and '{ fn(a: string): void; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(156,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(a: Base, b: string): void; }' and '{ fn(a: Derived, b: Base): void; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(157,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(): Base; }' and '{ fn(): C; }' have no overlap. -comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(158,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(159,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(162,12): error TS2367: This comparison appears to be unintentional because the types 'new () => Base' and '{ fn(): Base; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(163,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(a: string): void; }' and '{ fn(a: number, b: string): void; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(164,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(a: Derived, b: Base): void; }' and '{ fn(a: Base, b: string): void; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(165,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(): C; }' and '{ fn(): Base; }' have no overlap. -comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(166,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(167,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }' have no overlap. -==== comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts (96 errors) ==== +==== comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts (83 errors) ==== class Base { public a: string; + ~ +!!! error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. } class Derived extends Base { public b: string; + ~ +!!! error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. } class C { public c: string; + ~ +!!! error TS2564: Property 'c' has no initializer and is not definitely assigned in the constructor. } declare var a1: { fn(): Base }; @@ -144,8 +137,6 @@ comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(167,12): error TS2 ~~~~~~~ !!! error TS2365: Operator '<' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. var r1a5 = a5 < b5; - ~~~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. var r1a6 = a6 < b6; ~~~~~~~ !!! error TS2365: Operator '<' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. @@ -164,8 +155,6 @@ comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(167,12): error TS2 ~~~~~~~ !!! error TS2365: Operator '<' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. var r1b5 = b5 < a5; - ~~~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. var r1b6 = b6 < a6; ~~~~~~~ !!! error TS2365: Operator '<' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. @@ -185,8 +174,6 @@ comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(167,12): error TS2 ~~~~~~~ !!! error TS2365: Operator '>' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. var r2a5 = a5 > b5; - ~~~~~~~ -!!! error TS2365: Operator '>' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. var r2a6 = a6 > b6; ~~~~~~~ !!! error TS2365: Operator '>' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. @@ -205,8 +192,6 @@ comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(167,12): error TS2 ~~~~~~~ !!! error TS2365: Operator '>' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. var r2b5 = b5 > a5; - ~~~~~~~ -!!! error TS2365: Operator '>' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. var r2b6 = b6 > a6; ~~~~~~~ !!! error TS2365: Operator '>' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. @@ -226,8 +211,6 @@ comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(167,12): error TS2 ~~~~~~~~ !!! error TS2365: Operator '<=' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. var r3a5 = a5 <= b5; - ~~~~~~~~ -!!! error TS2365: Operator '<=' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. var r3a6 = a6 <= b6; ~~~~~~~~ !!! error TS2365: Operator '<=' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. @@ -246,8 +229,6 @@ comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(167,12): error TS2 ~~~~~~~~ !!! error TS2365: Operator '<=' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. var r3b5 = b5 <= a5; - ~~~~~~~~ -!!! error TS2365: Operator '<=' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. var r3b6 = b6 <= a6; ~~~~~~~~ !!! error TS2365: Operator '<=' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. @@ -267,8 +248,6 @@ comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(167,12): error TS2 ~~~~~~~~ !!! error TS2365: Operator '>=' cannot be applied to types '{ fn(): Base; }' and '{ fn(): C; }'. var r4a5 = a5 >= b5; - ~~~~~~~~ -!!! error TS2365: Operator '>=' cannot be applied to types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }'. var r4a6 = a6 >= b6; ~~~~~~~~ !!! error TS2365: Operator '>=' cannot be applied to types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }'. @@ -287,8 +266,6 @@ comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(167,12): error TS2 ~~~~~~~~ !!! error TS2365: Operator '>=' cannot be applied to types '{ fn(): C; }' and '{ fn(): Base; }'. var r4b5 = b5 >= a5; - ~~~~~~~~ -!!! error TS2365: Operator '>=' cannot be applied to types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }'. var r4b6 = b6 >= a6; ~~~~~~~~ !!! error TS2365: Operator '>=' cannot be applied to types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }'. @@ -308,8 +285,6 @@ comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(167,12): error TS2 ~~~~~~~~ !!! error TS2367: This comparison appears to be unintentional because the types '{ fn(): Base; }' and '{ fn(): C; }' have no overlap. var r5a5 = a5 == b5; - ~~~~~~~~ -!!! error TS2367: This comparison appears to be unintentional because the types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }' have no overlap. var r5a6 = a6 == b6; ~~~~~~~~ !!! error TS2367: This comparison appears to be unintentional because the types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }' have no overlap. @@ -328,8 +303,6 @@ comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(167,12): error TS2 ~~~~~~~~ !!! error TS2367: This comparison appears to be unintentional because the types '{ fn(): C; }' and '{ fn(): Base; }' have no overlap. var r5b5 = b5 == a5; - ~~~~~~~~ -!!! error TS2367: This comparison appears to be unintentional because the types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }' have no overlap. var r5b6 = b6 == a6; ~~~~~~~~ !!! error TS2367: This comparison appears to be unintentional because the types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }' have no overlap. @@ -349,8 +322,6 @@ comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(167,12): error TS2 ~~~~~~~~ !!! error TS2367: This comparison appears to be unintentional because the types '{ fn(): Base; }' and '{ fn(): C; }' have no overlap. var r6a5 = a5 != b5; - ~~~~~~~~ -!!! error TS2367: This comparison appears to be unintentional because the types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }' have no overlap. var r6a6 = a6 != b6; ~~~~~~~~ !!! error TS2367: This comparison appears to be unintentional because the types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }' have no overlap. @@ -369,8 +340,6 @@ comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(167,12): error TS2 ~~~~~~~~ !!! error TS2367: This comparison appears to be unintentional because the types '{ fn(): C; }' and '{ fn(): Base; }' have no overlap. var r6b5 = b5 != a5; - ~~~~~~~~ -!!! error TS2367: This comparison appears to be unintentional because the types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }' have no overlap. var r6b6 = b6 != a6; ~~~~~~~~ !!! error TS2367: This comparison appears to be unintentional because the types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }' have no overlap. @@ -390,8 +359,6 @@ comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(167,12): error TS2 ~~~~~~~~~ !!! error TS2367: This comparison appears to be unintentional because the types '{ fn(): Base; }' and '{ fn(): C; }' have no overlap. var r7a5 = a5 === b5; - ~~~~~~~~~ -!!! error TS2367: This comparison appears to be unintentional because the types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }' have no overlap. var r7a6 = a6 === b6; ~~~~~~~~~ !!! error TS2367: This comparison appears to be unintentional because the types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }' have no overlap. @@ -410,8 +377,6 @@ comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(167,12): error TS2 ~~~~~~~~~ !!! error TS2367: This comparison appears to be unintentional because the types '{ fn(): C; }' and '{ fn(): Base; }' have no overlap. var r7b5 = b5 === a5; - ~~~~~~~~~ -!!! error TS2367: This comparison appears to be unintentional because the types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }' have no overlap. var r7b6 = b6 === a6; ~~~~~~~~~ !!! error TS2367: This comparison appears to be unintentional because the types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }' have no overlap. @@ -431,8 +396,6 @@ comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(167,12): error TS2 ~~~~~~~~~ !!! error TS2367: This comparison appears to be unintentional because the types '{ fn(): Base; }' and '{ fn(): C; }' have no overlap. var r8a5 = a5 !== b5; - ~~~~~~~~~ -!!! error TS2367: This comparison appears to be unintentional because the types '{ fn(a?: Base): void; }' and '{ fn(a?: C): void; }' have no overlap. var r8a6 = a6 !== b6; ~~~~~~~~~ !!! error TS2367: This comparison appears to be unintentional because the types '{ fn(...a: Base[]): void; }' and '{ fn(...a: C[]): void; }' have no overlap. @@ -451,8 +414,6 @@ comparisonOperatorWithNoRelationshipObjectsOnCallSignature.ts(167,12): error TS2 ~~~~~~~~~ !!! error TS2367: This comparison appears to be unintentional because the types '{ fn(): C; }' and '{ fn(): Base; }' have no overlap. var r8b5 = b5 !== a5; - ~~~~~~~~~ -!!! error TS2367: This comparison appears to be unintentional because the types '{ fn(a?: C): void; }' and '{ fn(a?: Base): void; }' have no overlap. var r8b6 = b6 !== a6; ~~~~~~~~~ !!! error TS2367: This comparison appears to be unintentional because the types '{ fn(...a: C[]): void; }' and '{ fn(...a: Base[]): void; }' have no overlap. diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js index 5e831f1a2e46f..544c741e1076b 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js @@ -171,6 +171,7 @@ var r8b6 = b6 !== a6; var r8b7 = b7 !== a7; //// [comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js] +"use strict"; class Base { } class Derived extends Base { diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.types b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.types index 1832aa944e855..ae8697e90fd91 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.types +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.types @@ -95,16 +95,16 @@ declare var a5: { fn(a?: Base): void }; > : ^^^^^ ^^^ ^^^ ^^^ >fn : (a?: Base) => void > : ^ ^^^ ^^^^^ ->a : Base -> : ^^^^ +>a : Base | undefined +> : ^^^^^^^^^^^^^^^^ declare var b5: { fn(a?: C): void }; >b5 : { fn(a?: C): void; } > : ^^^^^ ^^^ ^^^ ^^^ >fn : (a?: C) => void > : ^ ^^^ ^^^^^ ->a : C -> : ^ +>a : C | undefined +> : ^^^^^^^^^^^^^ declare var a6: { fn(...a: Base[]): void }; >a6 : { fn(...a: Base[]): void; } diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.errors.txt b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.errors.txt index 36ec7d62a7303..762c035acdef0 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.errors.txt +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.errors.txt @@ -1,112 +1,105 @@ +comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(2,12): error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. +comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(6,12): error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. +comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(10,12): error TS2564: Property 'c' has no initializer and is not definitely assigned in the constructor. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(35,12): error TS2365: Operator '<' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(36,12): error TS2365: Operator '<' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(37,12): error TS2365: Operator '<' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(38,12): error TS2365: Operator '<' cannot be applied to types 'new () => Base' and 'new () => C'. -comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(39,12): error TS2365: Operator '<' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(40,12): error TS2365: Operator '<' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(43,12): error TS2365: Operator '<' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(44,12): error TS2365: Operator '<' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(45,12): error TS2365: Operator '<' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(46,12): error TS2365: Operator '<' cannot be applied to types 'new () => C' and 'new () => Base'. -comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(47,12): error TS2365: Operator '<' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(48,12): error TS2365: Operator '<' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(52,12): error TS2365: Operator '>' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(53,12): error TS2365: Operator '>' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(54,12): error TS2365: Operator '>' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(55,12): error TS2365: Operator '>' cannot be applied to types 'new () => Base' and 'new () => C'. -comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(56,12): error TS2365: Operator '>' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(57,12): error TS2365: Operator '>' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(60,12): error TS2365: Operator '>' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(61,12): error TS2365: Operator '>' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(62,12): error TS2365: Operator '>' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(63,12): error TS2365: Operator '>' cannot be applied to types 'new () => C' and 'new () => Base'. -comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(64,12): error TS2365: Operator '>' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(65,12): error TS2365: Operator '>' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(69,12): error TS2365: Operator '<=' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(70,12): error TS2365: Operator '<=' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(71,12): error TS2365: Operator '<=' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(72,12): error TS2365: Operator '<=' cannot be applied to types 'new () => Base' and 'new () => C'. -comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(73,12): error TS2365: Operator '<=' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(74,12): error TS2365: Operator '<=' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(77,12): error TS2365: Operator '<=' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(78,12): error TS2365: Operator '<=' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(79,12): error TS2365: Operator '<=' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(80,12): error TS2365: Operator '<=' cannot be applied to types 'new () => C' and 'new () => Base'. -comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(81,12): error TS2365: Operator '<=' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(82,12): error TS2365: Operator '<=' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(86,12): error TS2365: Operator '>=' cannot be applied to types '{ fn(): Base; }' and 'new () => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(87,12): error TS2365: Operator '>=' cannot be applied to types 'new (a: number, b: string) => Base' and 'new (a: string) => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(88,12): error TS2365: Operator '>=' cannot be applied to types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(89,12): error TS2365: Operator '>=' cannot be applied to types 'new () => Base' and 'new () => C'. -comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(90,12): error TS2365: Operator '>=' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(91,12): error TS2365: Operator '>=' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(94,12): error TS2365: Operator '>=' cannot be applied to types 'new () => Base' and '{ fn(): Base; }'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(95,12): error TS2365: Operator '>=' cannot be applied to types 'new (a: string) => Base' and 'new (a: number, b: string) => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(96,12): error TS2365: Operator '>=' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(97,12): error TS2365: Operator '>=' cannot be applied to types 'new () => C' and 'new () => Base'. -comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(98,12): error TS2365: Operator '>=' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(99,12): error TS2365: Operator '>=' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(103,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(): Base; }' and 'new () => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(104,12): error TS2367: This comparison appears to be unintentional because the types 'new (a: number, b: string) => Base' and 'new (a: string) => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(105,12): error TS2367: This comparison appears to be unintentional because the types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(106,12): error TS2367: This comparison appears to be unintentional because the types 'new () => Base' and 'new () => C' have no overlap. -comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(107,12): error TS2367: This comparison appears to be unintentional because the types 'new (a?: Base) => Base' and 'new (a?: C) => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(108,12): error TS2367: This comparison appears to be unintentional because the types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(111,12): error TS2367: This comparison appears to be unintentional because the types 'new () => Base' and '{ fn(): Base; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(112,12): error TS2367: This comparison appears to be unintentional because the types 'new (a: string) => Base' and 'new (a: number, b: string) => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(113,12): error TS2367: This comparison appears to be unintentional because the types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(114,12): error TS2367: This comparison appears to be unintentional because the types 'new () => C' and 'new () => Base' have no overlap. -comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(115,12): error TS2367: This comparison appears to be unintentional because the types 'new (a?: C) => Base' and 'new (a?: Base) => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(116,12): error TS2367: This comparison appears to be unintentional because the types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(120,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(): Base; }' and 'new () => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(121,12): error TS2367: This comparison appears to be unintentional because the types 'new (a: number, b: string) => Base' and 'new (a: string) => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(122,12): error TS2367: This comparison appears to be unintentional because the types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(123,12): error TS2367: This comparison appears to be unintentional because the types 'new () => Base' and 'new () => C' have no overlap. -comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(124,12): error TS2367: This comparison appears to be unintentional because the types 'new (a?: Base) => Base' and 'new (a?: C) => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(125,12): error TS2367: This comparison appears to be unintentional because the types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(128,12): error TS2367: This comparison appears to be unintentional because the types 'new () => Base' and '{ fn(): Base; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(129,12): error TS2367: This comparison appears to be unintentional because the types 'new (a: string) => Base' and 'new (a: number, b: string) => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(130,12): error TS2367: This comparison appears to be unintentional because the types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(131,12): error TS2367: This comparison appears to be unintentional because the types 'new () => C' and 'new () => Base' have no overlap. -comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(132,12): error TS2367: This comparison appears to be unintentional because the types 'new (a?: C) => Base' and 'new (a?: Base) => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(133,12): error TS2367: This comparison appears to be unintentional because the types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(137,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(): Base; }' and 'new () => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(138,12): error TS2367: This comparison appears to be unintentional because the types 'new (a: number, b: string) => Base' and 'new (a: string) => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(139,12): error TS2367: This comparison appears to be unintentional because the types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(140,12): error TS2367: This comparison appears to be unintentional because the types 'new () => Base' and 'new () => C' have no overlap. -comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(141,12): error TS2367: This comparison appears to be unintentional because the types 'new (a?: Base) => Base' and 'new (a?: C) => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(142,12): error TS2367: This comparison appears to be unintentional because the types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(145,12): error TS2367: This comparison appears to be unintentional because the types 'new () => Base' and '{ fn(): Base; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(146,12): error TS2367: This comparison appears to be unintentional because the types 'new (a: string) => Base' and 'new (a: number, b: string) => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(147,12): error TS2367: This comparison appears to be unintentional because the types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(148,12): error TS2367: This comparison appears to be unintentional because the types 'new () => C' and 'new () => Base' have no overlap. -comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(149,12): error TS2367: This comparison appears to be unintentional because the types 'new (a?: C) => Base' and 'new (a?: Base) => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(150,12): error TS2367: This comparison appears to be unintentional because the types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(154,12): error TS2367: This comparison appears to be unintentional because the types '{ fn(): Base; }' and 'new () => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(155,12): error TS2367: This comparison appears to be unintentional because the types 'new (a: number, b: string) => Base' and 'new (a: string) => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(156,12): error TS2367: This comparison appears to be unintentional because the types 'new (a: Base, b: string) => Base' and 'new (a: Derived, b: Base) => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(157,12): error TS2367: This comparison appears to be unintentional because the types 'new () => Base' and 'new () => C' have no overlap. -comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(158,12): error TS2367: This comparison appears to be unintentional because the types 'new (a?: Base) => Base' and 'new (a?: C) => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(159,12): error TS2367: This comparison appears to be unintentional because the types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(162,12): error TS2367: This comparison appears to be unintentional because the types 'new () => Base' and '{ fn(): Base; }' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(163,12): error TS2367: This comparison appears to be unintentional because the types 'new (a: string) => Base' and 'new (a: number, b: string) => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(164,12): error TS2367: This comparison appears to be unintentional because the types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: string) => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(165,12): error TS2367: This comparison appears to be unintentional because the types 'new () => C' and 'new () => Base' have no overlap. -comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(166,12): error TS2367: This comparison appears to be unintentional because the types 'new (a?: C) => Base' and 'new (a?: Base) => Base' have no overlap. comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(167,12): error TS2367: This comparison appears to be unintentional because the types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base' have no overlap. -==== comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts (96 errors) ==== +==== comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts (83 errors) ==== class Base { public a: string; + ~ +!!! error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. } class Derived extends Base { public b: string; + ~ +!!! error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. } class C { public c: string; + ~ +!!! error TS2564: Property 'c' has no initializer and is not definitely assigned in the constructor. } declare var a1: { fn(): Base }; @@ -144,8 +137,6 @@ comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(167,12): er ~~~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'new () => Base' and 'new () => C'. var r1a5 = a5 < b5; - ~~~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. var r1a6 = a6 < b6; ~~~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. @@ -164,8 +155,6 @@ comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(167,12): er ~~~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'new () => C' and 'new () => Base'. var r1b5 = b5 < a5; - ~~~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. var r1b6 = b6 < a6; ~~~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. @@ -185,8 +174,6 @@ comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(167,12): er ~~~~~~~ !!! error TS2365: Operator '>' cannot be applied to types 'new () => Base' and 'new () => C'. var r2a5 = a5 > b5; - ~~~~~~~ -!!! error TS2365: Operator '>' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. var r2a6 = a6 > b6; ~~~~~~~ !!! error TS2365: Operator '>' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. @@ -205,8 +192,6 @@ comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(167,12): er ~~~~~~~ !!! error TS2365: Operator '>' cannot be applied to types 'new () => C' and 'new () => Base'. var r2b5 = b5 > a5; - ~~~~~~~ -!!! error TS2365: Operator '>' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. var r2b6 = b6 > a6; ~~~~~~~ !!! error TS2365: Operator '>' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. @@ -226,8 +211,6 @@ comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(167,12): er ~~~~~~~~ !!! error TS2365: Operator '<=' cannot be applied to types 'new () => Base' and 'new () => C'. var r3a5 = a5 <= b5; - ~~~~~~~~ -!!! error TS2365: Operator '<=' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. var r3a6 = a6 <= b6; ~~~~~~~~ !!! error TS2365: Operator '<=' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. @@ -246,8 +229,6 @@ comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(167,12): er ~~~~~~~~ !!! error TS2365: Operator '<=' cannot be applied to types 'new () => C' and 'new () => Base'. var r3b5 = b5 <= a5; - ~~~~~~~~ -!!! error TS2365: Operator '<=' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. var r3b6 = b6 <= a6; ~~~~~~~~ !!! error TS2365: Operator '<=' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. @@ -267,8 +248,6 @@ comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(167,12): er ~~~~~~~~ !!! error TS2365: Operator '>=' cannot be applied to types 'new () => Base' and 'new () => C'. var r4a5 = a5 >= b5; - ~~~~~~~~ -!!! error TS2365: Operator '>=' cannot be applied to types 'new (a?: Base) => Base' and 'new (a?: C) => Base'. var r4a6 = a6 >= b6; ~~~~~~~~ !!! error TS2365: Operator '>=' cannot be applied to types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base'. @@ -287,8 +266,6 @@ comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(167,12): er ~~~~~~~~ !!! error TS2365: Operator '>=' cannot be applied to types 'new () => C' and 'new () => Base'. var r4b5 = b5 >= a5; - ~~~~~~~~ -!!! error TS2365: Operator '>=' cannot be applied to types 'new (a?: C) => Base' and 'new (a?: Base) => Base'. var r4b6 = b6 >= a6; ~~~~~~~~ !!! error TS2365: Operator '>=' cannot be applied to types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base'. @@ -308,8 +285,6 @@ comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(167,12): er ~~~~~~~~ !!! error TS2367: This comparison appears to be unintentional because the types 'new () => Base' and 'new () => C' have no overlap. var r5a5 = a5 == b5; - ~~~~~~~~ -!!! error TS2367: This comparison appears to be unintentional because the types 'new (a?: Base) => Base' and 'new (a?: C) => Base' have no overlap. var r5a6 = a6 == b6; ~~~~~~~~ !!! error TS2367: This comparison appears to be unintentional because the types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base' have no overlap. @@ -328,8 +303,6 @@ comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(167,12): er ~~~~~~~~ !!! error TS2367: This comparison appears to be unintentional because the types 'new () => C' and 'new () => Base' have no overlap. var r5b5 = b5 == a5; - ~~~~~~~~ -!!! error TS2367: This comparison appears to be unintentional because the types 'new (a?: C) => Base' and 'new (a?: Base) => Base' have no overlap. var r5b6 = b6 == a6; ~~~~~~~~ !!! error TS2367: This comparison appears to be unintentional because the types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base' have no overlap. @@ -349,8 +322,6 @@ comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(167,12): er ~~~~~~~~ !!! error TS2367: This comparison appears to be unintentional because the types 'new () => Base' and 'new () => C' have no overlap. var r6a5 = a5 != b5; - ~~~~~~~~ -!!! error TS2367: This comparison appears to be unintentional because the types 'new (a?: Base) => Base' and 'new (a?: C) => Base' have no overlap. var r6a6 = a6 != b6; ~~~~~~~~ !!! error TS2367: This comparison appears to be unintentional because the types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base' have no overlap. @@ -369,8 +340,6 @@ comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(167,12): er ~~~~~~~~ !!! error TS2367: This comparison appears to be unintentional because the types 'new () => C' and 'new () => Base' have no overlap. var r6b5 = b5 != a5; - ~~~~~~~~ -!!! error TS2367: This comparison appears to be unintentional because the types 'new (a?: C) => Base' and 'new (a?: Base) => Base' have no overlap. var r6b6 = b6 != a6; ~~~~~~~~ !!! error TS2367: This comparison appears to be unintentional because the types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base' have no overlap. @@ -390,8 +359,6 @@ comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(167,12): er ~~~~~~~~~ !!! error TS2367: This comparison appears to be unintentional because the types 'new () => Base' and 'new () => C' have no overlap. var r7a5 = a5 === b5; - ~~~~~~~~~ -!!! error TS2367: This comparison appears to be unintentional because the types 'new (a?: Base) => Base' and 'new (a?: C) => Base' have no overlap. var r7a6 = a6 === b6; ~~~~~~~~~ !!! error TS2367: This comparison appears to be unintentional because the types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base' have no overlap. @@ -410,8 +377,6 @@ comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(167,12): er ~~~~~~~~~ !!! error TS2367: This comparison appears to be unintentional because the types 'new () => C' and 'new () => Base' have no overlap. var r7b5 = b5 === a5; - ~~~~~~~~~ -!!! error TS2367: This comparison appears to be unintentional because the types 'new (a?: C) => Base' and 'new (a?: Base) => Base' have no overlap. var r7b6 = b6 === a6; ~~~~~~~~~ !!! error TS2367: This comparison appears to be unintentional because the types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base' have no overlap. @@ -431,8 +396,6 @@ comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(167,12): er ~~~~~~~~~ !!! error TS2367: This comparison appears to be unintentional because the types 'new () => Base' and 'new () => C' have no overlap. var r8a5 = a5 !== b5; - ~~~~~~~~~ -!!! error TS2367: This comparison appears to be unintentional because the types 'new (a?: Base) => Base' and 'new (a?: C) => Base' have no overlap. var r8a6 = a6 !== b6; ~~~~~~~~~ !!! error TS2367: This comparison appears to be unintentional because the types 'new (...a: Base[]) => Base' and 'new (...a: C[]) => Base' have no overlap. @@ -451,8 +414,6 @@ comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.ts(167,12): er ~~~~~~~~~ !!! error TS2367: This comparison appears to be unintentional because the types 'new () => C' and 'new () => Base' have no overlap. var r8b5 = b5 !== a5; - ~~~~~~~~~ -!!! error TS2367: This comparison appears to be unintentional because the types 'new (a?: C) => Base' and 'new (a?: Base) => Base' have no overlap. var r8b6 = b6 !== a6; ~~~~~~~~~ !!! error TS2367: This comparison appears to be unintentional because the types 'new (...a: C[]) => Base' and 'new (...a: Base[]) => Base' have no overlap. diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js index 09453added5b8..c049e82d422ca 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js @@ -171,6 +171,7 @@ var r8b6 = b6 !== a6; var r8b7 = b7 !== a7; //// [comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js] +"use strict"; class Base { } class Derived extends Base { diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.types b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.types index 23d4b6486291a..b983119eefe54 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.types +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.types @@ -81,14 +81,14 @@ declare var b4: { new (): C }; declare var a5: { new (a?: Base): Base }; >a5 : new (a?: Base) => Base > : ^^^^^ ^^^ ^^^^^ ->a : Base -> : ^^^^ +>a : Base | undefined +> : ^^^^^^^^^^^^^^^^ declare var b5: { new (a?: C): Base }; >b5 : new (a?: C) => Base > : ^^^^^ ^^^ ^^^^^ ->a : C -> : ^ +>a : C | undefined +> : ^^^^^^^^^^^^^ declare var a6: { new (...a: Base[]): Base }; >a6 : new (...a: Base[]) => Base diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.errors.txt b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.errors.txt index a55feb832c171..dc5e0dcaf623d 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.errors.txt +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.errors.txt @@ -1,3 +1,6 @@ +comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(2,12): error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. +comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(6,12): error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. +comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(10,12): error TS2564: Property 'c' has no initializer and is not definitely assigned in the constructor. comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(26,12): error TS2365: Operator '<' cannot be applied to types '{ [a: string]: string; }' and '{ [b: string]: number; }'. comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(27,12): error TS2365: Operator '<' cannot be applied to types '{ [index: string]: Base; }' and '{ [index: string]: C; }'. comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(28,12): error TS2365: Operator '<' cannot be applied to types '{ [index: number]: Base; }' and '{ [index: number]: C; }'. @@ -48,17 +51,23 @@ comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(109,12): error TS comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts(110,12): error TS2367: This comparison appears to be unintentional because the types '{ [index: number]: C; }' and '{ [index: number]: Base; }' have no overlap. -==== comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts (48 errors) ==== +==== comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.ts (51 errors) ==== class Base { public a: string; + ~ +!!! error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. } class Derived extends Base { public b: string; + ~ +!!! error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. } class C { public c: string; + ~ +!!! error TS2564: Property 'c' has no initializer and is not definitely assigned in the constructor. } declare var a1: { [a: string]: string }; diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js index b9aed9d6bbd6c..a204e522f6c91 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js @@ -114,6 +114,7 @@ var r8b3 = b3 !== a3; var r8b4 = b4 !== a4; //// [comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js] +"use strict"; class Base { } class Derived extends Base { diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.errors.txt b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.errors.txt new file mode 100644 index 0000000000000..86afeacd2b38c --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.errors.txt @@ -0,0 +1,737 @@ +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(2,12): error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(6,12): error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(10,12): error TS2564: Property 'c' has no initializer and is not definitely assigned in the constructor. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(32,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(32,17): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(33,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(33,17): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(34,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(34,17): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(35,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(35,17): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(36,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(36,17): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(37,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(37,17): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(39,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(39,17): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(40,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(40,17): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(41,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(41,17): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(42,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(42,17): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(43,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(43,17): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(44,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(44,17): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(47,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(47,17): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(48,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(48,17): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(49,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(49,17): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(50,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(50,17): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(51,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(51,17): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(52,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(52,17): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(54,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(54,17): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(55,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(55,17): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(56,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(56,17): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(57,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(57,17): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(58,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(58,17): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(59,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(59,17): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(62,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(62,18): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(63,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(63,18): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(64,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(64,18): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(65,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(65,18): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(66,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(66,18): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(67,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(67,18): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(69,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(69,18): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(70,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(70,18): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(71,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(71,18): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(72,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(72,18): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(73,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(73,18): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(74,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(74,18): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(77,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(77,18): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(78,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(78,18): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(79,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(79,18): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(80,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(80,18): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(81,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(81,18): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(82,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(82,18): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(84,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(84,18): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(85,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(85,18): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(86,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(86,18): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(87,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(87,18): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(88,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(88,18): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(89,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(89,18): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(92,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(92,18): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(93,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(93,18): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(94,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(94,18): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(95,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(95,18): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(96,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(96,18): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(97,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(97,18): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(99,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(99,18): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(100,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(100,18): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(101,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(101,18): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(102,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(102,18): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(103,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(103,18): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(104,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(104,18): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(107,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(107,18): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(108,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(108,18): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(109,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(109,18): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(110,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(110,18): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(111,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(111,18): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(112,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(112,18): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(114,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(114,18): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(115,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(115,18): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(116,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(116,18): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(117,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(117,18): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(118,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(118,18): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(119,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(119,18): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(122,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(122,19): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(123,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(123,19): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(124,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(124,19): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(125,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(125,19): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(126,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(126,19): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(127,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(127,19): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(129,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(129,19): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(130,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(130,19): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(131,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(131,19): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(132,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(132,19): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(133,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(133,19): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(134,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(134,19): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(137,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(137,19): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(138,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(138,19): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(139,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(139,19): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(140,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(140,19): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(141,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(141,19): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(142,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(142,19): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(144,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(144,19): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(145,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(145,19): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(146,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(146,19): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(147,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(147,19): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(148,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(148,19): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(149,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(149,19): error TS2454: Variable 'a6' is used before being assigned. + + +==== comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts (195 errors) ==== + class Base { + public a: string; + ~ +!!! error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. + } + + class Derived extends Base { + public b: string; + ~ +!!! error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. + } + + class C { + public c: string; + ~ +!!! error TS2564: Property 'c' has no initializer and is not definitely assigned in the constructor. + } + + var a1: { fn(x: T): T }; + var b1: { fn(): string }; + + var a2: { fn(x: T): T }; + var b2: { fn(x: string): number }; + + var a3: { fn(x?: T): T }; + var b3: { fn(x?: string): number }; + + var a4: { fn(...x: T[]): T }; + var b4: { fn(...x: string[]): number }; + + var a5: { fn(x: T, y: T): T }; + var b5: { fn(x: string, y: number): string }; + + var a6: { fn(x: T, y: U): T }; + var b6: { fn(x: Base, y: C): Base }; + + // operator < + var r1a1 = a1 < b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r1a2 = a2 < b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r1a3 = a3 < b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r1a4 = a4 < b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r1a5 = a5 < b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r1a6 = a6 < b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + + var r1b1 = b1 < a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r1b2 = b2 < a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r1b3 = b3 < a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r1b4 = b4 < a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r1b5 = b5 < a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r1b6 = b6 < a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + + // operator > + var r2a1 = a1 > b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r2a2 = a2 > b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r2a3 = a3 > b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r2a4 = a4 > b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r2a5 = a5 > b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r2a6 = a6 > b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + + var r2b1 = b1 > a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r2b2 = b2 > a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r2b3 = b3 > a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r2b4 = b4 > a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r2b5 = b5 > a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r2b6 = b6 > a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + + // operator <= + var r3a1 = a1 <= b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r3a2 = a2 <= b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r3a3 = a3 <= b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r3a4 = a4 <= b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r3a5 = a5 <= b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r3a6 = a6 <= b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + + var r3b1 = b1 <= a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r3b2 = b2 <= a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r3b3 = b3 <= a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r3b4 = b4 <= a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r3b5 = b5 <= a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r3b6 = b6 <= a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + + // operator >= + var r4a1 = a1 >= b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r4a2 = a2 >= b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r4a3 = a3 >= b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r4a4 = a4 >= b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r4a5 = a5 >= b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r4a6 = a6 >= b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + + var r4b1 = b1 >= a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r4b2 = b2 >= a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r4b3 = b3 >= a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r4b4 = b4 >= a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r4b5 = b5 >= a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r4b6 = b6 >= a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + + // operator == + var r5a1 = a1 == b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r5a2 = a2 == b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r5a3 = a3 == b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r5a4 = a4 == b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r5a5 = a5 == b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r5a6 = a6 == b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + + var r5b1 = b1 == a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r5b2 = b2 == a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r5b3 = b3 == a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r5b4 = b4 == a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r5b5 = b5 == a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r5b6 = b6 == a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + + // operator != + var r6a1 = a1 != b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r6a2 = a2 != b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r6a3 = a3 != b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r6a4 = a4 != b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r6a5 = a5 != b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r6a6 = a6 != b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + + var r6b1 = b1 != a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r6b2 = b2 != a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r6b3 = b3 != a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r6b4 = b4 != a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r6b5 = b5 != a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r6b6 = b6 != a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + + // operator === + var r7a1 = a1 === b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r7a2 = a2 === b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r7a3 = a3 === b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r7a4 = a4 === b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r7a5 = a5 === b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r7a6 = a6 === b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + + var r7b1 = b1 === a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r7b2 = b2 === a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r7b3 = b3 === a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r7b4 = b4 === a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r7b5 = b5 === a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r7b6 = b6 === a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + + // operator !== + var r8a1 = a1 !== b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r8a2 = a2 !== b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r8a3 = a3 !== b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r8a4 = a4 !== b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r8a5 = a5 !== b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r8a6 = a6 !== b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + + var r8b1 = b1 !== a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r8b2 = b2 !== a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r8b3 = b3 !== a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r8b4 = b4 !== a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r8b5 = b5 !== a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r8b6 = b6 !== a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js index 8a9530e42bb2d..5980ffd1d4412 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js @@ -152,6 +152,7 @@ var r8b5 = b5 !== a5; var r8b6 = b6 !== a6; //// [comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js] +"use strict"; class Base { } class Derived extends Base { diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.types b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.types index 491973861c672..6e107aa7b0944 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.types +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.types @@ -65,16 +65,16 @@ var a3: { fn(x?: T): T }; > : ^^^^^ ^^ ^^^ ^^^ ^^^ >fn : (x?: T) => T > : ^ ^^ ^^^ ^^^^^ ->x : T -> : ^ +>x : T | undefined +> : ^^^^^^^^^^^^^ var b3: { fn(x?: string): number }; >b3 : { fn(x?: string): number; } > : ^^^^^ ^^^ ^^^ ^^^ >fn : (x?: string) => number > : ^ ^^^ ^^^^^ ->x : string -> : ^^^^^^ +>x : string | undefined +> : ^^^^^^^^^^^^^^^^^^ var a4: { fn(...x: T[]): T }; >a4 : { fn(...x: T[]): T; } diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.errors.txt b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.errors.txt new file mode 100644 index 0000000000000..3aece841bce3f --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.errors.txt @@ -0,0 +1,737 @@ +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(2,12): error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(6,12): error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(10,12): error TS2564: Property 'c' has no initializer and is not definitely assigned in the constructor. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(32,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(32,17): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(33,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(33,17): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(34,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(34,17): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(35,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(35,17): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(36,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(36,17): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(37,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(37,17): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(39,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(39,17): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(40,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(40,17): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(41,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(41,17): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(42,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(42,17): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(43,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(43,17): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(44,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(44,17): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(47,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(47,17): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(48,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(48,17): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(49,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(49,17): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(50,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(50,17): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(51,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(51,17): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(52,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(52,17): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(54,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(54,17): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(55,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(55,17): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(56,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(56,17): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(57,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(57,17): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(58,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(58,17): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(59,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(59,17): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(62,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(62,18): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(63,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(63,18): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(64,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(64,18): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(65,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(65,18): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(66,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(66,18): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(67,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(67,18): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(69,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(69,18): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(70,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(70,18): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(71,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(71,18): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(72,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(72,18): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(73,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(73,18): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(74,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(74,18): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(77,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(77,18): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(78,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(78,18): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(79,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(79,18): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(80,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(80,18): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(81,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(81,18): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(82,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(82,18): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(84,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(84,18): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(85,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(85,18): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(86,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(86,18): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(87,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(87,18): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(88,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(88,18): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(89,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(89,18): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(92,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(92,18): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(93,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(93,18): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(94,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(94,18): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(95,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(95,18): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(96,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(96,18): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(97,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(97,18): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(99,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(99,18): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(100,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(100,18): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(101,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(101,18): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(102,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(102,18): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(103,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(103,18): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(104,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(104,18): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(107,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(107,18): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(108,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(108,18): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(109,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(109,18): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(110,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(110,18): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(111,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(111,18): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(112,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(112,18): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(114,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(114,18): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(115,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(115,18): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(116,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(116,18): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(117,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(117,18): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(118,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(118,18): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(119,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(119,18): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(122,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(122,19): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(123,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(123,19): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(124,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(124,19): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(125,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(125,19): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(126,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(126,19): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(127,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(127,19): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(129,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(129,19): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(130,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(130,19): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(131,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(131,19): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(132,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(132,19): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(133,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(133,19): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(134,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(134,19): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(137,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(137,19): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(138,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(138,19): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(139,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(139,19): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(140,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(140,19): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(141,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(141,19): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(142,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(142,19): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(144,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(144,19): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(145,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(145,19): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(146,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(146,19): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(147,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(147,19): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(148,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(148,19): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(149,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(149,19): error TS2454: Variable 'a6' is used before being assigned. + + +==== comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts (195 errors) ==== + class Base { + public a: string; + ~ +!!! error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. + } + + class Derived extends Base { + public b: string; + ~ +!!! error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. + } + + class C { + public c: string; + ~ +!!! error TS2564: Property 'c' has no initializer and is not definitely assigned in the constructor. + } + + var a1: { new (x: T): T }; + var b1: { new (): string }; + + var a2: { new (x: T): T }; + var b2: { new (x: string): number }; + + var a3: { new (x?: T): T }; + var b3: { new (x?: string): number }; + + var a4: { new (...x: T[]): T }; + var b4: { new (...x: string[]): number }; + + var a5: { new (x: T, y: T): T }; + var b5: { new (x: string, y: number): string }; + + var a6: { new (x: T, y: U): T }; + var b6: { new (x: Base, y: C): Base }; + + // operator < + var r1a1 = a1 < b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r1a2 = a2 < b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r1a3 = a3 < b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r1a4 = a4 < b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r1a5 = a5 < b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r1a6 = a6 < b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + + var r1b1 = b1 < a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r1b2 = b2 < a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r1b3 = b3 < a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r1b4 = b4 < a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r1b5 = b5 < a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r1b6 = b6 < a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + + // operator > + var r2a1 = a1 > b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r2a2 = a2 > b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r2a3 = a3 > b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r2a4 = a4 > b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r2a5 = a5 > b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r2a6 = a6 > b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + + var r2b1 = b1 > a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r2b2 = b2 > a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r2b3 = b3 > a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r2b4 = b4 > a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r2b5 = b5 > a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r2b6 = b6 > a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + + // operator <= + var r3a1 = a1 <= b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r3a2 = a2 <= b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r3a3 = a3 <= b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r3a4 = a4 <= b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r3a5 = a5 <= b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r3a6 = a6 <= b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + + var r3b1 = b1 <= a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r3b2 = b2 <= a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r3b3 = b3 <= a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r3b4 = b4 <= a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r3b5 = b5 <= a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r3b6 = b6 <= a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + + // operator >= + var r4a1 = a1 >= b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r4a2 = a2 >= b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r4a3 = a3 >= b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r4a4 = a4 >= b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r4a5 = a5 >= b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r4a6 = a6 >= b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + + var r4b1 = b1 >= a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r4b2 = b2 >= a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r4b3 = b3 >= a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r4b4 = b4 >= a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r4b5 = b5 >= a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r4b6 = b6 >= a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + + // operator == + var r5a1 = a1 == b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r5a2 = a2 == b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r5a3 = a3 == b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r5a4 = a4 == b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r5a5 = a5 == b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r5a6 = a6 == b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + + var r5b1 = b1 == a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r5b2 = b2 == a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r5b3 = b3 == a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r5b4 = b4 == a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r5b5 = b5 == a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r5b6 = b6 == a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + + // operator != + var r6a1 = a1 != b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r6a2 = a2 != b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r6a3 = a3 != b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r6a4 = a4 != b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r6a5 = a5 != b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r6a6 = a6 != b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + + var r6b1 = b1 != a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r6b2 = b2 != a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r6b3 = b3 != a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r6b4 = b4 != a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r6b5 = b5 != a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r6b6 = b6 != a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + + // operator === + var r7a1 = a1 === b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r7a2 = a2 === b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r7a3 = a3 === b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r7a4 = a4 === b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r7a5 = a5 === b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r7a6 = a6 === b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + + var r7b1 = b1 === a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r7b2 = b2 === a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r7b3 = b3 === a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r7b4 = b4 === a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r7b5 = b5 === a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r7b6 = b6 === a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + + // operator !== + var r8a1 = a1 !== b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r8a2 = a2 !== b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r8a3 = a3 !== b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r8a4 = a4 !== b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r8a5 = a5 !== b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r8a6 = a6 !== b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + + var r8b1 = b1 !== a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r8b2 = b2 !== a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r8b3 = b3 !== a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r8b4 = b4 !== a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r8b5 = b5 !== a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r8b6 = b6 !== a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js index 5bc8045c3a692..b57a80fb18cb7 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js @@ -152,6 +152,7 @@ var r8b5 = b5 !== a5; var r8b6 = b6 !== a6; //// [comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js] +"use strict"; class Base { } class Derived extends Base { diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.types b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.types index ef580e1103e55..9956bce816795 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.types +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.types @@ -55,14 +55,14 @@ var b2: { new (x: string): number }; var a3: { new (x?: T): T }; >a3 : new (x?: T) => T > : ^^^^^ ^^ ^^^ ^^^^^ ->x : T -> : ^ +>x : T | undefined +> : ^^^^^^^^^^^^^ var b3: { new (x?: string): number }; >b3 : new (x?: string) => number > : ^^^^^ ^^^ ^^^^^ ->x : string -> : ^^^^^^ +>x : string | undefined +> : ^^^^^^^^^^^^^^^^^^ var a4: { new (...x: T[]): T }; >a4 : new (...x: T[]) => T diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.errors.txt b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.errors.txt deleted file mode 100644 index 00be665a576ec..0000000000000 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.errors.txt +++ /dev/null @@ -1,93 +0,0 @@ -comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts(13,11): error TS2365: Operator '<' cannot be applied to types 'A1' and 'B1'. -comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts(14,11): error TS2365: Operator '<' cannot be applied to types 'B1' and 'A1'. -comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts(17,11): error TS2365: Operator '>' cannot be applied to types 'A1' and 'B1'. -comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts(18,11): error TS2365: Operator '>' cannot be applied to types 'B1' and 'A1'. -comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts(21,11): error TS2365: Operator '<=' cannot be applied to types 'A1' and 'B1'. -comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts(22,11): error TS2365: Operator '<=' cannot be applied to types 'B1' and 'A1'. -comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts(25,11): error TS2365: Operator '>=' cannot be applied to types 'A1' and 'B1'. -comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts(26,11): error TS2365: Operator '>=' cannot be applied to types 'B1' and 'A1'. -comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts(29,11): error TS2367: This comparison appears to be unintentional because the types 'A1' and 'B1' have no overlap. -comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts(30,11): error TS2367: This comparison appears to be unintentional because the types 'B1' and 'A1' have no overlap. -comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts(33,11): error TS2367: This comparison appears to be unintentional because the types 'A1' and 'B1' have no overlap. -comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts(34,11): error TS2367: This comparison appears to be unintentional because the types 'B1' and 'A1' have no overlap. -comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts(37,11): error TS2367: This comparison appears to be unintentional because the types 'A1' and 'B1' have no overlap. -comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts(38,11): error TS2367: This comparison appears to be unintentional because the types 'B1' and 'A1' have no overlap. -comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts(41,11): error TS2367: This comparison appears to be unintentional because the types 'A1' and 'B1' have no overlap. -comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts(42,11): error TS2367: This comparison appears to be unintentional because the types 'B1' and 'A1' have no overlap. - - -==== comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts (16 errors) ==== - interface A1 { - b?: number; - } - - interface B1 { - b?: string; - } - - declare var a: A1; - declare var b: B1; - - // operator < - var ra1 = a < b; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'A1' and 'B1'. - var ra2 = b < a; - ~~~~~ -!!! error TS2365: Operator '<' cannot be applied to types 'B1' and 'A1'. - - // operator > - var rb1 = a > b; - ~~~~~ -!!! error TS2365: Operator '>' cannot be applied to types 'A1' and 'B1'. - var rb2 = b > a; - ~~~~~ -!!! error TS2365: Operator '>' cannot be applied to types 'B1' and 'A1'. - - // operator <= - var rc1 = a <= b; - ~~~~~~ -!!! error TS2365: Operator '<=' cannot be applied to types 'A1' and 'B1'. - var rc2 = b <= a; - ~~~~~~ -!!! error TS2365: Operator '<=' cannot be applied to types 'B1' and 'A1'. - - // operator >= - var rd1 = a >= b; - ~~~~~~ -!!! error TS2365: Operator '>=' cannot be applied to types 'A1' and 'B1'. - var rd2 = b >= a; - ~~~~~~ -!!! error TS2365: Operator '>=' cannot be applied to types 'B1' and 'A1'. - - // operator == - var re1 = a == b; - ~~~~~~ -!!! error TS2367: This comparison appears to be unintentional because the types 'A1' and 'B1' have no overlap. - var re2 = b == a; - ~~~~~~ -!!! error TS2367: This comparison appears to be unintentional because the types 'B1' and 'A1' have no overlap. - - // operator != - var rf1 = a != b; - ~~~~~~ -!!! error TS2367: This comparison appears to be unintentional because the types 'A1' and 'B1' have no overlap. - var rf2 = b != a; - ~~~~~~ -!!! error TS2367: This comparison appears to be unintentional because the types 'B1' and 'A1' have no overlap. - - // operator === - var rg1 = a === b; - ~~~~~~~ -!!! error TS2367: This comparison appears to be unintentional because the types 'A1' and 'B1' have no overlap. - var rg2 = b === a; - ~~~~~~~ -!!! error TS2367: This comparison appears to be unintentional because the types 'B1' and 'A1' have no overlap. - - // operator !== - var rh1 = a !== b; - ~~~~~~~ -!!! error TS2367: This comparison appears to be unintentional because the types 'A1' and 'B1' have no overlap. - var rh2 = b !== a; - ~~~~~~~ -!!! error TS2367: This comparison appears to be unintentional because the types 'B1' and 'A1' have no overlap. \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.js index da3905dd60007..0b9324d21e18b 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.js @@ -45,6 +45,7 @@ var rh1 = a !== b; var rh2 = b !== a; //// [comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.js] +"use strict"; // operator < var ra1 = a < b; var ra2 = b < a; diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.types b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.types index 3949c55076f07..5948789e96400 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.types +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.types @@ -3,14 +3,14 @@ === comparisonOperatorWithNoRelationshipObjectsOnOptionalProperty.ts === interface A1 { b?: number; ->b : number -> : ^^^^^^ +>b : number | undefined +> : ^^^^^^^^^^^^^^^^^^ } interface B1 { b?: string; ->b : string -> : ^^^^^^ +>b : string | undefined +> : ^^^^^^^^^^^^^^^^^^ } declare var a: A1; diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnProperty.errors.txt b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnProperty.errors.txt index 82527c181aabf..52c9f58402302 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnProperty.errors.txt +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnProperty.errors.txt @@ -1,3 +1,7 @@ +comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(2,12): error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. +comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(6,12): error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. +comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(10,13): error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. +comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(14,13): error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(23,12): error TS2365: Operator '<' cannot be applied to types 'A1' and 'B1'. comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(24,12): error TS2365: Operator '<' cannot be applied to types 'A2' and 'B2'. comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(26,12): error TS2365: Operator '<' cannot be applied to types 'B1' and 'A1'. @@ -32,21 +36,29 @@ comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(75,12): error TS2367: T comparisonOperatorWithNoRelationshipObjectsOnProperty.ts(76,12): error TS2367: This comparison appears to be unintentional because the types 'B2' and 'A2' have no overlap. -==== comparisonOperatorWithNoRelationshipObjectsOnProperty.ts (32 errors) ==== +==== comparisonOperatorWithNoRelationshipObjectsOnProperty.ts (36 errors) ==== class A1 { public a: number; + ~ +!!! error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. } class B1 { public a: string; + ~ +!!! error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. } class A2 { private a: string; + ~ +!!! error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. } class B2 { private a: string; + ~ +!!! error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. } declare var a1: A1; diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnProperty.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnProperty.js index ac26b3ed55767..1aab56e688730 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnProperty.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnProperty.js @@ -79,6 +79,7 @@ var r8b1 = b1 !== a1; var r8b2 = b2 !== a2; //// [comparisonOperatorWithNoRelationshipObjectsOnProperty.js] +"use strict"; class A1 { } class B1 { diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipPrimitiveType.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipPrimitiveType.js index 75660f874eb49..918d76ab86d72 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipPrimitiveType.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipPrimitiveType.js @@ -218,6 +218,7 @@ var r8e1 = e !== c; var r8e1 = e !== d; //// [comparisonOperatorWithNoRelationshipPrimitiveType.js] +"use strict"; var E; (function (E) { E[E["a"] = 0] = "a"; diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipTypeParameter.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipTypeParameter.js index eac939e01a22c..d132c91f5f46f 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipTypeParameter.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipTypeParameter.js @@ -159,6 +159,7 @@ function foo(t: T, u: U) { } //// [comparisonOperatorWithNoRelationshipTypeParameter.js] +"use strict"; var E; (function (E) { E[E["a"] = 0] = "a"; diff --git a/tests/baselines/reference/comparisonOperatorWithNumericLiteral.errors.txt b/tests/baselines/reference/comparisonOperatorWithNumericLiteral.errors.txt new file mode 100644 index 0000000000000..06380f5d9f3af --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithNumericLiteral.errors.txt @@ -0,0 +1,118 @@ +comparisonOperatorWithNumericLiteral.ts(5,1): error TS2454: Variable 'x' is used before being assigned. +comparisonOperatorWithNumericLiteral.ts(6,1): error TS2454: Variable 'x' is used before being assigned. +comparisonOperatorWithNumericLiteral.ts(7,1): error TS2454: Variable 'x' is used before being assigned. +comparisonOperatorWithNumericLiteral.ts(10,1): error TS2454: Variable 'x' is used before being assigned. +comparisonOperatorWithNumericLiteral.ts(11,1): error TS2454: Variable 'x' is used before being assigned. +comparisonOperatorWithNumericLiteral.ts(12,1): error TS2454: Variable 'x' is used before being assigned. +comparisonOperatorWithNumericLiteral.ts(15,1): error TS2454: Variable 'x' is used before being assigned. +comparisonOperatorWithNumericLiteral.ts(16,1): error TS2454: Variable 'x' is used before being assigned. +comparisonOperatorWithNumericLiteral.ts(17,1): error TS2454: Variable 'x' is used before being assigned. +comparisonOperatorWithNumericLiteral.ts(20,1): error TS2454: Variable 'x' is used before being assigned. +comparisonOperatorWithNumericLiteral.ts(21,1): error TS2454: Variable 'x' is used before being assigned. +comparisonOperatorWithNumericLiteral.ts(22,1): error TS2454: Variable 'x' is used before being assigned. +comparisonOperatorWithNumericLiteral.ts(25,1): error TS2454: Variable 'x' is used before being assigned. +comparisonOperatorWithNumericLiteral.ts(26,1): error TS2454: Variable 'x' is used before being assigned. +comparisonOperatorWithNumericLiteral.ts(27,1): error TS2454: Variable 'x' is used before being assigned. +comparisonOperatorWithNumericLiteral.ts(30,1): error TS2454: Variable 'x' is used before being assigned. +comparisonOperatorWithNumericLiteral.ts(31,1): error TS2454: Variable 'x' is used before being assigned. +comparisonOperatorWithNumericLiteral.ts(32,1): error TS2454: Variable 'x' is used before being assigned. +comparisonOperatorWithNumericLiteral.ts(35,1): error TS2454: Variable 'x' is used before being assigned. +comparisonOperatorWithNumericLiteral.ts(36,1): error TS2454: Variable 'x' is used before being assigned. +comparisonOperatorWithNumericLiteral.ts(37,1): error TS2454: Variable 'x' is used before being assigned. +comparisonOperatorWithNumericLiteral.ts(40,1): error TS2454: Variable 'x' is used before being assigned. +comparisonOperatorWithNumericLiteral.ts(41,1): error TS2454: Variable 'x' is used before being assigned. +comparisonOperatorWithNumericLiteral.ts(42,1): error TS2454: Variable 'x' is used before being assigned. + + +==== comparisonOperatorWithNumericLiteral.ts (24 errors) ==== + type BrandedNum = number & { __numberBrand: any }; + var x : BrandedNum; + + // operator > + x > 0; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + x > 0; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + x > 0; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + + // operator < + x < 0; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + x < 0; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + x < 0; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + + // operator >= + x >= 0; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + x >= 0; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + x >= 0; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + + // operator <= + x <= 0; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + x <= 0; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + x <= 0; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + + // operator == + x == 0; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + x == 0; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + x == 0; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + + // operator != + x != 0; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + x != 0; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + x != 0; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + + // operator === + x === 0; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + x === 0; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + x === 0; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + + // operator !== + x !== 0; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + x !== 0; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + x !== 0; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithNumericLiteral.js b/tests/baselines/reference/comparisonOperatorWithNumericLiteral.js index b47a4b5f4515e..b72798c85c047 100644 --- a/tests/baselines/reference/comparisonOperatorWithNumericLiteral.js +++ b/tests/baselines/reference/comparisonOperatorWithNumericLiteral.js @@ -46,6 +46,7 @@ x !== 0; //// [comparisonOperatorWithNumericLiteral.js] +"use strict"; var x; // operator > x > 0; diff --git a/tests/baselines/reference/comparisonOperatorWithNumericLiteral.types b/tests/baselines/reference/comparisonOperatorWithNumericLiteral.types index 31b953eefc711..959a3f11de745 100644 --- a/tests/baselines/reference/comparisonOperatorWithNumericLiteral.types +++ b/tests/baselines/reference/comparisonOperatorWithNumericLiteral.types @@ -5,6 +5,7 @@ type BrandedNum = number & { __numberBrand: any }; >BrandedNum : BrandedNum > : ^^^^^^^^^^ >__numberBrand : any +> : ^^^ var x : BrandedNum; >x : BrandedNum diff --git a/tests/baselines/reference/comparisonOperatorWithOneOperandIsAny.errors.txt b/tests/baselines/reference/comparisonOperatorWithOneOperandIsAny.errors.txt new file mode 100644 index 0000000000000..d1cf2e4c51ca8 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithOneOperandIsAny.errors.txt @@ -0,0 +1,458 @@ +comparisonOperatorWithOneOperandIsAny.ts(34,16): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(35,16): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(36,16): error TS2454: Variable 'c' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(38,16): error TS2454: Variable 'e' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(39,16): error TS2454: Variable 'f' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(40,16): error TS2454: Variable 'g' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(42,12): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(43,12): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(44,12): error TS2454: Variable 'c' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(46,12): error TS2454: Variable 'e' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(47,12): error TS2454: Variable 'f' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(48,12): error TS2454: Variable 'g' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(51,16): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(52,16): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(53,16): error TS2454: Variable 'c' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(55,16): error TS2454: Variable 'e' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(56,16): error TS2454: Variable 'f' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(57,16): error TS2454: Variable 'g' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(59,12): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(60,12): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(61,12): error TS2454: Variable 'c' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(63,12): error TS2454: Variable 'e' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(64,12): error TS2454: Variable 'f' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(65,12): error TS2454: Variable 'g' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(68,17): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(69,17): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(70,17): error TS2454: Variable 'c' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(72,17): error TS2454: Variable 'e' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(73,17): error TS2454: Variable 'f' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(74,17): error TS2454: Variable 'g' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(76,12): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(77,12): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(78,12): error TS2454: Variable 'c' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(80,12): error TS2454: Variable 'e' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(81,12): error TS2454: Variable 'f' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(82,12): error TS2454: Variable 'g' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(85,17): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(86,17): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(87,17): error TS2454: Variable 'c' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(89,17): error TS2454: Variable 'e' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(90,17): error TS2454: Variable 'f' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(91,17): error TS2454: Variable 'g' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(93,12): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(94,12): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(95,12): error TS2454: Variable 'c' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(97,12): error TS2454: Variable 'e' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(98,12): error TS2454: Variable 'f' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(99,12): error TS2454: Variable 'g' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(102,17): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(103,17): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(104,17): error TS2454: Variable 'c' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(106,17): error TS2454: Variable 'e' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(107,17): error TS2454: Variable 'f' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(108,17): error TS2454: Variable 'g' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(110,12): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(111,12): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(112,12): error TS2454: Variable 'c' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(114,12): error TS2454: Variable 'e' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(115,12): error TS2454: Variable 'f' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(116,12): error TS2454: Variable 'g' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(119,17): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(120,17): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(121,17): error TS2454: Variable 'c' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(123,17): error TS2454: Variable 'e' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(124,17): error TS2454: Variable 'f' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(125,17): error TS2454: Variable 'g' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(127,12): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(128,12): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(129,12): error TS2454: Variable 'c' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(131,12): error TS2454: Variable 'e' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(132,12): error TS2454: Variable 'f' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(133,12): error TS2454: Variable 'g' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(136,18): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(137,18): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(138,18): error TS2454: Variable 'c' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(140,18): error TS2454: Variable 'e' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(141,18): error TS2454: Variable 'f' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(142,18): error TS2454: Variable 'g' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(144,12): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(145,12): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(146,12): error TS2454: Variable 'c' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(148,12): error TS2454: Variable 'e' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(149,12): error TS2454: Variable 'f' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(150,12): error TS2454: Variable 'g' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(153,18): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(154,18): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(155,18): error TS2454: Variable 'c' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(157,18): error TS2454: Variable 'e' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(158,18): error TS2454: Variable 'f' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(159,18): error TS2454: Variable 'g' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(161,12): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(162,12): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(163,12): error TS2454: Variable 'c' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(165,12): error TS2454: Variable 'e' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(166,12): error TS2454: Variable 'f' is used before being assigned. +comparisonOperatorWithOneOperandIsAny.ts(167,12): error TS2454: Variable 'g' is used before being assigned. + + +==== comparisonOperatorWithOneOperandIsAny.ts (96 errors) ==== + var x: any; + + enum E { a, b, c } + + function foo(t: T) { + var foo_r1 = t < x; + var foo_r2 = t > x; + var foo_r3 = t <= x; + var foo_r4 = t >= x; + var foo_r5 = t == x; + var foo_r6 = t != x; + var foo_r7 = t === x; + var foo_r8 = t !== x; + + var foo_r1 = x < t; + var foo_r2 = x > t; + var foo_r3 = x <= t; + var foo_r4 = x >= t; + var foo_r5 = x == t; + var foo_r6 = x != t; + var foo_r7 = x === t; + var foo_r8 = x !== t; + } + + var a: boolean; + var b: number; + var c: string; + var d: void; + var e: E; + var f: {}; + var g: string[]; + + // operator < + var r1a1 = x < a; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var r1a2 = x < b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var r1a3 = x < c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var r1a4 = x < d; + var r1a5 = x < e; + ~ +!!! error TS2454: Variable 'e' is used before being assigned. + var r1a6 = x < f; + ~ +!!! error TS2454: Variable 'f' is used before being assigned. + var r1a7 = x < g; + ~ +!!! error TS2454: Variable 'g' is used before being assigned. + + var r1b1 = a < x; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var r1b2 = b < x; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var r1b3 = c < x; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var r1b4 = d < x; + var r1b5 = e < x; + ~ +!!! error TS2454: Variable 'e' is used before being assigned. + var r1b6 = f < x; + ~ +!!! error TS2454: Variable 'f' is used before being assigned. + var r1b7 = g < x; + ~ +!!! error TS2454: Variable 'g' is used before being assigned. + + // operator > + var r2a1 = x > a; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var r2a2 = x > b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var r2a3 = x > c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var r2a4 = x > d; + var r2a5 = x > e; + ~ +!!! error TS2454: Variable 'e' is used before being assigned. + var r2a6 = x > f; + ~ +!!! error TS2454: Variable 'f' is used before being assigned. + var r2a7 = x > g; + ~ +!!! error TS2454: Variable 'g' is used before being assigned. + + var r2b1 = a > x; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var r2b2 = b > x; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var r2b3 = c > x; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var r2b4 = d > x; + var r2b5 = e > x; + ~ +!!! error TS2454: Variable 'e' is used before being assigned. + var r2b6 = f > x; + ~ +!!! error TS2454: Variable 'f' is used before being assigned. + var r2b7 = g > x; + ~ +!!! error TS2454: Variable 'g' is used before being assigned. + + // operator <= + var r3a1 = x <= a; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var r3a2 = x <= b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var r3a3 = x <= c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var r3a4 = x <= d; + var r3a5 = x <= e; + ~ +!!! error TS2454: Variable 'e' is used before being assigned. + var r3a6 = x <= f; + ~ +!!! error TS2454: Variable 'f' is used before being assigned. + var r3a7 = x <= g; + ~ +!!! error TS2454: Variable 'g' is used before being assigned. + + var r3b1 = a <= x; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var r3b2 = b <= x; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var r3b3 = c <= x; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var r3b4 = d <= x; + var r3b5 = e <= x; + ~ +!!! error TS2454: Variable 'e' is used before being assigned. + var r3b6 = f <= x; + ~ +!!! error TS2454: Variable 'f' is used before being assigned. + var r3b7 = g <= x; + ~ +!!! error TS2454: Variable 'g' is used before being assigned. + + // operator >= + var r4a1 = x >= a; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var r4a2 = x >= b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var r4a3 = x >= c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var r4a4 = x >= d; + var r4a5 = x >= e; + ~ +!!! error TS2454: Variable 'e' is used before being assigned. + var r4a6 = x >= f; + ~ +!!! error TS2454: Variable 'f' is used before being assigned. + var r4a7 = x >= g; + ~ +!!! error TS2454: Variable 'g' is used before being assigned. + + var r4b1 = a >= x; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var r4b2 = b >= x; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var r4b3 = c >= x; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var r4b4 = d >= x; + var r4b5 = e >= x; + ~ +!!! error TS2454: Variable 'e' is used before being assigned. + var r4b6 = f >= x; + ~ +!!! error TS2454: Variable 'f' is used before being assigned. + var r4b7 = g >= x; + ~ +!!! error TS2454: Variable 'g' is used before being assigned. + + // operator == + var r5a1 = x == a; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var r5a2 = x == b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var r5a3 = x == c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var r5a4 = x == d; + var r5a5 = x == e; + ~ +!!! error TS2454: Variable 'e' is used before being assigned. + var r5a6 = x == f; + ~ +!!! error TS2454: Variable 'f' is used before being assigned. + var r5a7 = x == g; + ~ +!!! error TS2454: Variable 'g' is used before being assigned. + + var r5b1 = a == x; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var r5b2 = b == x; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var r5b3 = c == x; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var r5b4 = d == x; + var r5b5 = e == x; + ~ +!!! error TS2454: Variable 'e' is used before being assigned. + var r5b6 = f == x; + ~ +!!! error TS2454: Variable 'f' is used before being assigned. + var r5b7 = g == x; + ~ +!!! error TS2454: Variable 'g' is used before being assigned. + + // operator != + var r6a1 = x != a; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var r6a2 = x != b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var r6a3 = x != c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var r6a4 = x != d; + var r6a5 = x != e; + ~ +!!! error TS2454: Variable 'e' is used before being assigned. + var r6a6 = x != f; + ~ +!!! error TS2454: Variable 'f' is used before being assigned. + var r6a7 = x != g; + ~ +!!! error TS2454: Variable 'g' is used before being assigned. + + var r6b1 = a != x; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var r6b2 = b != x; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var r6b3 = c != x; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var r6b4 = d != x; + var r6b5 = e != x; + ~ +!!! error TS2454: Variable 'e' is used before being assigned. + var r6b6 = f != x; + ~ +!!! error TS2454: Variable 'f' is used before being assigned. + var r6b7 = g != x; + ~ +!!! error TS2454: Variable 'g' is used before being assigned. + + // operator === + var r7a1 = x === a; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var r7a2 = x === b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var r7a3 = x === c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var r7a4 = x === d; + var r7a5 = x === e; + ~ +!!! error TS2454: Variable 'e' is used before being assigned. + var r7a6 = x === f; + ~ +!!! error TS2454: Variable 'f' is used before being assigned. + var r7a7 = x === g; + ~ +!!! error TS2454: Variable 'g' is used before being assigned. + + var r7b1 = a === x; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var r7b2 = b === x; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var r7b3 = c === x; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var r7b4 = d === x; + var r7b5 = e === x; + ~ +!!! error TS2454: Variable 'e' is used before being assigned. + var r7b6 = f === x; + ~ +!!! error TS2454: Variable 'f' is used before being assigned. + var r7b7 = g === x; + ~ +!!! error TS2454: Variable 'g' is used before being assigned. + + // operator !== + var r8a1 = x !== a; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var r8a2 = x !== b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var r8a3 = x !== c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var r8a4 = x !== d; + var r8a5 = x !== e; + ~ +!!! error TS2454: Variable 'e' is used before being assigned. + var r8a6 = x !== f; + ~ +!!! error TS2454: Variable 'f' is used before being assigned. + var r8a7 = x !== g; + ~ +!!! error TS2454: Variable 'g' is used before being assigned. + + var r8b1 = a !== x; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var r8b2 = b !== x; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var r8b3 = c !== x; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var r8b4 = d !== x; + var r8b5 = e !== x; + ~ +!!! error TS2454: Variable 'e' is used before being assigned. + var r8b6 = f !== x; + ~ +!!! error TS2454: Variable 'f' is used before being assigned. + var r8b7 = g !== x; + ~ +!!! error TS2454: Variable 'g' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithOneOperandIsAny.js b/tests/baselines/reference/comparisonOperatorWithOneOperandIsAny.js index e5068b480ae08..ae6ca5c6e2397 100644 --- a/tests/baselines/reference/comparisonOperatorWithOneOperandIsAny.js +++ b/tests/baselines/reference/comparisonOperatorWithOneOperandIsAny.js @@ -170,6 +170,7 @@ var r8b6 = f !== x; var r8b7 = g !== x; //// [comparisonOperatorWithOneOperandIsAny.js] +"use strict"; var x; var E; (function (E) { diff --git a/tests/baselines/reference/comparisonOperatorWithOneOperandIsAny.types b/tests/baselines/reference/comparisonOperatorWithOneOperandIsAny.types index 2410b01852ade..65258c0098c4d 100644 --- a/tests/baselines/reference/comparisonOperatorWithOneOperandIsAny.types +++ b/tests/baselines/reference/comparisonOperatorWithOneOperandIsAny.types @@ -3,6 +3,7 @@ === comparisonOperatorWithOneOperandIsAny.ts === var x: any; >x : any +> : ^^^ enum E { a, b, c } >E : E @@ -28,6 +29,7 @@ function foo(t: T) { >t : T > : ^ >x : any +> : ^^^ var foo_r2 = t > x; >foo_r2 : boolean @@ -37,6 +39,7 @@ function foo(t: T) { >t : T > : ^ >x : any +> : ^^^ var foo_r3 = t <= x; >foo_r3 : boolean @@ -46,6 +49,7 @@ function foo(t: T) { >t : T > : ^ >x : any +> : ^^^ var foo_r4 = t >= x; >foo_r4 : boolean @@ -55,6 +59,7 @@ function foo(t: T) { >t : T > : ^ >x : any +> : ^^^ var foo_r5 = t == x; >foo_r5 : boolean @@ -64,6 +69,7 @@ function foo(t: T) { >t : T > : ^ >x : any +> : ^^^ var foo_r6 = t != x; >foo_r6 : boolean @@ -73,6 +79,7 @@ function foo(t: T) { >t : T > : ^ >x : any +> : ^^^ var foo_r7 = t === x; >foo_r7 : boolean @@ -82,6 +89,7 @@ function foo(t: T) { >t : T > : ^ >x : any +> : ^^^ var foo_r8 = t !== x; >foo_r8 : boolean @@ -91,6 +99,7 @@ function foo(t: T) { >t : T > : ^ >x : any +> : ^^^ var foo_r1 = x < t; >foo_r1 : boolean @@ -98,6 +107,7 @@ function foo(t: T) { >x < t : boolean > : ^^^^^^^ >x : any +> : ^^^ >t : T > : ^ @@ -107,6 +117,7 @@ function foo(t: T) { >x > t : boolean > : ^^^^^^^ >x : any +> : ^^^ >t : T > : ^ @@ -116,6 +127,7 @@ function foo(t: T) { >x <= t : boolean > : ^^^^^^^ >x : any +> : ^^^ >t : T > : ^ @@ -125,6 +137,7 @@ function foo(t: T) { >x >= t : boolean > : ^^^^^^^ >x : any +> : ^^^ >t : T > : ^ @@ -134,6 +147,7 @@ function foo(t: T) { >x == t : boolean > : ^^^^^^^ >x : any +> : ^^^ >t : T > : ^ @@ -143,6 +157,7 @@ function foo(t: T) { >x != t : boolean > : ^^^^^^^ >x : any +> : ^^^ >t : T > : ^ @@ -152,6 +167,7 @@ function foo(t: T) { >x === t : boolean > : ^^^^^^^ >x : any +> : ^^^ >t : T > : ^ @@ -161,6 +177,7 @@ function foo(t: T) { >x !== t : boolean > : ^^^^^^^ >x : any +> : ^^^ >t : T > : ^ } @@ -200,6 +217,7 @@ var r1a1 = x < a; >x < a : boolean > : ^^^^^^^ >x : any +> : ^^^ >a : boolean > : ^^^^^^^ @@ -209,6 +227,7 @@ var r1a2 = x < b; >x < b : boolean > : ^^^^^^^ >x : any +> : ^^^ >b : number > : ^^^^^^ @@ -218,6 +237,7 @@ var r1a3 = x < c; >x < c : boolean > : ^^^^^^^ >x : any +> : ^^^ >c : string > : ^^^^^^ @@ -227,6 +247,7 @@ var r1a4 = x < d; >x < d : boolean > : ^^^^^^^ >x : any +> : ^^^ >d : void > : ^^^^ @@ -236,6 +257,7 @@ var r1a5 = x < e; >x < e : boolean > : ^^^^^^^ >x : any +> : ^^^ >e : E > : ^ @@ -245,6 +267,7 @@ var r1a6 = x < f; >x < f : boolean > : ^^^^^^^ >x : any +> : ^^^ >f : {} > : ^^ @@ -254,6 +277,7 @@ var r1a7 = x < g; >x < g : boolean > : ^^^^^^^ >x : any +> : ^^^ >g : string[] > : ^^^^^^^^ @@ -265,6 +289,7 @@ var r1b1 = a < x; >a : boolean > : ^^^^^^^ >x : any +> : ^^^ var r1b2 = b < x; >r1b2 : boolean @@ -274,6 +299,7 @@ var r1b2 = b < x; >b : number > : ^^^^^^ >x : any +> : ^^^ var r1b3 = c < x; >r1b3 : boolean @@ -283,6 +309,7 @@ var r1b3 = c < x; >c : string > : ^^^^^^ >x : any +> : ^^^ var r1b4 = d < x; >r1b4 : boolean @@ -292,6 +319,7 @@ var r1b4 = d < x; >d : void > : ^^^^ >x : any +> : ^^^ var r1b5 = e < x; >r1b5 : boolean @@ -301,6 +329,7 @@ var r1b5 = e < x; >e : E > : ^ >x : any +> : ^^^ var r1b6 = f < x; >r1b6 : boolean @@ -310,6 +339,7 @@ var r1b6 = f < x; >f : {} > : ^^ >x : any +> : ^^^ var r1b7 = g < x; >r1b7 : boolean @@ -319,6 +349,7 @@ var r1b7 = g < x; >g : string[] > : ^^^^^^^^ >x : any +> : ^^^ // operator > var r2a1 = x > a; @@ -327,6 +358,7 @@ var r2a1 = x > a; >x > a : boolean > : ^^^^^^^ >x : any +> : ^^^ >a : boolean > : ^^^^^^^ @@ -336,6 +368,7 @@ var r2a2 = x > b; >x > b : boolean > : ^^^^^^^ >x : any +> : ^^^ >b : number > : ^^^^^^ @@ -345,6 +378,7 @@ var r2a3 = x > c; >x > c : boolean > : ^^^^^^^ >x : any +> : ^^^ >c : string > : ^^^^^^ @@ -354,6 +388,7 @@ var r2a4 = x > d; >x > d : boolean > : ^^^^^^^ >x : any +> : ^^^ >d : void > : ^^^^ @@ -363,6 +398,7 @@ var r2a5 = x > e; >x > e : boolean > : ^^^^^^^ >x : any +> : ^^^ >e : E > : ^ @@ -372,6 +408,7 @@ var r2a6 = x > f; >x > f : boolean > : ^^^^^^^ >x : any +> : ^^^ >f : {} > : ^^ @@ -381,6 +418,7 @@ var r2a7 = x > g; >x > g : boolean > : ^^^^^^^ >x : any +> : ^^^ >g : string[] > : ^^^^^^^^ @@ -392,6 +430,7 @@ var r2b1 = a > x; >a : boolean > : ^^^^^^^ >x : any +> : ^^^ var r2b2 = b > x; >r2b2 : boolean @@ -401,6 +440,7 @@ var r2b2 = b > x; >b : number > : ^^^^^^ >x : any +> : ^^^ var r2b3 = c > x; >r2b3 : boolean @@ -410,6 +450,7 @@ var r2b3 = c > x; >c : string > : ^^^^^^ >x : any +> : ^^^ var r2b4 = d > x; >r2b4 : boolean @@ -419,6 +460,7 @@ var r2b4 = d > x; >d : void > : ^^^^ >x : any +> : ^^^ var r2b5 = e > x; >r2b5 : boolean @@ -428,6 +470,7 @@ var r2b5 = e > x; >e : E > : ^ >x : any +> : ^^^ var r2b6 = f > x; >r2b6 : boolean @@ -437,6 +480,7 @@ var r2b6 = f > x; >f : {} > : ^^ >x : any +> : ^^^ var r2b7 = g > x; >r2b7 : boolean @@ -446,6 +490,7 @@ var r2b7 = g > x; >g : string[] > : ^^^^^^^^ >x : any +> : ^^^ // operator <= var r3a1 = x <= a; @@ -454,6 +499,7 @@ var r3a1 = x <= a; >x <= a : boolean > : ^^^^^^^ >x : any +> : ^^^ >a : boolean > : ^^^^^^^ @@ -463,6 +509,7 @@ var r3a2 = x <= b; >x <= b : boolean > : ^^^^^^^ >x : any +> : ^^^ >b : number > : ^^^^^^ @@ -472,6 +519,7 @@ var r3a3 = x <= c; >x <= c : boolean > : ^^^^^^^ >x : any +> : ^^^ >c : string > : ^^^^^^ @@ -481,6 +529,7 @@ var r3a4 = x <= d; >x <= d : boolean > : ^^^^^^^ >x : any +> : ^^^ >d : void > : ^^^^ @@ -490,6 +539,7 @@ var r3a5 = x <= e; >x <= e : boolean > : ^^^^^^^ >x : any +> : ^^^ >e : E > : ^ @@ -499,6 +549,7 @@ var r3a6 = x <= f; >x <= f : boolean > : ^^^^^^^ >x : any +> : ^^^ >f : {} > : ^^ @@ -508,6 +559,7 @@ var r3a7 = x <= g; >x <= g : boolean > : ^^^^^^^ >x : any +> : ^^^ >g : string[] > : ^^^^^^^^ @@ -519,6 +571,7 @@ var r3b1 = a <= x; >a : boolean > : ^^^^^^^ >x : any +> : ^^^ var r3b2 = b <= x; >r3b2 : boolean @@ -528,6 +581,7 @@ var r3b2 = b <= x; >b : number > : ^^^^^^ >x : any +> : ^^^ var r3b3 = c <= x; >r3b3 : boolean @@ -537,6 +591,7 @@ var r3b3 = c <= x; >c : string > : ^^^^^^ >x : any +> : ^^^ var r3b4 = d <= x; >r3b4 : boolean @@ -546,6 +601,7 @@ var r3b4 = d <= x; >d : void > : ^^^^ >x : any +> : ^^^ var r3b5 = e <= x; >r3b5 : boolean @@ -555,6 +611,7 @@ var r3b5 = e <= x; >e : E > : ^ >x : any +> : ^^^ var r3b6 = f <= x; >r3b6 : boolean @@ -564,6 +621,7 @@ var r3b6 = f <= x; >f : {} > : ^^ >x : any +> : ^^^ var r3b7 = g <= x; >r3b7 : boolean @@ -573,6 +631,7 @@ var r3b7 = g <= x; >g : string[] > : ^^^^^^^^ >x : any +> : ^^^ // operator >= var r4a1 = x >= a; @@ -581,6 +640,7 @@ var r4a1 = x >= a; >x >= a : boolean > : ^^^^^^^ >x : any +> : ^^^ >a : boolean > : ^^^^^^^ @@ -590,6 +650,7 @@ var r4a2 = x >= b; >x >= b : boolean > : ^^^^^^^ >x : any +> : ^^^ >b : number > : ^^^^^^ @@ -599,6 +660,7 @@ var r4a3 = x >= c; >x >= c : boolean > : ^^^^^^^ >x : any +> : ^^^ >c : string > : ^^^^^^ @@ -608,6 +670,7 @@ var r4a4 = x >= d; >x >= d : boolean > : ^^^^^^^ >x : any +> : ^^^ >d : void > : ^^^^ @@ -617,6 +680,7 @@ var r4a5 = x >= e; >x >= e : boolean > : ^^^^^^^ >x : any +> : ^^^ >e : E > : ^ @@ -626,6 +690,7 @@ var r4a6 = x >= f; >x >= f : boolean > : ^^^^^^^ >x : any +> : ^^^ >f : {} > : ^^ @@ -635,6 +700,7 @@ var r4a7 = x >= g; >x >= g : boolean > : ^^^^^^^ >x : any +> : ^^^ >g : string[] > : ^^^^^^^^ @@ -646,6 +712,7 @@ var r4b1 = a >= x; >a : boolean > : ^^^^^^^ >x : any +> : ^^^ var r4b2 = b >= x; >r4b2 : boolean @@ -655,6 +722,7 @@ var r4b2 = b >= x; >b : number > : ^^^^^^ >x : any +> : ^^^ var r4b3 = c >= x; >r4b3 : boolean @@ -664,6 +732,7 @@ var r4b3 = c >= x; >c : string > : ^^^^^^ >x : any +> : ^^^ var r4b4 = d >= x; >r4b4 : boolean @@ -673,6 +742,7 @@ var r4b4 = d >= x; >d : void > : ^^^^ >x : any +> : ^^^ var r4b5 = e >= x; >r4b5 : boolean @@ -682,6 +752,7 @@ var r4b5 = e >= x; >e : E > : ^ >x : any +> : ^^^ var r4b6 = f >= x; >r4b6 : boolean @@ -691,6 +762,7 @@ var r4b6 = f >= x; >f : {} > : ^^ >x : any +> : ^^^ var r4b7 = g >= x; >r4b7 : boolean @@ -700,6 +772,7 @@ var r4b7 = g >= x; >g : string[] > : ^^^^^^^^ >x : any +> : ^^^ // operator == var r5a1 = x == a; @@ -708,6 +781,7 @@ var r5a1 = x == a; >x == a : boolean > : ^^^^^^^ >x : any +> : ^^^ >a : boolean > : ^^^^^^^ @@ -717,6 +791,7 @@ var r5a2 = x == b; >x == b : boolean > : ^^^^^^^ >x : any +> : ^^^ >b : number > : ^^^^^^ @@ -726,6 +801,7 @@ var r5a3 = x == c; >x == c : boolean > : ^^^^^^^ >x : any +> : ^^^ >c : string > : ^^^^^^ @@ -735,6 +811,7 @@ var r5a4 = x == d; >x == d : boolean > : ^^^^^^^ >x : any +> : ^^^ >d : void > : ^^^^ @@ -744,6 +821,7 @@ var r5a5 = x == e; >x == e : boolean > : ^^^^^^^ >x : any +> : ^^^ >e : E > : ^ @@ -753,6 +831,7 @@ var r5a6 = x == f; >x == f : boolean > : ^^^^^^^ >x : any +> : ^^^ >f : {} > : ^^ @@ -762,6 +841,7 @@ var r5a7 = x == g; >x == g : boolean > : ^^^^^^^ >x : any +> : ^^^ >g : string[] > : ^^^^^^^^ @@ -773,6 +853,7 @@ var r5b1 = a == x; >a : boolean > : ^^^^^^^ >x : any +> : ^^^ var r5b2 = b == x; >r5b2 : boolean @@ -782,6 +863,7 @@ var r5b2 = b == x; >b : number > : ^^^^^^ >x : any +> : ^^^ var r5b3 = c == x; >r5b3 : boolean @@ -791,6 +873,7 @@ var r5b3 = c == x; >c : string > : ^^^^^^ >x : any +> : ^^^ var r5b4 = d == x; >r5b4 : boolean @@ -800,6 +883,7 @@ var r5b4 = d == x; >d : void > : ^^^^ >x : any +> : ^^^ var r5b5 = e == x; >r5b5 : boolean @@ -809,6 +893,7 @@ var r5b5 = e == x; >e : E > : ^ >x : any +> : ^^^ var r5b6 = f == x; >r5b6 : boolean @@ -818,6 +903,7 @@ var r5b6 = f == x; >f : {} > : ^^ >x : any +> : ^^^ var r5b7 = g == x; >r5b7 : boolean @@ -827,6 +913,7 @@ var r5b7 = g == x; >g : string[] > : ^^^^^^^^ >x : any +> : ^^^ // operator != var r6a1 = x != a; @@ -835,6 +922,7 @@ var r6a1 = x != a; >x != a : boolean > : ^^^^^^^ >x : any +> : ^^^ >a : boolean > : ^^^^^^^ @@ -844,6 +932,7 @@ var r6a2 = x != b; >x != b : boolean > : ^^^^^^^ >x : any +> : ^^^ >b : number > : ^^^^^^ @@ -853,6 +942,7 @@ var r6a3 = x != c; >x != c : boolean > : ^^^^^^^ >x : any +> : ^^^ >c : string > : ^^^^^^ @@ -862,6 +952,7 @@ var r6a4 = x != d; >x != d : boolean > : ^^^^^^^ >x : any +> : ^^^ >d : void > : ^^^^ @@ -871,6 +962,7 @@ var r6a5 = x != e; >x != e : boolean > : ^^^^^^^ >x : any +> : ^^^ >e : E > : ^ @@ -880,6 +972,7 @@ var r6a6 = x != f; >x != f : boolean > : ^^^^^^^ >x : any +> : ^^^ >f : {} > : ^^ @@ -889,6 +982,7 @@ var r6a7 = x != g; >x != g : boolean > : ^^^^^^^ >x : any +> : ^^^ >g : string[] > : ^^^^^^^^ @@ -900,6 +994,7 @@ var r6b1 = a != x; >a : boolean > : ^^^^^^^ >x : any +> : ^^^ var r6b2 = b != x; >r6b2 : boolean @@ -909,6 +1004,7 @@ var r6b2 = b != x; >b : number > : ^^^^^^ >x : any +> : ^^^ var r6b3 = c != x; >r6b3 : boolean @@ -918,6 +1014,7 @@ var r6b3 = c != x; >c : string > : ^^^^^^ >x : any +> : ^^^ var r6b4 = d != x; >r6b4 : boolean @@ -927,6 +1024,7 @@ var r6b4 = d != x; >d : void > : ^^^^ >x : any +> : ^^^ var r6b5 = e != x; >r6b5 : boolean @@ -936,6 +1034,7 @@ var r6b5 = e != x; >e : E > : ^ >x : any +> : ^^^ var r6b6 = f != x; >r6b6 : boolean @@ -945,6 +1044,7 @@ var r6b6 = f != x; >f : {} > : ^^ >x : any +> : ^^^ var r6b7 = g != x; >r6b7 : boolean @@ -954,6 +1054,7 @@ var r6b7 = g != x; >g : string[] > : ^^^^^^^^ >x : any +> : ^^^ // operator === var r7a1 = x === a; @@ -962,6 +1063,7 @@ var r7a1 = x === a; >x === a : boolean > : ^^^^^^^ >x : any +> : ^^^ >a : boolean > : ^^^^^^^ @@ -971,6 +1073,7 @@ var r7a2 = x === b; >x === b : boolean > : ^^^^^^^ >x : any +> : ^^^ >b : number > : ^^^^^^ @@ -980,6 +1083,7 @@ var r7a3 = x === c; >x === c : boolean > : ^^^^^^^ >x : any +> : ^^^ >c : string > : ^^^^^^ @@ -989,6 +1093,7 @@ var r7a4 = x === d; >x === d : boolean > : ^^^^^^^ >x : any +> : ^^^ >d : void > : ^^^^ @@ -998,6 +1103,7 @@ var r7a5 = x === e; >x === e : boolean > : ^^^^^^^ >x : any +> : ^^^ >e : E > : ^ @@ -1007,6 +1113,7 @@ var r7a6 = x === f; >x === f : boolean > : ^^^^^^^ >x : any +> : ^^^ >f : {} > : ^^ @@ -1016,6 +1123,7 @@ var r7a7 = x === g; >x === g : boolean > : ^^^^^^^ >x : any +> : ^^^ >g : string[] > : ^^^^^^^^ @@ -1027,6 +1135,7 @@ var r7b1 = a === x; >a : boolean > : ^^^^^^^ >x : any +> : ^^^ var r7b2 = b === x; >r7b2 : boolean @@ -1036,6 +1145,7 @@ var r7b2 = b === x; >b : number > : ^^^^^^ >x : any +> : ^^^ var r7b3 = c === x; >r7b3 : boolean @@ -1045,6 +1155,7 @@ var r7b3 = c === x; >c : string > : ^^^^^^ >x : any +> : ^^^ var r7b4 = d === x; >r7b4 : boolean @@ -1054,6 +1165,7 @@ var r7b4 = d === x; >d : void > : ^^^^ >x : any +> : ^^^ var r7b5 = e === x; >r7b5 : boolean @@ -1063,6 +1175,7 @@ var r7b5 = e === x; >e : E > : ^ >x : any +> : ^^^ var r7b6 = f === x; >r7b6 : boolean @@ -1072,6 +1185,7 @@ var r7b6 = f === x; >f : {} > : ^^ >x : any +> : ^^^ var r7b7 = g === x; >r7b7 : boolean @@ -1081,6 +1195,7 @@ var r7b7 = g === x; >g : string[] > : ^^^^^^^^ >x : any +> : ^^^ // operator !== var r8a1 = x !== a; @@ -1089,6 +1204,7 @@ var r8a1 = x !== a; >x !== a : boolean > : ^^^^^^^ >x : any +> : ^^^ >a : boolean > : ^^^^^^^ @@ -1098,6 +1214,7 @@ var r8a2 = x !== b; >x !== b : boolean > : ^^^^^^^ >x : any +> : ^^^ >b : number > : ^^^^^^ @@ -1107,6 +1224,7 @@ var r8a3 = x !== c; >x !== c : boolean > : ^^^^^^^ >x : any +> : ^^^ >c : string > : ^^^^^^ @@ -1116,6 +1234,7 @@ var r8a4 = x !== d; >x !== d : boolean > : ^^^^^^^ >x : any +> : ^^^ >d : void > : ^^^^ @@ -1125,6 +1244,7 @@ var r8a5 = x !== e; >x !== e : boolean > : ^^^^^^^ >x : any +> : ^^^ >e : E > : ^ @@ -1134,6 +1254,7 @@ var r8a6 = x !== f; >x !== f : boolean > : ^^^^^^^ >x : any +> : ^^^ >f : {} > : ^^ @@ -1143,6 +1264,7 @@ var r8a7 = x !== g; >x !== g : boolean > : ^^^^^^^ >x : any +> : ^^^ >g : string[] > : ^^^^^^^^ @@ -1154,6 +1276,7 @@ var r8b1 = a !== x; >a : boolean > : ^^^^^^^ >x : any +> : ^^^ var r8b2 = b !== x; >r8b2 : boolean @@ -1163,6 +1286,7 @@ var r8b2 = b !== x; >b : number > : ^^^^^^ >x : any +> : ^^^ var r8b3 = c !== x; >r8b3 : boolean @@ -1172,6 +1296,7 @@ var r8b3 = c !== x; >c : string > : ^^^^^^ >x : any +> : ^^^ var r8b4 = d !== x; >r8b4 : boolean @@ -1181,6 +1306,7 @@ var r8b4 = d !== x; >d : void > : ^^^^ >x : any +> : ^^^ var r8b5 = e !== x; >r8b5 : boolean @@ -1190,6 +1316,7 @@ var r8b5 = e !== x; >e : E > : ^ >x : any +> : ^^^ var r8b6 = f !== x; >r8b6 : boolean @@ -1199,6 +1326,7 @@ var r8b6 = f !== x; >f : {} > : ^^ >x : any +> : ^^^ var r8b7 = g !== x; >r8b7 : boolean @@ -1208,4 +1336,5 @@ var r8b7 = g !== x; >g : string[] > : ^^^^^^^^ >x : any +> : ^^^ diff --git a/tests/baselines/reference/comparisonOperatorWithOneOperandIsNull.js b/tests/baselines/reference/comparisonOperatorWithOneOperandIsNull.js index 7ca172c4cd1eb..13cd3a155aeae 100644 --- a/tests/baselines/reference/comparisonOperatorWithOneOperandIsNull.js +++ b/tests/baselines/reference/comparisonOperatorWithOneOperandIsNull.js @@ -168,6 +168,7 @@ var r8b6 = f !== null; var r8b7 = g !== null; //// [comparisonOperatorWithOneOperandIsNull.js] +"use strict"; var E; (function (E) { E[E["a"] = 0] = "a"; diff --git a/tests/baselines/reference/comparisonOperatorWithOneOperandIsUndefined.errors.txt b/tests/baselines/reference/comparisonOperatorWithOneOperandIsUndefined.errors.txt new file mode 100644 index 0000000000000..22656f9340124 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithOneOperandIsUndefined.errors.txt @@ -0,0 +1,650 @@ +comparisonOperatorWithOneOperandIsUndefined.ts(6,22): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(7,22): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(8,23): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(9,23): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(15,18): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(16,18): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(17,18): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(18,18): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(34,12): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(34,16): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(35,12): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(35,16): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(36,12): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(36,16): error TS2454: Variable 'c' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(37,12): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(38,12): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(38,16): error TS2454: Variable 'e' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(39,12): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(39,16): error TS2454: Variable 'f' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(40,12): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(40,16): error TS2454: Variable 'g' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(42,12): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(42,16): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(43,12): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(43,16): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(44,12): error TS2454: Variable 'c' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(44,16): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(45,16): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(46,12): error TS2454: Variable 'e' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(46,16): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(47,12): error TS2454: Variable 'f' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(47,16): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(48,12): error TS2454: Variable 'g' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(48,16): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(51,12): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(51,16): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(52,12): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(52,16): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(53,12): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(53,16): error TS2454: Variable 'c' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(54,12): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(55,12): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(55,16): error TS2454: Variable 'e' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(56,12): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(56,16): error TS2454: Variable 'f' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(57,12): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(57,16): error TS2454: Variable 'g' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(59,12): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(59,16): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(60,12): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(60,16): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(61,12): error TS2454: Variable 'c' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(61,16): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(62,16): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(63,12): error TS2454: Variable 'e' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(63,16): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(64,12): error TS2454: Variable 'f' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(64,16): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(65,12): error TS2454: Variable 'g' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(65,16): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(68,12): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(68,17): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(69,12): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(69,17): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(70,12): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(70,17): error TS2454: Variable 'c' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(71,12): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(72,12): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(72,17): error TS2454: Variable 'e' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(73,12): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(73,17): error TS2454: Variable 'f' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(74,12): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(74,17): error TS2454: Variable 'g' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(76,12): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(76,17): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(77,12): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(77,17): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(78,12): error TS2454: Variable 'c' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(78,17): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(79,17): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(80,12): error TS2454: Variable 'e' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(80,17): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(81,12): error TS2454: Variable 'f' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(81,17): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(82,12): error TS2454: Variable 'g' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(82,17): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(85,12): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(85,17): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(86,12): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(86,17): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(87,12): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(87,17): error TS2454: Variable 'c' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(88,12): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(89,12): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(89,17): error TS2454: Variable 'e' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(90,12): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(90,17): error TS2454: Variable 'f' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(91,12): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(91,17): error TS2454: Variable 'g' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(93,12): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(93,17): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(94,12): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(94,17): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(95,12): error TS2454: Variable 'c' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(95,17): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(96,17): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(97,12): error TS2454: Variable 'e' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(97,17): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(98,12): error TS2454: Variable 'f' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(98,17): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(99,12): error TS2454: Variable 'g' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(99,17): error TS18048: 'x' is possibly 'undefined'. +comparisonOperatorWithOneOperandIsUndefined.ts(102,17): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(103,17): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(104,17): error TS2454: Variable 'c' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(106,17): error TS2454: Variable 'e' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(107,17): error TS2454: Variable 'f' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(108,17): error TS2454: Variable 'g' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(110,12): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(111,12): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(112,12): error TS2454: Variable 'c' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(114,12): error TS2454: Variable 'e' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(115,12): error TS2454: Variable 'f' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(116,12): error TS2454: Variable 'g' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(119,17): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(120,17): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(121,17): error TS2454: Variable 'c' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(123,17): error TS2454: Variable 'e' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(124,17): error TS2454: Variable 'f' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(125,17): error TS2454: Variable 'g' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(127,12): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(128,12): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(129,12): error TS2454: Variable 'c' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(131,12): error TS2454: Variable 'e' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(132,12): error TS2454: Variable 'f' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(133,12): error TS2454: Variable 'g' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(136,18): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(137,18): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(138,18): error TS2454: Variable 'c' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(140,18): error TS2454: Variable 'e' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(141,18): error TS2454: Variable 'f' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(142,18): error TS2454: Variable 'g' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(144,12): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(145,12): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(146,12): error TS2454: Variable 'c' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(148,12): error TS2454: Variable 'e' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(149,12): error TS2454: Variable 'f' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(150,12): error TS2454: Variable 'g' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(153,18): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(154,18): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(155,18): error TS2454: Variable 'c' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(157,18): error TS2454: Variable 'e' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(158,18): error TS2454: Variable 'f' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(159,18): error TS2454: Variable 'g' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(161,12): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(162,12): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(163,12): error TS2454: Variable 'c' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(165,12): error TS2454: Variable 'e' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(166,12): error TS2454: Variable 'f' is used before being assigned. +comparisonOperatorWithOneOperandIsUndefined.ts(167,12): error TS2454: Variable 'g' is used before being assigned. + + +==== comparisonOperatorWithOneOperandIsUndefined.ts (160 errors) ==== + var x: typeof undefined; + + enum E { a, b, c } + + function foo(t: T) { + var foo_r1 = t < x; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var foo_r2 = t > x; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var foo_r3 = t <= x; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var foo_r4 = t >= x; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var foo_r5 = t == x; + var foo_r6 = t != x; + var foo_r7 = t === x; + var foo_r8 = t !== x; + + var foo_r1 = x < t; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var foo_r2 = x > t; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var foo_r3 = x <= t; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var foo_r4 = x >= t; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var foo_r5 = x == t; + var foo_r6 = x != t; + var foo_r7 = x === t; + var foo_r8 = x !== t; + } + + var a: boolean; + var b: number; + var c: string; + var d: void; + var e: E; + var f: {}; + var g: string[]; + + // operator < + var r1a1 = x < a; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var r1a2 = x < b; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var r1a3 = x < c; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var r1a4 = x < d; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var r1a5 = x < e; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + ~ +!!! error TS2454: Variable 'e' is used before being assigned. + var r1a6 = x < f; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + ~ +!!! error TS2454: Variable 'f' is used before being assigned. + var r1a7 = x < g; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + ~ +!!! error TS2454: Variable 'g' is used before being assigned. + + var r1b1 = a < x; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var r1b2 = b < x; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var r1b3 = c < x; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var r1b4 = d < x; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var r1b5 = e < x; + ~ +!!! error TS2454: Variable 'e' is used before being assigned. + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var r1b6 = f < x; + ~ +!!! error TS2454: Variable 'f' is used before being assigned. + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var r1b7 = g < x; + ~ +!!! error TS2454: Variable 'g' is used before being assigned. + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + + // operator > + var r2a1 = x > a; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var r2a2 = x > b; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var r2a3 = x > c; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var r2a4 = x > d; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var r2a5 = x > e; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + ~ +!!! error TS2454: Variable 'e' is used before being assigned. + var r2a6 = x > f; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + ~ +!!! error TS2454: Variable 'f' is used before being assigned. + var r2a7 = x > g; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + ~ +!!! error TS2454: Variable 'g' is used before being assigned. + + var r2b1 = a > x; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var r2b2 = b > x; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var r2b3 = c > x; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var r2b4 = d > x; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var r2b5 = e > x; + ~ +!!! error TS2454: Variable 'e' is used before being assigned. + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var r2b6 = f > x; + ~ +!!! error TS2454: Variable 'f' is used before being assigned. + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var r2b7 = g > x; + ~ +!!! error TS2454: Variable 'g' is used before being assigned. + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + + // operator <= + var r3a1 = x <= a; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var r3a2 = x <= b; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var r3a3 = x <= c; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var r3a4 = x <= d; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var r3a5 = x <= e; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + ~ +!!! error TS2454: Variable 'e' is used before being assigned. + var r3a6 = x <= f; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + ~ +!!! error TS2454: Variable 'f' is used before being assigned. + var r3a7 = x <= g; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + ~ +!!! error TS2454: Variable 'g' is used before being assigned. + + var r3b1 = a <= x; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var r3b2 = b <= x; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var r3b3 = c <= x; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var r3b4 = d <= x; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var r3b5 = e <= x; + ~ +!!! error TS2454: Variable 'e' is used before being assigned. + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var r3b6 = f <= x; + ~ +!!! error TS2454: Variable 'f' is used before being assigned. + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var r3b7 = g <= x; + ~ +!!! error TS2454: Variable 'g' is used before being assigned. + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + + // operator >= + var r4a1 = x >= a; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var r4a2 = x >= b; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var r4a3 = x >= c; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var r4a4 = x >= d; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var r4a5 = x >= e; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + ~ +!!! error TS2454: Variable 'e' is used before being assigned. + var r4a6 = x >= f; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + ~ +!!! error TS2454: Variable 'f' is used before being assigned. + var r4a7 = x >= g; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + ~ +!!! error TS2454: Variable 'g' is used before being assigned. + + var r4b1 = a >= x; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var r4b2 = b >= x; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var r4b3 = c >= x; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var r4b4 = d >= x; + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var r4b5 = e >= x; + ~ +!!! error TS2454: Variable 'e' is used before being assigned. + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var r4b6 = f >= x; + ~ +!!! error TS2454: Variable 'f' is used before being assigned. + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + var r4b7 = g >= x; + ~ +!!! error TS2454: Variable 'g' is used before being assigned. + ~ +!!! error TS18048: 'x' is possibly 'undefined'. + + // operator == + var r5a1 = x == a; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var r5a2 = x == b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var r5a3 = x == c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var r5a4 = x == d; + var r5a5 = x == e; + ~ +!!! error TS2454: Variable 'e' is used before being assigned. + var r5a6 = x == f; + ~ +!!! error TS2454: Variable 'f' is used before being assigned. + var r5a7 = x == g; + ~ +!!! error TS2454: Variable 'g' is used before being assigned. + + var r5b1 = a == x; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var r5b2 = b == x; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var r5b3 = c == x; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var r5b4 = d == x; + var r5b5 = e == x; + ~ +!!! error TS2454: Variable 'e' is used before being assigned. + var r5b6 = f == x; + ~ +!!! error TS2454: Variable 'f' is used before being assigned. + var r5b7 = g == x; + ~ +!!! error TS2454: Variable 'g' is used before being assigned. + + // operator != + var r6a1 = x != a; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var r6a2 = x != b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var r6a3 = x != c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var r6a4 = x != d; + var r6a5 = x != e; + ~ +!!! error TS2454: Variable 'e' is used before being assigned. + var r6a6 = x != f; + ~ +!!! error TS2454: Variable 'f' is used before being assigned. + var r6a7 = x != g; + ~ +!!! error TS2454: Variable 'g' is used before being assigned. + + var r6b1 = a != x; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var r6b2 = b != x; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var r6b3 = c != x; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var r6b4 = d != x; + var r6b5 = e != x; + ~ +!!! error TS2454: Variable 'e' is used before being assigned. + var r6b6 = f != x; + ~ +!!! error TS2454: Variable 'f' is used before being assigned. + var r6b7 = g != x; + ~ +!!! error TS2454: Variable 'g' is used before being assigned. + + // operator === + var r7a1 = x === a; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var r7a2 = x === b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var r7a3 = x === c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var r7a4 = x === d; + var r7a5 = x === e; + ~ +!!! error TS2454: Variable 'e' is used before being assigned. + var r7a6 = x === f; + ~ +!!! error TS2454: Variable 'f' is used before being assigned. + var r7a7 = x === g; + ~ +!!! error TS2454: Variable 'g' is used before being assigned. + + var r7b1 = a === x; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var r7b2 = b === x; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var r7b3 = c === x; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var r7b4 = d === x; + var r7b5 = e === x; + ~ +!!! error TS2454: Variable 'e' is used before being assigned. + var r7b6 = f === x; + ~ +!!! error TS2454: Variable 'f' is used before being assigned. + var r7b7 = g === x; + ~ +!!! error TS2454: Variable 'g' is used before being assigned. + + // operator !== + var r8a1 = x !== a; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var r8a2 = x !== b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var r8a3 = x !== c; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var r8a4 = x !== d; + var r8a5 = x !== e; + ~ +!!! error TS2454: Variable 'e' is used before being assigned. + var r8a6 = x !== f; + ~ +!!! error TS2454: Variable 'f' is used before being assigned. + var r8a7 = x !== g; + ~ +!!! error TS2454: Variable 'g' is used before being assigned. + + var r8b1 = a !== x; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var r8b2 = b !== x; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var r8b3 = c !== x; + ~ +!!! error TS2454: Variable 'c' is used before being assigned. + var r8b4 = d !== x; + var r8b5 = e !== x; + ~ +!!! error TS2454: Variable 'e' is used before being assigned. + var r8b6 = f !== x; + ~ +!!! error TS2454: Variable 'f' is used before being assigned. + var r8b7 = g !== x; + ~ +!!! error TS2454: Variable 'g' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithOneOperandIsUndefined.js b/tests/baselines/reference/comparisonOperatorWithOneOperandIsUndefined.js index 0eafe793f9573..89c094ed32290 100644 --- a/tests/baselines/reference/comparisonOperatorWithOneOperandIsUndefined.js +++ b/tests/baselines/reference/comparisonOperatorWithOneOperandIsUndefined.js @@ -170,6 +170,7 @@ var r8b6 = f !== x; var r8b7 = g !== x; //// [comparisonOperatorWithOneOperandIsUndefined.js] +"use strict"; var x; var E; (function (E) { diff --git a/tests/baselines/reference/comparisonOperatorWithOneOperandIsUndefined.types b/tests/baselines/reference/comparisonOperatorWithOneOperandIsUndefined.types index 690bb6711871a..8762cbf513d70 100644 --- a/tests/baselines/reference/comparisonOperatorWithOneOperandIsUndefined.types +++ b/tests/baselines/reference/comparisonOperatorWithOneOperandIsUndefined.types @@ -2,7 +2,8 @@ === comparisonOperatorWithOneOperandIsUndefined.ts === var x: typeof undefined; ->x : any +>x : undefined +> : ^^^^^^^^^ >undefined : undefined > : ^^^^^^^^^ @@ -29,7 +30,8 @@ function foo(t: T) { > : ^^^^^^^ >t : T > : ^ ->x : any +>x : undefined +> : ^^^^^^^^^ var foo_r2 = t > x; >foo_r2 : boolean @@ -38,7 +40,8 @@ function foo(t: T) { > : ^^^^^^^ >t : T > : ^ ->x : any +>x : undefined +> : ^^^^^^^^^ var foo_r3 = t <= x; >foo_r3 : boolean @@ -47,7 +50,8 @@ function foo(t: T) { > : ^^^^^^^ >t : T > : ^ ->x : any +>x : undefined +> : ^^^^^^^^^ var foo_r4 = t >= x; >foo_r4 : boolean @@ -56,7 +60,8 @@ function foo(t: T) { > : ^^^^^^^ >t : T > : ^ ->x : any +>x : undefined +> : ^^^^^^^^^ var foo_r5 = t == x; >foo_r5 : boolean @@ -65,7 +70,8 @@ function foo(t: T) { > : ^^^^^^^ >t : T > : ^ ->x : any +>x : undefined +> : ^^^^^^^^^ var foo_r6 = t != x; >foo_r6 : boolean @@ -74,7 +80,8 @@ function foo(t: T) { > : ^^^^^^^ >t : T > : ^ ->x : any +>x : undefined +> : ^^^^^^^^^ var foo_r7 = t === x; >foo_r7 : boolean @@ -83,7 +90,8 @@ function foo(t: T) { > : ^^^^^^^ >t : T > : ^ ->x : any +>x : undefined +> : ^^^^^^^^^ var foo_r8 = t !== x; >foo_r8 : boolean @@ -92,14 +100,16 @@ function foo(t: T) { > : ^^^^^^^ >t : T > : ^ ->x : any +>x : undefined +> : ^^^^^^^^^ var foo_r1 = x < t; >foo_r1 : boolean > : ^^^^^^^ >x < t : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >t : T > : ^ @@ -108,7 +118,8 @@ function foo(t: T) { > : ^^^^^^^ >x > t : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >t : T > : ^ @@ -117,7 +128,8 @@ function foo(t: T) { > : ^^^^^^^ >x <= t : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >t : T > : ^ @@ -126,7 +138,8 @@ function foo(t: T) { > : ^^^^^^^ >x >= t : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >t : T > : ^ @@ -135,7 +148,8 @@ function foo(t: T) { > : ^^^^^^^ >x == t : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >t : T > : ^ @@ -144,7 +158,8 @@ function foo(t: T) { > : ^^^^^^^ >x != t : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >t : T > : ^ @@ -153,7 +168,8 @@ function foo(t: T) { > : ^^^^^^^ >x === t : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >t : T > : ^ @@ -162,7 +178,8 @@ function foo(t: T) { > : ^^^^^^^ >x !== t : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >t : T > : ^ } @@ -201,7 +218,8 @@ var r1a1 = x < a; > : ^^^^^^^ >x < a : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >a : boolean > : ^^^^^^^ @@ -210,7 +228,8 @@ var r1a2 = x < b; > : ^^^^^^^ >x < b : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >b : number > : ^^^^^^ @@ -219,7 +238,8 @@ var r1a3 = x < c; > : ^^^^^^^ >x < c : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >c : string > : ^^^^^^ @@ -228,7 +248,8 @@ var r1a4 = x < d; > : ^^^^^^^ >x < d : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >d : void > : ^^^^ @@ -237,7 +258,8 @@ var r1a5 = x < e; > : ^^^^^^^ >x < e : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >e : E > : ^ @@ -246,7 +268,8 @@ var r1a6 = x < f; > : ^^^^^^^ >x < f : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >f : {} > : ^^ @@ -255,7 +278,8 @@ var r1a7 = x < g; > : ^^^^^^^ >x < g : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >g : string[] > : ^^^^^^^^ @@ -266,7 +290,8 @@ var r1b1 = a < x; > : ^^^^^^^ >a : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r1b2 = b < x; >r1b2 : boolean @@ -275,7 +300,8 @@ var r1b2 = b < x; > : ^^^^^^^ >b : number > : ^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r1b3 = c < x; >r1b3 : boolean @@ -284,7 +310,8 @@ var r1b3 = c < x; > : ^^^^^^^ >c : string > : ^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r1b4 = d < x; >r1b4 : boolean @@ -293,7 +320,8 @@ var r1b4 = d < x; > : ^^^^^^^ >d : void > : ^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r1b5 = e < x; >r1b5 : boolean @@ -302,7 +330,8 @@ var r1b5 = e < x; > : ^^^^^^^ >e : E > : ^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r1b6 = f < x; >r1b6 : boolean @@ -311,7 +340,8 @@ var r1b6 = f < x; > : ^^^^^^^ >f : {} > : ^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r1b7 = g < x; >r1b7 : boolean @@ -320,7 +350,8 @@ var r1b7 = g < x; > : ^^^^^^^ >g : string[] > : ^^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ // operator > var r2a1 = x > a; @@ -328,7 +359,8 @@ var r2a1 = x > a; > : ^^^^^^^ >x > a : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >a : boolean > : ^^^^^^^ @@ -337,7 +369,8 @@ var r2a2 = x > b; > : ^^^^^^^ >x > b : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >b : number > : ^^^^^^ @@ -346,7 +379,8 @@ var r2a3 = x > c; > : ^^^^^^^ >x > c : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >c : string > : ^^^^^^ @@ -355,7 +389,8 @@ var r2a4 = x > d; > : ^^^^^^^ >x > d : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >d : void > : ^^^^ @@ -364,7 +399,8 @@ var r2a5 = x > e; > : ^^^^^^^ >x > e : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >e : E > : ^ @@ -373,7 +409,8 @@ var r2a6 = x > f; > : ^^^^^^^ >x > f : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >f : {} > : ^^ @@ -382,7 +419,8 @@ var r2a7 = x > g; > : ^^^^^^^ >x > g : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >g : string[] > : ^^^^^^^^ @@ -393,7 +431,8 @@ var r2b1 = a > x; > : ^^^^^^^ >a : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r2b2 = b > x; >r2b2 : boolean @@ -402,7 +441,8 @@ var r2b2 = b > x; > : ^^^^^^^ >b : number > : ^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r2b3 = c > x; >r2b3 : boolean @@ -411,7 +451,8 @@ var r2b3 = c > x; > : ^^^^^^^ >c : string > : ^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r2b4 = d > x; >r2b4 : boolean @@ -420,7 +461,8 @@ var r2b4 = d > x; > : ^^^^^^^ >d : void > : ^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r2b5 = e > x; >r2b5 : boolean @@ -429,7 +471,8 @@ var r2b5 = e > x; > : ^^^^^^^ >e : E > : ^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r2b6 = f > x; >r2b6 : boolean @@ -438,7 +481,8 @@ var r2b6 = f > x; > : ^^^^^^^ >f : {} > : ^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r2b7 = g > x; >r2b7 : boolean @@ -447,7 +491,8 @@ var r2b7 = g > x; > : ^^^^^^^ >g : string[] > : ^^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ // operator <= var r3a1 = x <= a; @@ -455,7 +500,8 @@ var r3a1 = x <= a; > : ^^^^^^^ >x <= a : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >a : boolean > : ^^^^^^^ @@ -464,7 +510,8 @@ var r3a2 = x <= b; > : ^^^^^^^ >x <= b : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >b : number > : ^^^^^^ @@ -473,7 +520,8 @@ var r3a3 = x <= c; > : ^^^^^^^ >x <= c : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >c : string > : ^^^^^^ @@ -482,7 +530,8 @@ var r3a4 = x <= d; > : ^^^^^^^ >x <= d : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >d : void > : ^^^^ @@ -491,7 +540,8 @@ var r3a5 = x <= e; > : ^^^^^^^ >x <= e : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >e : E > : ^ @@ -500,7 +550,8 @@ var r3a6 = x <= f; > : ^^^^^^^ >x <= f : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >f : {} > : ^^ @@ -509,7 +560,8 @@ var r3a7 = x <= g; > : ^^^^^^^ >x <= g : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >g : string[] > : ^^^^^^^^ @@ -520,7 +572,8 @@ var r3b1 = a <= x; > : ^^^^^^^ >a : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r3b2 = b <= x; >r3b2 : boolean @@ -529,7 +582,8 @@ var r3b2 = b <= x; > : ^^^^^^^ >b : number > : ^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r3b3 = c <= x; >r3b3 : boolean @@ -538,7 +592,8 @@ var r3b3 = c <= x; > : ^^^^^^^ >c : string > : ^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r3b4 = d <= x; >r3b4 : boolean @@ -547,7 +602,8 @@ var r3b4 = d <= x; > : ^^^^^^^ >d : void > : ^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r3b5 = e <= x; >r3b5 : boolean @@ -556,7 +612,8 @@ var r3b5 = e <= x; > : ^^^^^^^ >e : E > : ^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r3b6 = f <= x; >r3b6 : boolean @@ -565,7 +622,8 @@ var r3b6 = f <= x; > : ^^^^^^^ >f : {} > : ^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r3b7 = g <= x; >r3b7 : boolean @@ -574,7 +632,8 @@ var r3b7 = g <= x; > : ^^^^^^^ >g : string[] > : ^^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ // operator >= var r4a1 = x >= a; @@ -582,7 +641,8 @@ var r4a1 = x >= a; > : ^^^^^^^ >x >= a : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >a : boolean > : ^^^^^^^ @@ -591,7 +651,8 @@ var r4a2 = x >= b; > : ^^^^^^^ >x >= b : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >b : number > : ^^^^^^ @@ -600,7 +661,8 @@ var r4a3 = x >= c; > : ^^^^^^^ >x >= c : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >c : string > : ^^^^^^ @@ -609,7 +671,8 @@ var r4a4 = x >= d; > : ^^^^^^^ >x >= d : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >d : void > : ^^^^ @@ -618,7 +681,8 @@ var r4a5 = x >= e; > : ^^^^^^^ >x >= e : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >e : E > : ^ @@ -627,7 +691,8 @@ var r4a6 = x >= f; > : ^^^^^^^ >x >= f : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >f : {} > : ^^ @@ -636,7 +701,8 @@ var r4a7 = x >= g; > : ^^^^^^^ >x >= g : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >g : string[] > : ^^^^^^^^ @@ -647,7 +713,8 @@ var r4b1 = a >= x; > : ^^^^^^^ >a : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r4b2 = b >= x; >r4b2 : boolean @@ -656,7 +723,8 @@ var r4b2 = b >= x; > : ^^^^^^^ >b : number > : ^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r4b3 = c >= x; >r4b3 : boolean @@ -665,7 +733,8 @@ var r4b3 = c >= x; > : ^^^^^^^ >c : string > : ^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r4b4 = d >= x; >r4b4 : boolean @@ -674,7 +743,8 @@ var r4b4 = d >= x; > : ^^^^^^^ >d : void > : ^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r4b5 = e >= x; >r4b5 : boolean @@ -683,7 +753,8 @@ var r4b5 = e >= x; > : ^^^^^^^ >e : E > : ^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r4b6 = f >= x; >r4b6 : boolean @@ -692,7 +763,8 @@ var r4b6 = f >= x; > : ^^^^^^^ >f : {} > : ^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r4b7 = g >= x; >r4b7 : boolean @@ -701,7 +773,8 @@ var r4b7 = g >= x; > : ^^^^^^^ >g : string[] > : ^^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ // operator == var r5a1 = x == a; @@ -709,7 +782,8 @@ var r5a1 = x == a; > : ^^^^^^^ >x == a : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >a : boolean > : ^^^^^^^ @@ -718,7 +792,8 @@ var r5a2 = x == b; > : ^^^^^^^ >x == b : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >b : number > : ^^^^^^ @@ -727,7 +802,8 @@ var r5a3 = x == c; > : ^^^^^^^ >x == c : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >c : string > : ^^^^^^ @@ -736,7 +812,8 @@ var r5a4 = x == d; > : ^^^^^^^ >x == d : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >d : void > : ^^^^ @@ -745,7 +822,8 @@ var r5a5 = x == e; > : ^^^^^^^ >x == e : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >e : E > : ^ @@ -754,7 +832,8 @@ var r5a6 = x == f; > : ^^^^^^^ >x == f : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >f : {} > : ^^ @@ -763,7 +842,8 @@ var r5a7 = x == g; > : ^^^^^^^ >x == g : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >g : string[] > : ^^^^^^^^ @@ -774,7 +854,8 @@ var r5b1 = a == x; > : ^^^^^^^ >a : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r5b2 = b == x; >r5b2 : boolean @@ -783,7 +864,8 @@ var r5b2 = b == x; > : ^^^^^^^ >b : number > : ^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r5b3 = c == x; >r5b3 : boolean @@ -792,7 +874,8 @@ var r5b3 = c == x; > : ^^^^^^^ >c : string > : ^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r5b4 = d == x; >r5b4 : boolean @@ -801,7 +884,8 @@ var r5b4 = d == x; > : ^^^^^^^ >d : void > : ^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r5b5 = e == x; >r5b5 : boolean @@ -810,7 +894,8 @@ var r5b5 = e == x; > : ^^^^^^^ >e : E > : ^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r5b6 = f == x; >r5b6 : boolean @@ -819,7 +904,8 @@ var r5b6 = f == x; > : ^^^^^^^ >f : {} > : ^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r5b7 = g == x; >r5b7 : boolean @@ -828,7 +914,8 @@ var r5b7 = g == x; > : ^^^^^^^ >g : string[] > : ^^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ // operator != var r6a1 = x != a; @@ -836,7 +923,8 @@ var r6a1 = x != a; > : ^^^^^^^ >x != a : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >a : boolean > : ^^^^^^^ @@ -845,7 +933,8 @@ var r6a2 = x != b; > : ^^^^^^^ >x != b : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >b : number > : ^^^^^^ @@ -854,7 +943,8 @@ var r6a3 = x != c; > : ^^^^^^^ >x != c : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >c : string > : ^^^^^^ @@ -863,7 +953,8 @@ var r6a4 = x != d; > : ^^^^^^^ >x != d : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >d : void > : ^^^^ @@ -872,7 +963,8 @@ var r6a5 = x != e; > : ^^^^^^^ >x != e : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >e : E > : ^ @@ -881,7 +973,8 @@ var r6a6 = x != f; > : ^^^^^^^ >x != f : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >f : {} > : ^^ @@ -890,7 +983,8 @@ var r6a7 = x != g; > : ^^^^^^^ >x != g : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >g : string[] > : ^^^^^^^^ @@ -901,7 +995,8 @@ var r6b1 = a != x; > : ^^^^^^^ >a : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r6b2 = b != x; >r6b2 : boolean @@ -910,7 +1005,8 @@ var r6b2 = b != x; > : ^^^^^^^ >b : number > : ^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r6b3 = c != x; >r6b3 : boolean @@ -919,7 +1015,8 @@ var r6b3 = c != x; > : ^^^^^^^ >c : string > : ^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r6b4 = d != x; >r6b4 : boolean @@ -928,7 +1025,8 @@ var r6b4 = d != x; > : ^^^^^^^ >d : void > : ^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r6b5 = e != x; >r6b5 : boolean @@ -937,7 +1035,8 @@ var r6b5 = e != x; > : ^^^^^^^ >e : E > : ^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r6b6 = f != x; >r6b6 : boolean @@ -946,7 +1045,8 @@ var r6b6 = f != x; > : ^^^^^^^ >f : {} > : ^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r6b7 = g != x; >r6b7 : boolean @@ -955,7 +1055,8 @@ var r6b7 = g != x; > : ^^^^^^^ >g : string[] > : ^^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ // operator === var r7a1 = x === a; @@ -963,7 +1064,8 @@ var r7a1 = x === a; > : ^^^^^^^ >x === a : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >a : boolean > : ^^^^^^^ @@ -972,7 +1074,8 @@ var r7a2 = x === b; > : ^^^^^^^ >x === b : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >b : number > : ^^^^^^ @@ -981,7 +1084,8 @@ var r7a3 = x === c; > : ^^^^^^^ >x === c : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >c : string > : ^^^^^^ @@ -990,7 +1094,8 @@ var r7a4 = x === d; > : ^^^^^^^ >x === d : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >d : void > : ^^^^ @@ -999,7 +1104,8 @@ var r7a5 = x === e; > : ^^^^^^^ >x === e : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >e : E > : ^ @@ -1008,7 +1114,8 @@ var r7a6 = x === f; > : ^^^^^^^ >x === f : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >f : {} > : ^^ @@ -1017,7 +1124,8 @@ var r7a7 = x === g; > : ^^^^^^^ >x === g : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >g : string[] > : ^^^^^^^^ @@ -1028,7 +1136,8 @@ var r7b1 = a === x; > : ^^^^^^^ >a : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r7b2 = b === x; >r7b2 : boolean @@ -1037,7 +1146,8 @@ var r7b2 = b === x; > : ^^^^^^^ >b : number > : ^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r7b3 = c === x; >r7b3 : boolean @@ -1046,7 +1156,8 @@ var r7b3 = c === x; > : ^^^^^^^ >c : string > : ^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r7b4 = d === x; >r7b4 : boolean @@ -1055,7 +1166,8 @@ var r7b4 = d === x; > : ^^^^^^^ >d : void > : ^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r7b5 = e === x; >r7b5 : boolean @@ -1064,7 +1176,8 @@ var r7b5 = e === x; > : ^^^^^^^ >e : E > : ^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r7b6 = f === x; >r7b6 : boolean @@ -1073,7 +1186,8 @@ var r7b6 = f === x; > : ^^^^^^^ >f : {} > : ^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r7b7 = g === x; >r7b7 : boolean @@ -1082,7 +1196,8 @@ var r7b7 = g === x; > : ^^^^^^^ >g : string[] > : ^^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ // operator !== var r8a1 = x !== a; @@ -1090,7 +1205,8 @@ var r8a1 = x !== a; > : ^^^^^^^ >x !== a : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >a : boolean > : ^^^^^^^ @@ -1099,7 +1215,8 @@ var r8a2 = x !== b; > : ^^^^^^^ >x !== b : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >b : number > : ^^^^^^ @@ -1108,7 +1225,8 @@ var r8a3 = x !== c; > : ^^^^^^^ >x !== c : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >c : string > : ^^^^^^ @@ -1117,7 +1235,8 @@ var r8a4 = x !== d; > : ^^^^^^^ >x !== d : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >d : void > : ^^^^ @@ -1126,7 +1245,8 @@ var r8a5 = x !== e; > : ^^^^^^^ >x !== e : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >e : E > : ^ @@ -1135,7 +1255,8 @@ var r8a6 = x !== f; > : ^^^^^^^ >x !== f : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >f : {} > : ^^ @@ -1144,7 +1265,8 @@ var r8a7 = x !== g; > : ^^^^^^^ >x !== g : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ >g : string[] > : ^^^^^^^^ @@ -1155,7 +1277,8 @@ var r8b1 = a !== x; > : ^^^^^^^ >a : boolean > : ^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r8b2 = b !== x; >r8b2 : boolean @@ -1164,7 +1287,8 @@ var r8b2 = b !== x; > : ^^^^^^^ >b : number > : ^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r8b3 = c !== x; >r8b3 : boolean @@ -1173,7 +1297,8 @@ var r8b3 = c !== x; > : ^^^^^^^ >c : string > : ^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r8b4 = d !== x; >r8b4 : boolean @@ -1182,7 +1307,8 @@ var r8b4 = d !== x; > : ^^^^^^^ >d : void > : ^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r8b5 = e !== x; >r8b5 : boolean @@ -1191,7 +1317,8 @@ var r8b5 = e !== x; > : ^^^^^^^ >e : E > : ^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r8b6 = f !== x; >r8b6 : boolean @@ -1200,7 +1327,8 @@ var r8b6 = f !== x; > : ^^^^^^^ >f : {} > : ^^ ->x : any +>x : undefined +> : ^^^^^^^^^ var r8b7 = g !== x; >r8b7 : boolean @@ -1209,5 +1337,6 @@ var r8b7 = g !== x; > : ^^^^^^^ >g : string[] > : ^^^^^^^^ ->x : any +>x : undefined +> : ^^^^^^^^^ diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.errors.txt b/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.errors.txt new file mode 100644 index 0000000000000..41d737054b06e --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.errors.txt @@ -0,0 +1,215 @@ +comparisonOperatorWithSubtypeEnumAndNumber.ts(7,11): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(7,15): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(8,11): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(8,15): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(9,17): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(10,11): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(15,11): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(15,15): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(16,11): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(16,15): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(17,17): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(18,11): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(23,11): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(23,16): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(24,11): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(24,16): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(25,18): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(26,11): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(31,11): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(31,16): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(32,11): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(32,16): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(33,18): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(34,11): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(39,11): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(39,16): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(40,11): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(40,16): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(41,18): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(42,11): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(47,11): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(47,16): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(48,11): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(48,16): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(49,18): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(50,11): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(55,11): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(55,17): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(56,11): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(56,17): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(57,19): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(58,11): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(63,11): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(63,17): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(64,11): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(64,17): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(65,19): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeEnumAndNumber.ts(66,11): error TS2454: Variable 'b' is used before being assigned. + + +==== comparisonOperatorWithSubtypeEnumAndNumber.ts (48 errors) ==== + enum E { a, b, c } + + var a: E; + var b: number; + + // operator < + var ra1 = a < b; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var ra2 = b < a; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var ra3 = E.a < b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var ra4 = b < E.a; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var ra5 = E.a < 0; + var ra6 = 0 < E.a; + + // operator > + var rb1 = a > b; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rb2 = b > a; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var rb3 = E.a > b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rb4 = b > E.a; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rb5 = E.a > 0; + var rb6 = 0 > E.a; + + // operator <= + var rc1 = a <= b; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rc2 = b <= a; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var rc3 = E.a <= b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rc4 = b <= E.a; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rc5 = E.a <= 0; + var rc6 = 0 <= E.a; + + // operator >= + var rd1 = a >= b; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rd2 = b >= a; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var rd3 = E.a >= b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rd4 = b >= E.a; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rd5 = E.a >= 0; + var rd6 = 0 >= E.a; + + // operator == + var re1 = a == b; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var re2 = b == a; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var re3 = E.a == b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var re4 = b == E.a; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var re5 = E.a == 0; + var re6 = 0 == E.a; + + // operator != + var rf1 = a != b; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rf2 = b != a; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var rf3 = E.a != b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rf4 = b != E.a; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rf5 = E.a != 0; + var rf6 = 0 != E.a; + + // operator === + var rg1 = a === b; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rg2 = b === a; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var rg3 = E.a === b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rg4 = b === E.a; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rg5 = E.a === 0; + var rg6 = 0 === E.a; + + // operator !== + var rh1 = a !== b; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rh2 = b !== a; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var rh3 = E.a !== b; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rh4 = b !== E.a; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rh5 = E.a !== 0; + var rh6 = 0 !== E.a; \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.js b/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.js index cf76811a8d04f..191583550f19d 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeEnumAndNumber.js @@ -71,6 +71,7 @@ var rh5 = E.a !== 0; var rh6 = 0 !== E.a; //// [comparisonOperatorWithSubtypeEnumAndNumber.js] +"use strict"; var E; (function (E) { E[E["a"] = 0] = "a"; diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.errors.txt b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.errors.txt new file mode 100644 index 0000000000000..fbffaefd9116f --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.errors.txt @@ -0,0 +1,1324 @@ +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(2,12): error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(6,12): error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(46,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(46,17): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(47,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(47,17): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(48,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(48,17): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(49,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(49,17): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(50,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(50,17): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(51,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(51,17): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(52,12): error TS2454: Variable 'a7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(52,17): error TS2454: Variable 'b7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(53,12): error TS2454: Variable 'a8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(53,17): error TS2454: Variable 'b8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(54,12): error TS2454: Variable 'a9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(54,17): error TS2454: Variable 'b9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(55,13): error TS2454: Variable 'a10' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(55,19): error TS2454: Variable 'b10' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(56,13): error TS2454: Variable 'a11' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(56,19): error TS2454: Variable 'b11' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(59,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(59,17): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(60,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(60,17): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(61,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(61,17): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(62,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(62,17): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(63,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(63,17): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(64,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(64,17): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(65,12): error TS2454: Variable 'b7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(65,17): error TS2454: Variable 'a7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(66,12): error TS2454: Variable 'b8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(66,17): error TS2454: Variable 'a8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(67,12): error TS2454: Variable 'b9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(67,17): error TS2454: Variable 'a9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(68,13): error TS2454: Variable 'b10' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(68,19): error TS2454: Variable 'a10' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(69,13): error TS2454: Variable 'b11' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(69,19): error TS2454: Variable 'a11' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(73,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(73,17): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(74,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(74,17): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(75,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(75,17): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(76,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(76,17): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(77,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(77,17): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(78,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(78,17): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(79,12): error TS2454: Variable 'a7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(79,17): error TS2454: Variable 'b7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(80,12): error TS2454: Variable 'a8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(80,17): error TS2454: Variable 'b8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(81,12): error TS2454: Variable 'a9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(81,17): error TS2454: Variable 'b9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(82,13): error TS2454: Variable 'a10' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(82,19): error TS2454: Variable 'b10' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(83,13): error TS2454: Variable 'a11' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(83,19): error TS2454: Variable 'b11' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(86,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(86,17): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(87,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(87,17): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(88,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(88,17): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(89,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(89,17): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(90,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(90,17): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(91,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(91,17): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(92,12): error TS2454: Variable 'b7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(92,17): error TS2454: Variable 'a7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(93,12): error TS2454: Variable 'b8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(93,17): error TS2454: Variable 'a8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(94,12): error TS2454: Variable 'b9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(94,17): error TS2454: Variable 'a9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(95,13): error TS2454: Variable 'b10' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(95,19): error TS2454: Variable 'a10' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(96,13): error TS2454: Variable 'b11' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(96,19): error TS2454: Variable 'a11' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(100,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(100,18): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(101,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(101,18): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(102,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(102,18): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(103,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(103,18): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(104,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(104,18): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(105,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(105,18): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(106,12): error TS2454: Variable 'a7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(106,18): error TS2454: Variable 'b7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(107,12): error TS2454: Variable 'a8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(107,18): error TS2454: Variable 'b8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(108,12): error TS2454: Variable 'a9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(108,18): error TS2454: Variable 'b9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(109,13): error TS2454: Variable 'a10' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(109,20): error TS2454: Variable 'b10' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(110,13): error TS2454: Variable 'a11' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(110,20): error TS2454: Variable 'b11' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(113,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(113,18): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(114,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(114,18): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(115,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(115,18): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(116,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(116,18): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(117,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(117,18): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(118,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(118,18): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(119,12): error TS2454: Variable 'b7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(119,18): error TS2454: Variable 'a7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(120,12): error TS2454: Variable 'b8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(120,18): error TS2454: Variable 'a8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(121,12): error TS2454: Variable 'b9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(121,18): error TS2454: Variable 'a9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(122,13): error TS2454: Variable 'b10' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(122,20): error TS2454: Variable 'a10' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(123,13): error TS2454: Variable 'b11' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(123,20): error TS2454: Variable 'a11' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(127,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(127,18): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(128,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(128,18): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(129,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(129,18): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(130,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(130,18): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(131,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(131,18): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(132,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(132,18): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(133,12): error TS2454: Variable 'a7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(133,18): error TS2454: Variable 'b7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(134,12): error TS2454: Variable 'a8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(134,18): error TS2454: Variable 'b8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(135,12): error TS2454: Variable 'a9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(135,18): error TS2454: Variable 'b9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(136,13): error TS2454: Variable 'a10' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(136,20): error TS2454: Variable 'b10' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(137,13): error TS2454: Variable 'a11' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(137,20): error TS2454: Variable 'b11' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(140,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(140,18): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(141,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(141,18): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(142,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(142,18): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(143,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(143,18): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(144,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(144,18): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(145,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(145,18): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(146,12): error TS2454: Variable 'b7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(146,18): error TS2454: Variable 'a7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(147,12): error TS2454: Variable 'b8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(147,18): error TS2454: Variable 'a8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(148,12): error TS2454: Variable 'b9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(148,18): error TS2454: Variable 'a9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(149,13): error TS2454: Variable 'b10' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(149,20): error TS2454: Variable 'a10' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(150,13): error TS2454: Variable 'b11' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(150,20): error TS2454: Variable 'a11' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(154,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(154,18): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(155,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(155,18): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(156,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(156,18): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(157,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(157,18): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(158,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(158,18): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(159,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(159,18): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(160,12): error TS2454: Variable 'a7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(160,18): error TS2454: Variable 'b7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(161,12): error TS2454: Variable 'a8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(161,18): error TS2454: Variable 'b8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(162,12): error TS2454: Variable 'a9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(162,18): error TS2454: Variable 'b9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(163,13): error TS2454: Variable 'a10' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(163,20): error TS2454: Variable 'b10' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(164,13): error TS2454: Variable 'a11' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(164,20): error TS2454: Variable 'b11' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(167,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(167,18): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(168,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(168,18): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(169,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(169,18): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(170,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(170,18): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(171,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(171,18): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(172,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(172,18): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(173,12): error TS2454: Variable 'b7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(173,18): error TS2454: Variable 'a7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(174,12): error TS2454: Variable 'b8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(174,18): error TS2454: Variable 'a8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(175,12): error TS2454: Variable 'b9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(175,18): error TS2454: Variable 'a9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(176,13): error TS2454: Variable 'b10' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(176,20): error TS2454: Variable 'a10' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(177,13): error TS2454: Variable 'b11' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(177,20): error TS2454: Variable 'a11' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(181,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(181,18): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(182,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(182,18): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(183,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(183,18): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(184,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(184,18): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(185,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(185,18): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(186,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(186,18): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(187,12): error TS2454: Variable 'a7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(187,18): error TS2454: Variable 'b7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(188,12): error TS2454: Variable 'a8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(188,18): error TS2454: Variable 'b8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(189,12): error TS2454: Variable 'a9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(189,18): error TS2454: Variable 'b9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(190,13): error TS2454: Variable 'a10' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(190,20): error TS2454: Variable 'b10' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(191,13): error TS2454: Variable 'a11' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(191,20): error TS2454: Variable 'b11' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(194,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(194,18): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(195,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(195,18): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(196,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(196,18): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(197,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(197,18): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(198,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(198,18): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(199,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(199,18): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(200,12): error TS2454: Variable 'b7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(200,18): error TS2454: Variable 'a7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(201,12): error TS2454: Variable 'b8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(201,18): error TS2454: Variable 'a8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(202,12): error TS2454: Variable 'b9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(202,18): error TS2454: Variable 'a9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(203,13): error TS2454: Variable 'b10' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(203,20): error TS2454: Variable 'a10' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(204,13): error TS2454: Variable 'b11' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(204,20): error TS2454: Variable 'a11' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(208,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(208,19): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(209,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(209,19): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(210,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(210,19): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(211,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(211,19): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(212,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(212,19): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(213,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(213,19): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(214,12): error TS2454: Variable 'a7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(214,19): error TS2454: Variable 'b7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(215,12): error TS2454: Variable 'a8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(215,19): error TS2454: Variable 'b8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(216,12): error TS2454: Variable 'a9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(216,19): error TS2454: Variable 'b9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(217,13): error TS2454: Variable 'a10' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(217,21): error TS2454: Variable 'b10' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(218,13): error TS2454: Variable 'a11' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(218,21): error TS2454: Variable 'b11' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(221,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(221,19): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(222,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(222,19): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(223,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(223,19): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(224,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(224,19): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(225,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(225,19): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(226,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(226,19): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(227,12): error TS2454: Variable 'b7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(227,19): error TS2454: Variable 'a7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(228,12): error TS2454: Variable 'b8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(228,19): error TS2454: Variable 'a8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(229,12): error TS2454: Variable 'b9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(229,19): error TS2454: Variable 'a9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(230,13): error TS2454: Variable 'b10' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(230,21): error TS2454: Variable 'a10' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(231,13): error TS2454: Variable 'b11' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(231,21): error TS2454: Variable 'a11' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(235,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(235,19): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(236,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(236,19): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(237,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(237,19): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(238,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(238,19): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(239,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(239,19): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(240,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(240,19): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(241,12): error TS2454: Variable 'a7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(241,19): error TS2454: Variable 'b7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(242,12): error TS2454: Variable 'a8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(242,19): error TS2454: Variable 'b8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(243,12): error TS2454: Variable 'a9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(243,19): error TS2454: Variable 'b9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(244,13): error TS2454: Variable 'a10' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(244,21): error TS2454: Variable 'b10' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(245,13): error TS2454: Variable 'a11' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(245,21): error TS2454: Variable 'b11' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(248,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(248,19): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(249,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(249,19): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(250,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(250,19): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(251,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(251,19): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(252,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(252,19): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(253,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(253,19): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(254,12): error TS2454: Variable 'b7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(254,19): error TS2454: Variable 'a7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(255,12): error TS2454: Variable 'b8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(255,19): error TS2454: Variable 'a8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(256,12): error TS2454: Variable 'b9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(256,19): error TS2454: Variable 'a9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(257,13): error TS2454: Variable 'b10' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(257,21): error TS2454: Variable 'a10' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(258,13): error TS2454: Variable 'b11' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnCallSignature.ts(258,21): error TS2454: Variable 'a11' is used before being assigned. + + +==== comparisonOperatorWithSubtypeObjectOnCallSignature.ts (354 errors) ==== + class Base { + public a: string; + ~ +!!! error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. + } + + class Derived extends Base { + public b: string; + ~ +!!! error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. + } + + var a1: { fn(): void }; + var b1: { fn(): void }; + + var a2: { fn(a: number, b: string): void }; + var b2: { fn(a: number, b: string): void }; + + var a3: { fn(a: number, b: string): void }; + var b3: { fn(a: number): void }; + + var a4: { fn(a: number, b: string): void }; + var b4: { fn(): void }; + + var a5: { fn(a: Base): void }; + var b5: { fn(a: Derived): void }; + + var a6: { fn(a: Derived, b: Base): void }; + var b6: { fn(a: Base, b: Derived): void }; + + var a7: { fn(): void }; + var b7: { fn(): Base }; + + var a8: { fn(): Base }; + var b8: { fn(): Base }; + + var a9: { fn(): Base }; + var b9: { fn(): Derived }; + + var a10: { fn(a?: Base): void }; + var b10: { fn(a?: Derived): void }; + + var a11: { fn(...a: Base[]): void }; + var b11: { fn(...a: Derived[]): void }; + + //var a12: { fn(t: T, u: U): T[] }; + //var b12: { fn(a: A, b: B): A[] }; + + // operator < + var r1a1 = a1 < b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r1a2 = a2 < b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r1a3 = a3 < b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r1a4 = a4 < b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r1a5 = a5 < b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r1a6 = a6 < b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + var r1a7 = a7 < b7; + ~~ +!!! error TS2454: Variable 'a7' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b7' is used before being assigned. + var r1a8 = a8 < b8; + ~~ +!!! error TS2454: Variable 'a8' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b8' is used before being assigned. + var r1a9 = a9 < b9; + ~~ +!!! error TS2454: Variable 'a9' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b9' is used before being assigned. + var r1a10 = a10 < b10; + ~~~ +!!! error TS2454: Variable 'a10' is used before being assigned. + ~~~ +!!! error TS2454: Variable 'b10' is used before being assigned. + var r1a11 = a11 < b11; + ~~~ +!!! error TS2454: Variable 'a11' is used before being assigned. + ~~~ +!!! error TS2454: Variable 'b11' is used before being assigned. + //var r1a12 = a12 < b12; + + var r1b1 = b1 < a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r1b2 = b2 < a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r1b3 = b3 < a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r1b4 = b4 < a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r1b5 = b5 < a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r1b6 = b6 < a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + var r1b7 = b7 < a7; + ~~ +!!! error TS2454: Variable 'b7' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a7' is used before being assigned. + var r1b8 = b8 < a8; + ~~ +!!! error TS2454: Variable 'b8' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a8' is used before being assigned. + var r1b9 = b9 < a9; + ~~ +!!! error TS2454: Variable 'b9' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a9' is used before being assigned. + var r1b10 = b10 < a10; + ~~~ +!!! error TS2454: Variable 'b10' is used before being assigned. + ~~~ +!!! error TS2454: Variable 'a10' is used before being assigned. + var r1b11 = b11 < a11; + ~~~ +!!! error TS2454: Variable 'b11' is used before being assigned. + ~~~ +!!! error TS2454: Variable 'a11' is used before being assigned. + //var r1b12 = b12 < a12; + + // operator > + var r2a1 = a1 > b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r2a2 = a2 > b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r2a3 = a3 > b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r2a4 = a4 > b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r2a5 = a5 > b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r2a6 = a6 > b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + var r2a7 = a7 > b7; + ~~ +!!! error TS2454: Variable 'a7' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b7' is used before being assigned. + var r2a8 = a8 > b8; + ~~ +!!! error TS2454: Variable 'a8' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b8' is used before being assigned. + var r2a9 = a9 > b9; + ~~ +!!! error TS2454: Variable 'a9' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b9' is used before being assigned. + var r2a10 = a10 > b10; + ~~~ +!!! error TS2454: Variable 'a10' is used before being assigned. + ~~~ +!!! error TS2454: Variable 'b10' is used before being assigned. + var r2a11 = a11 > b11; + ~~~ +!!! error TS2454: Variable 'a11' is used before being assigned. + ~~~ +!!! error TS2454: Variable 'b11' is used before being assigned. + //var r2a12 = a12 > b12; + + var r2b1 = b1 > a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r2b2 = b2 > a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r2b3 = b3 > a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r2b4 = b4 > a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r2b5 = b5 > a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r2b6 = b6 > a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + var r2b7 = b7 > a7; + ~~ +!!! error TS2454: Variable 'b7' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a7' is used before being assigned. + var r2b8 = b8 > a8; + ~~ +!!! error TS2454: Variable 'b8' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a8' is used before being assigned. + var r2b9 = b9 > a9; + ~~ +!!! error TS2454: Variable 'b9' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a9' is used before being assigned. + var r2b10 = b10 > a10; + ~~~ +!!! error TS2454: Variable 'b10' is used before being assigned. + ~~~ +!!! error TS2454: Variable 'a10' is used before being assigned. + var r2b11 = b11 > a11; + ~~~ +!!! error TS2454: Variable 'b11' is used before being assigned. + ~~~ +!!! error TS2454: Variable 'a11' is used before being assigned. + //var r2b12 = b12 > a12; + + // operator <= + var r3a1 = a1 <= b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r3a2 = a2 <= b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r3a3 = a3 <= b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r3a4 = a4 <= b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r3a5 = a5 <= b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r3a6 = a6 <= b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + var r3a7 = a7 <= b7; + ~~ +!!! error TS2454: Variable 'a7' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b7' is used before being assigned. + var r3a8 = a8 <= b8; + ~~ +!!! error TS2454: Variable 'a8' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b8' is used before being assigned. + var r3a9 = a9 <= b9; + ~~ +!!! error TS2454: Variable 'a9' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b9' is used before being assigned. + var r3a10 = a10 <= b10; + ~~~ +!!! error TS2454: Variable 'a10' is used before being assigned. + ~~~ +!!! error TS2454: Variable 'b10' is used before being assigned. + var r3a11 = a11 <= b11; + ~~~ +!!! error TS2454: Variable 'a11' is used before being assigned. + ~~~ +!!! error TS2454: Variable 'b11' is used before being assigned. + //var r3a12 = a12 <= b12; + + var r3b1 = b1 <= a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r3b2 = b2 <= a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r3b3 = b3 <= a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r3b4 = b4 <= a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r3b5 = b5 <= a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r3b6 = b6 <= a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + var r3b7 = b7 <= a7; + ~~ +!!! error TS2454: Variable 'b7' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a7' is used before being assigned. + var r3b8 = b8 <= a8; + ~~ +!!! error TS2454: Variable 'b8' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a8' is used before being assigned. + var r3b9 = b9 <= a9; + ~~ +!!! error TS2454: Variable 'b9' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a9' is used before being assigned. + var r3b10 = b10 <= a10; + ~~~ +!!! error TS2454: Variable 'b10' is used before being assigned. + ~~~ +!!! error TS2454: Variable 'a10' is used before being assigned. + var r3b11 = b11 <= a11; + ~~~ +!!! error TS2454: Variable 'b11' is used before being assigned. + ~~~ +!!! error TS2454: Variable 'a11' is used before being assigned. + //var r3b12 = b12 <= a12; + + // operator >= + var r4a1 = a1 >= b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r4a2 = a2 >= b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r4a3 = a3 >= b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r4a4 = a4 >= b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r4a5 = a5 >= b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r4a6 = a6 >= b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + var r4a7 = a7 >= b7; + ~~ +!!! error TS2454: Variable 'a7' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b7' is used before being assigned. + var r4a8 = a8 >= b8; + ~~ +!!! error TS2454: Variable 'a8' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b8' is used before being assigned. + var r4a9 = a9 >= b9; + ~~ +!!! error TS2454: Variable 'a9' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b9' is used before being assigned. + var r4a10 = a10 >= b10; + ~~~ +!!! error TS2454: Variable 'a10' is used before being assigned. + ~~~ +!!! error TS2454: Variable 'b10' is used before being assigned. + var r4a11 = a11 >= b11; + ~~~ +!!! error TS2454: Variable 'a11' is used before being assigned. + ~~~ +!!! error TS2454: Variable 'b11' is used before being assigned. + //var r4a12 = a12 >= b12; + + var r4b1 = b1 >= a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r4b2 = b2 >= a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r4b3 = b3 >= a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r4b4 = b4 >= a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r4b5 = b5 >= a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r4b6 = b6 >= a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + var r4b7 = b7 >= a7; + ~~ +!!! error TS2454: Variable 'b7' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a7' is used before being assigned. + var r4b8 = b8 >= a8; + ~~ +!!! error TS2454: Variable 'b8' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a8' is used before being assigned. + var r4b9 = b9 >= a9; + ~~ +!!! error TS2454: Variable 'b9' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a9' is used before being assigned. + var r4b10 = b10 >= a10; + ~~~ +!!! error TS2454: Variable 'b10' is used before being assigned. + ~~~ +!!! error TS2454: Variable 'a10' is used before being assigned. + var r4b11 = b11 >= a11; + ~~~ +!!! error TS2454: Variable 'b11' is used before being assigned. + ~~~ +!!! error TS2454: Variable 'a11' is used before being assigned. + //var r4b12 = b12 >= a12; + + // operator == + var r5a1 = a1 == b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r5a2 = a2 == b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r5a3 = a3 == b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r5a4 = a4 == b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r5a5 = a5 == b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r5a6 = a6 == b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + var r5a7 = a7 == b7; + ~~ +!!! error TS2454: Variable 'a7' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b7' is used before being assigned. + var r5a8 = a8 == b8; + ~~ +!!! error TS2454: Variable 'a8' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b8' is used before being assigned. + var r5a9 = a9 == b9; + ~~ +!!! error TS2454: Variable 'a9' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b9' is used before being assigned. + var r5a10 = a10 == b10; + ~~~ +!!! error TS2454: Variable 'a10' is used before being assigned. + ~~~ +!!! error TS2454: Variable 'b10' is used before being assigned. + var r5a11 = a11 == b11; + ~~~ +!!! error TS2454: Variable 'a11' is used before being assigned. + ~~~ +!!! error TS2454: Variable 'b11' is used before being assigned. + //var r5a12 = a12 == b12; + + var r5b1 = b1 == a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r5b2 = b2 == a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r5b3 = b3 == a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r5b4 = b4 == a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r5b5 = b5 == a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r5b6 = b6 == a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + var r5b7 = b7 == a7; + ~~ +!!! error TS2454: Variable 'b7' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a7' is used before being assigned. + var r5b8 = b8 == a8; + ~~ +!!! error TS2454: Variable 'b8' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a8' is used before being assigned. + var r5b9 = b9 == a9; + ~~ +!!! error TS2454: Variable 'b9' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a9' is used before being assigned. + var r5b10 = b10 == a10; + ~~~ +!!! error TS2454: Variable 'b10' is used before being assigned. + ~~~ +!!! error TS2454: Variable 'a10' is used before being assigned. + var r5b11 = b11 == a11; + ~~~ +!!! error TS2454: Variable 'b11' is used before being assigned. + ~~~ +!!! error TS2454: Variable 'a11' is used before being assigned. + //var r5b12 = b12 == a12; + + // operator != + var r6a1 = a1 != b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r6a2 = a2 != b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r6a3 = a3 != b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r6a4 = a4 != b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r6a5 = a5 != b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r6a6 = a6 != b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + var r6a7 = a7 != b7; + ~~ +!!! error TS2454: Variable 'a7' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b7' is used before being assigned. + var r6a8 = a8 != b8; + ~~ +!!! error TS2454: Variable 'a8' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b8' is used before being assigned. + var r6a9 = a9 != b9; + ~~ +!!! error TS2454: Variable 'a9' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b9' is used before being assigned. + var r6a10 = a10 != b10; + ~~~ +!!! error TS2454: Variable 'a10' is used before being assigned. + ~~~ +!!! error TS2454: Variable 'b10' is used before being assigned. + var r6a11 = a11 != b11; + ~~~ +!!! error TS2454: Variable 'a11' is used before being assigned. + ~~~ +!!! error TS2454: Variable 'b11' is used before being assigned. + //var r6a12 = a12 != b12; + + var r6b1 = b1 != a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r6b2 = b2 != a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r6b3 = b3 != a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r6b4 = b4 != a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r6b5 = b5 != a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r6b6 = b6 != a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + var r6b7 = b7 != a7; + ~~ +!!! error TS2454: Variable 'b7' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a7' is used before being assigned. + var r6b8 = b8 != a8; + ~~ +!!! error TS2454: Variable 'b8' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a8' is used before being assigned. + var r6b9 = b9 != a9; + ~~ +!!! error TS2454: Variable 'b9' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a9' is used before being assigned. + var r6b10 = b10 != a10; + ~~~ +!!! error TS2454: Variable 'b10' is used before being assigned. + ~~~ +!!! error TS2454: Variable 'a10' is used before being assigned. + var r6b11 = b11 != a11; + ~~~ +!!! error TS2454: Variable 'b11' is used before being assigned. + ~~~ +!!! error TS2454: Variable 'a11' is used before being assigned. + //var r6b12 = b12 != a12; + + // operator === + var r7a1 = a1 === b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r7a2 = a2 === b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r7a3 = a3 === b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r7a4 = a4 === b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r7a5 = a5 === b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r7a6 = a6 === b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + var r7a7 = a7 === b7; + ~~ +!!! error TS2454: Variable 'a7' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b7' is used before being assigned. + var r7a8 = a8 === b8; + ~~ +!!! error TS2454: Variable 'a8' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b8' is used before being assigned. + var r7a9 = a9 === b9; + ~~ +!!! error TS2454: Variable 'a9' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b9' is used before being assigned. + var r7a10 = a10 === b10; + ~~~ +!!! error TS2454: Variable 'a10' is used before being assigned. + ~~~ +!!! error TS2454: Variable 'b10' is used before being assigned. + var r7a11 = a11 === b11; + ~~~ +!!! error TS2454: Variable 'a11' is used before being assigned. + ~~~ +!!! error TS2454: Variable 'b11' is used before being assigned. + //var r7a12 = a12 === b12; + + var r7b1 = b1 === a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r7b2 = b2 === a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r7b3 = b3 === a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r7b4 = b4 === a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r7b5 = b5 === a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r7b6 = b6 === a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + var r7b7 = b7 === a7; + ~~ +!!! error TS2454: Variable 'b7' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a7' is used before being assigned. + var r7b8 = b8 === a8; + ~~ +!!! error TS2454: Variable 'b8' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a8' is used before being assigned. + var r7b9 = b9 === a9; + ~~ +!!! error TS2454: Variable 'b9' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a9' is used before being assigned. + var r7b10 = b10 === a10; + ~~~ +!!! error TS2454: Variable 'b10' is used before being assigned. + ~~~ +!!! error TS2454: Variable 'a10' is used before being assigned. + var r7b11 = b11 === a11; + ~~~ +!!! error TS2454: Variable 'b11' is used before being assigned. + ~~~ +!!! error TS2454: Variable 'a11' is used before being assigned. + //var r7b12 = b12 === a12; + + // operator !== + var r8a1 = a1 !== b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r8a2 = a2 !== b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r8a3 = a3 !== b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r8a4 = a4 !== b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r8a5 = a5 !== b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r8a6 = a6 !== b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + var r8a7 = a7 !== b7; + ~~ +!!! error TS2454: Variable 'a7' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b7' is used before being assigned. + var r8a8 = a8 !== b8; + ~~ +!!! error TS2454: Variable 'a8' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b8' is used before being assigned. + var r8a9 = a9 !== b9; + ~~ +!!! error TS2454: Variable 'a9' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b9' is used before being assigned. + var r8a10 = a10 !== b10; + ~~~ +!!! error TS2454: Variable 'a10' is used before being assigned. + ~~~ +!!! error TS2454: Variable 'b10' is used before being assigned. + var r8a11 = a11 !== b11; + ~~~ +!!! error TS2454: Variable 'a11' is used before being assigned. + ~~~ +!!! error TS2454: Variable 'b11' is used before being assigned. + //var r8a12 = a12 !== b12; + + var r8b1 = b1 !== a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r8b2 = b2 !== a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r8b3 = b3 !== a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r8b4 = b4 !== a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r8b5 = b5 !== a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r8b6 = b6 !== a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + var r8b7 = b7 !== a7; + ~~ +!!! error TS2454: Variable 'b7' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a7' is used before being assigned. + var r8b8 = b8 !== a8; + ~~ +!!! error TS2454: Variable 'b8' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a8' is used before being assigned. + var r8b9 = b9 !== a9; + ~~ +!!! error TS2454: Variable 'b9' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a9' is used before being assigned. + var r8b10 = b10 !== a10; + ~~~ +!!! error TS2454: Variable 'b10' is used before being assigned. + ~~~ +!!! error TS2454: Variable 'a10' is used before being assigned. + var r8b11 = b11 !== a11; + ~~~ +!!! error TS2454: Variable 'b11' is used before being assigned. + ~~~ +!!! error TS2454: Variable 'a11' is used before being assigned. + //var r8b12 = b12 !== a12; \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.js index aa8deb5a7742d..e275d002ae48c 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.js @@ -262,6 +262,7 @@ var r8b11 = b11 !== a11; //var r8b12 = b12 !== a12; //// [comparisonOperatorWithSubtypeObjectOnCallSignature.js] +"use strict"; class Base { } class Derived extends Base { diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.types b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.types index 0c2b4c851d32c..8321a7fec4f6f 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.types +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.types @@ -164,16 +164,16 @@ var a10: { fn(a?: Base): void }; > : ^^^^^ ^^^ ^^^ ^^^ >fn : (a?: Base) => void > : ^ ^^^ ^^^^^ ->a : Base -> : ^^^^ +>a : Base | undefined +> : ^^^^^^^^^^^^^^^^ var b10: { fn(a?: Derived): void }; >b10 : { fn(a?: Derived): void; } > : ^^^^^ ^^^ ^^^ ^^^ >fn : (a?: Derived) => void > : ^ ^^^ ^^^^^ ->a : Derived -> : ^^^^^^^ +>a : Derived | undefined +> : ^^^^^^^^^^^^^^^^^^^ var a11: { fn(...a: Base[]): void }; >a11 : { fn(...a: Base[]): void; } diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.errors.txt b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.errors.txt new file mode 100644 index 0000000000000..2d859008ab754 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.errors.txt @@ -0,0 +1,1142 @@ +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(2,12): error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(6,12): error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(40,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(40,17): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(41,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(41,17): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(42,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(42,17): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(43,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(43,17): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(44,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(44,17): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(45,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(45,12): error TS2365: Operator '<' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: Derived) => Base'. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(45,17): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(46,12): error TS2454: Variable 'a7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(46,17): error TS2454: Variable 'b7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(47,12): error TS2454: Variable 'a8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(47,17): error TS2454: Variable 'b8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(48,12): error TS2454: Variable 'a9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(48,17): error TS2454: Variable 'b9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(51,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(51,17): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(52,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(52,17): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(53,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(53,17): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(54,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(54,17): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(55,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(55,17): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(56,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(56,12): error TS2365: Operator '<' cannot be applied to types 'new (a: Base, b: Derived) => Base' and 'new (a: Derived, b: Base) => Base'. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(56,17): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(57,12): error TS2454: Variable 'b7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(57,17): error TS2454: Variable 'a7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(58,12): error TS2454: Variable 'b8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(58,17): error TS2454: Variable 'a8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(59,12): error TS2454: Variable 'b9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(59,17): error TS2454: Variable 'a9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(63,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(63,17): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(64,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(64,17): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(65,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(65,17): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(66,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(66,17): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(67,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(67,17): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(68,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(68,12): error TS2365: Operator '>' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: Derived) => Base'. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(68,17): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(69,12): error TS2454: Variable 'a7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(69,17): error TS2454: Variable 'b7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(70,12): error TS2454: Variable 'a8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(70,17): error TS2454: Variable 'b8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(71,12): error TS2454: Variable 'a9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(71,17): error TS2454: Variable 'b9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(74,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(74,17): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(75,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(75,17): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(76,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(76,17): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(77,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(77,17): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(78,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(78,17): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(79,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(79,12): error TS2365: Operator '>' cannot be applied to types 'new (a: Base, b: Derived) => Base' and 'new (a: Derived, b: Base) => Base'. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(79,17): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(80,12): error TS2454: Variable 'b7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(80,17): error TS2454: Variable 'a7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(81,12): error TS2454: Variable 'b8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(81,17): error TS2454: Variable 'a8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(82,12): error TS2454: Variable 'b9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(82,17): error TS2454: Variable 'a9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(86,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(86,18): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(87,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(87,18): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(88,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(88,18): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(89,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(89,18): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(90,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(90,18): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(91,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(91,12): error TS2365: Operator '<=' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: Derived) => Base'. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(91,18): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(92,12): error TS2454: Variable 'a7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(92,18): error TS2454: Variable 'b7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(93,12): error TS2454: Variable 'a8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(93,18): error TS2454: Variable 'b8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(94,12): error TS2454: Variable 'a9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(94,18): error TS2454: Variable 'b9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(97,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(97,18): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(98,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(98,18): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(99,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(99,18): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(100,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(100,18): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(101,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(101,18): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(102,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(102,12): error TS2365: Operator '<=' cannot be applied to types 'new (a: Base, b: Derived) => Base' and 'new (a: Derived, b: Base) => Base'. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(102,18): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(103,12): error TS2454: Variable 'b7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(103,18): error TS2454: Variable 'a7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(104,12): error TS2454: Variable 'b8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(104,18): error TS2454: Variable 'a8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(105,12): error TS2454: Variable 'b9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(105,18): error TS2454: Variable 'a9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(109,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(109,18): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(110,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(110,18): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(111,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(111,18): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(112,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(112,18): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(113,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(113,18): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(114,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(114,12): error TS2365: Operator '>=' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: Derived) => Base'. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(114,18): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(115,12): error TS2454: Variable 'a7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(115,18): error TS2454: Variable 'b7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(116,12): error TS2454: Variable 'a8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(116,18): error TS2454: Variable 'b8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(117,12): error TS2454: Variable 'a9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(117,18): error TS2454: Variable 'b9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(120,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(120,18): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(121,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(121,18): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(122,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(122,18): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(123,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(123,18): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(124,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(124,18): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(125,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(125,12): error TS2365: Operator '>=' cannot be applied to types 'new (a: Base, b: Derived) => Base' and 'new (a: Derived, b: Base) => Base'. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(125,18): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(126,12): error TS2454: Variable 'b7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(126,18): error TS2454: Variable 'a7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(127,12): error TS2454: Variable 'b8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(127,18): error TS2454: Variable 'a8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(128,12): error TS2454: Variable 'b9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(128,18): error TS2454: Variable 'a9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(132,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(132,18): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(133,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(133,18): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(134,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(134,18): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(135,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(135,18): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(136,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(136,18): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(137,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(137,12): error TS2367: This comparison appears to be unintentional because the types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: Derived) => Base' have no overlap. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(137,18): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(138,12): error TS2454: Variable 'a7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(138,18): error TS2454: Variable 'b7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(139,12): error TS2454: Variable 'a8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(139,18): error TS2454: Variable 'b8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(140,12): error TS2454: Variable 'a9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(140,18): error TS2454: Variable 'b9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(143,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(143,18): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(144,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(144,18): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(145,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(145,18): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(146,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(146,18): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(147,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(147,18): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(148,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(148,12): error TS2367: This comparison appears to be unintentional because the types 'new (a: Base, b: Derived) => Base' and 'new (a: Derived, b: Base) => Base' have no overlap. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(148,18): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(149,12): error TS2454: Variable 'b7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(149,18): error TS2454: Variable 'a7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(150,12): error TS2454: Variable 'b8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(150,18): error TS2454: Variable 'a8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(151,12): error TS2454: Variable 'b9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(151,18): error TS2454: Variable 'a9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(155,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(155,18): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(156,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(156,18): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(157,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(157,18): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(158,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(158,18): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(159,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(159,18): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(160,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(160,12): error TS2367: This comparison appears to be unintentional because the types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: Derived) => Base' have no overlap. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(160,18): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(161,12): error TS2454: Variable 'a7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(161,18): error TS2454: Variable 'b7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(162,12): error TS2454: Variable 'a8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(162,18): error TS2454: Variable 'b8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(163,12): error TS2454: Variable 'a9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(163,18): error TS2454: Variable 'b9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(166,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(166,18): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(167,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(167,18): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(168,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(168,18): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(169,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(169,18): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(170,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(170,18): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(171,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(171,12): error TS2367: This comparison appears to be unintentional because the types 'new (a: Base, b: Derived) => Base' and 'new (a: Derived, b: Base) => Base' have no overlap. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(171,18): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(172,12): error TS2454: Variable 'b7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(172,18): error TS2454: Variable 'a7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(173,12): error TS2454: Variable 'b8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(173,18): error TS2454: Variable 'a8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(174,12): error TS2454: Variable 'b9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(174,18): error TS2454: Variable 'a9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(178,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(178,19): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(179,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(179,19): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(180,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(180,19): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(181,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(181,19): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(182,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(182,19): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(183,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(183,12): error TS2367: This comparison appears to be unintentional because the types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: Derived) => Base' have no overlap. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(183,19): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(184,12): error TS2454: Variable 'a7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(184,19): error TS2454: Variable 'b7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(185,12): error TS2454: Variable 'a8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(185,19): error TS2454: Variable 'b8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(186,12): error TS2454: Variable 'a9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(186,19): error TS2454: Variable 'b9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(189,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(189,19): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(190,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(190,19): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(191,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(191,19): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(192,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(192,19): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(193,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(193,19): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(194,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(194,12): error TS2367: This comparison appears to be unintentional because the types 'new (a: Base, b: Derived) => Base' and 'new (a: Derived, b: Base) => Base' have no overlap. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(194,19): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(195,12): error TS2454: Variable 'b7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(195,19): error TS2454: Variable 'a7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(196,12): error TS2454: Variable 'b8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(196,19): error TS2454: Variable 'a8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(197,12): error TS2454: Variable 'b9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(197,19): error TS2454: Variable 'a9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(201,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(201,19): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(202,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(202,19): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(203,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(203,19): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(204,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(204,19): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(205,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(205,19): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(206,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(206,12): error TS2367: This comparison appears to be unintentional because the types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: Derived) => Base' have no overlap. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(206,19): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(207,12): error TS2454: Variable 'a7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(207,19): error TS2454: Variable 'b7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(208,12): error TS2454: Variable 'a8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(208,19): error TS2454: Variable 'b8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(209,12): error TS2454: Variable 'a9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(209,19): error TS2454: Variable 'b9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(212,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(212,19): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(213,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(213,19): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(214,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(214,19): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(215,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(215,19): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(216,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(216,19): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(217,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(217,12): error TS2367: This comparison appears to be unintentional because the types 'new (a: Base, b: Derived) => Base' and 'new (a: Derived, b: Base) => Base' have no overlap. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(217,19): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(218,12): error TS2454: Variable 'b7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(218,19): error TS2454: Variable 'a7' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(219,12): error TS2454: Variable 'b8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(219,19): error TS2454: Variable 'a8' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(220,12): error TS2454: Variable 'b9' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts(220,19): error TS2454: Variable 'a9' is used before being assigned. + + +==== comparisonOperatorWithSubtypeObjectOnConstructorSignature.ts (306 errors) ==== + class Base { + public a: string; + ~ +!!! error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. + } + + class Derived extends Base { + public b: string; + ~ +!!! error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. + } + + var a1: { new (): Base }; + var b1: { new (): Base }; + + var a2: { new (a: number, b: string): Base }; + var b2: { new (a: number, b: string): Base }; + + var a3: { new (a: number, b: string): Base }; + var b3: { new (a: number): Base }; + + var a4: { new (a: number, b: string): Base }; + var b4: { new (): Base }; + + var a5: { new (a: Base): Base }; + var b5: { new (a: Derived): Base }; + + var a6: { new (a: Derived, b: Base): Base }; + var b6: { new (a: Base, b: Derived): Base }; + + var a7: { new (): Base }; + var b7: { new (): Derived }; + + var a8: { new (a?: Base): Base }; + var b8: { new (a?: Derived): Base }; + + var a9: { new (...a: Base[]): Base }; + var b9: { new (...a: Derived[]): Base }; + + //var a10: { (t: T, u: U): T[] }; + //var b10: { (a: A, b: B): A[] }; + + // operator < + var r1a1 = a1 < b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r1a2 = a2 < b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r1a3 = a3 < b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r1a4 = a4 < b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r1a5 = a5 < b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r1a6 = a6 < b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: Derived) => Base'. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + var r1a7 = a7 < b7; + ~~ +!!! error TS2454: Variable 'a7' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b7' is used before being assigned. + var r1a8 = a8 < b8; + ~~ +!!! error TS2454: Variable 'a8' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b8' is used before being assigned. + var r1a9 = a9 < b9; + ~~ +!!! error TS2454: Variable 'a9' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b9' is used before being assigned. + //var r1a10 = a10 < b10; + + var r1b1 = b1 < a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r1b2 = b2 < a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r1b3 = b3 < a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r1b4 = b4 < a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r1b5 = b5 < a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r1b6 = b6 < a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~~~~~~ +!!! error TS2365: Operator '<' cannot be applied to types 'new (a: Base, b: Derived) => Base' and 'new (a: Derived, b: Base) => Base'. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + var r1b7 = b7 < a7; + ~~ +!!! error TS2454: Variable 'b7' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a7' is used before being assigned. + var r1b8 = b8 < a8; + ~~ +!!! error TS2454: Variable 'b8' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a8' is used before being assigned. + var r1b9 = b9 < a9; + ~~ +!!! error TS2454: Variable 'b9' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a9' is used before being assigned. + //var r1b10 = b10 < a10; + + // operator > + var r2a1 = a1 > b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r2a2 = a2 > b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r2a3 = a3 > b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r2a4 = a4 > b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r2a5 = a5 > b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r2a6 = a6 > b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~~~~~~ +!!! error TS2365: Operator '>' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: Derived) => Base'. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + var r2a7 = a7 > b7; + ~~ +!!! error TS2454: Variable 'a7' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b7' is used before being assigned. + var r2a8 = a8 > b8; + ~~ +!!! error TS2454: Variable 'a8' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b8' is used before being assigned. + var r2a9 = a9 > b9; + ~~ +!!! error TS2454: Variable 'a9' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b9' is used before being assigned. + //var r2a10 = a10 > b10; + + var r2b1 = b1 > a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r2b2 = b2 > a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r2b3 = b3 > a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r2b4 = b4 > a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r2b5 = b5 > a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r2b6 = b6 > a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~~~~~~ +!!! error TS2365: Operator '>' cannot be applied to types 'new (a: Base, b: Derived) => Base' and 'new (a: Derived, b: Base) => Base'. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + var r2b7 = b7 > a7; + ~~ +!!! error TS2454: Variable 'b7' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a7' is used before being assigned. + var r2b8 = b8 > a8; + ~~ +!!! error TS2454: Variable 'b8' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a8' is used before being assigned. + var r2b9 = b9 > a9; + ~~ +!!! error TS2454: Variable 'b9' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a9' is used before being assigned. + //var r2b10 = b10 > a10; + + // operator <= + var r3a1 = a1 <= b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r3a2 = a2 <= b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r3a3 = a3 <= b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r3a4 = a4 <= b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r3a5 = a5 <= b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r3a6 = a6 <= b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~~~~~~~ +!!! error TS2365: Operator '<=' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: Derived) => Base'. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + var r3a7 = a7 <= b7; + ~~ +!!! error TS2454: Variable 'a7' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b7' is used before being assigned. + var r3a8 = a8 <= b8; + ~~ +!!! error TS2454: Variable 'a8' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b8' is used before being assigned. + var r3a9 = a9 <= b9; + ~~ +!!! error TS2454: Variable 'a9' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b9' is used before being assigned. + //var r3a10 = a10 <= b10; + + var r3b1 = b1 <= a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r3b2 = b2 <= a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r3b3 = b3 <= a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r3b4 = b4 <= a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r3b5 = b5 <= a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r3b6 = b6 <= a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~~~~~~~ +!!! error TS2365: Operator '<=' cannot be applied to types 'new (a: Base, b: Derived) => Base' and 'new (a: Derived, b: Base) => Base'. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + var r3b7 = b7 <= a7; + ~~ +!!! error TS2454: Variable 'b7' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a7' is used before being assigned. + var r3b8 = b8 <= a8; + ~~ +!!! error TS2454: Variable 'b8' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a8' is used before being assigned. + var r3b9 = b9 <= a9; + ~~ +!!! error TS2454: Variable 'b9' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a9' is used before being assigned. + //var r3b10 = b10 <= a10; + + // operator >= + var r4a1 = a1 >= b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r4a2 = a2 >= b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r4a3 = a3 >= b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r4a4 = a4 >= b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r4a5 = a5 >= b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r4a6 = a6 >= b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~~~~~~~ +!!! error TS2365: Operator '>=' cannot be applied to types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: Derived) => Base'. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + var r4a7 = a7 >= b7; + ~~ +!!! error TS2454: Variable 'a7' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b7' is used before being assigned. + var r4a8 = a8 >= b8; + ~~ +!!! error TS2454: Variable 'a8' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b8' is used before being assigned. + var r4a9 = a9 >= b9; + ~~ +!!! error TS2454: Variable 'a9' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b9' is used before being assigned. + //var r4a10 = a10 >= b10; + + var r4b1 = b1 >= a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r4b2 = b2 >= a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r4b3 = b3 >= a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r4b4 = b4 >= a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r4b5 = b5 >= a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r4b6 = b6 >= a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~~~~~~~ +!!! error TS2365: Operator '>=' cannot be applied to types 'new (a: Base, b: Derived) => Base' and 'new (a: Derived, b: Base) => Base'. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + var r4b7 = b7 >= a7; + ~~ +!!! error TS2454: Variable 'b7' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a7' is used before being assigned. + var r4b8 = b8 >= a8; + ~~ +!!! error TS2454: Variable 'b8' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a8' is used before being assigned. + var r4b9 = b9 >= a9; + ~~ +!!! error TS2454: Variable 'b9' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a9' is used before being assigned. + //var r4b10 = b10 >= a10; + + // operator == + var r5a1 = a1 == b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r5a2 = a2 == b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r5a3 = a3 == b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r5a4 = a4 == b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r5a5 = a5 == b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r5a6 = a6 == b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~~~~~~~ +!!! error TS2367: This comparison appears to be unintentional because the types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: Derived) => Base' have no overlap. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + var r5a7 = a7 == b7; + ~~ +!!! error TS2454: Variable 'a7' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b7' is used before being assigned. + var r5a8 = a8 == b8; + ~~ +!!! error TS2454: Variable 'a8' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b8' is used before being assigned. + var r5a9 = a9 == b9; + ~~ +!!! error TS2454: Variable 'a9' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b9' is used before being assigned. + //var r5a10 = a10 == b10; + + var r5b1 = b1 == a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r5b2 = b2 == a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r5b3 = b3 == a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r5b4 = b4 == a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r5b5 = b5 == a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r5b6 = b6 == a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~~~~~~~ +!!! error TS2367: This comparison appears to be unintentional because the types 'new (a: Base, b: Derived) => Base' and 'new (a: Derived, b: Base) => Base' have no overlap. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + var r5b7 = b7 == a7; + ~~ +!!! error TS2454: Variable 'b7' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a7' is used before being assigned. + var r5b8 = b8 == a8; + ~~ +!!! error TS2454: Variable 'b8' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a8' is used before being assigned. + var r5b9 = b9 == a9; + ~~ +!!! error TS2454: Variable 'b9' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a9' is used before being assigned. + //var r5b10 = b10 == a10; + + // operator != + var r6a1 = a1 != b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r6a2 = a2 != b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r6a3 = a3 != b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r6a4 = a4 != b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r6a5 = a5 != b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r6a6 = a6 != b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~~~~~~~ +!!! error TS2367: This comparison appears to be unintentional because the types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: Derived) => Base' have no overlap. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + var r6a7 = a7 != b7; + ~~ +!!! error TS2454: Variable 'a7' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b7' is used before being assigned. + var r6a8 = a8 != b8; + ~~ +!!! error TS2454: Variable 'a8' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b8' is used before being assigned. + var r6a9 = a9 != b9; + ~~ +!!! error TS2454: Variable 'a9' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b9' is used before being assigned. + //var r6a10 = a10 != b10; + + var r6b1 = b1 != a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r6b2 = b2 != a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r6b3 = b3 != a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r6b4 = b4 != a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r6b5 = b5 != a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r6b6 = b6 != a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~~~~~~~ +!!! error TS2367: This comparison appears to be unintentional because the types 'new (a: Base, b: Derived) => Base' and 'new (a: Derived, b: Base) => Base' have no overlap. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + var r6b7 = b7 != a7; + ~~ +!!! error TS2454: Variable 'b7' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a7' is used before being assigned. + var r6b8 = b8 != a8; + ~~ +!!! error TS2454: Variable 'b8' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a8' is used before being assigned. + var r6b9 = b9 != a9; + ~~ +!!! error TS2454: Variable 'b9' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a9' is used before being assigned. + //var r6b10 = b10 != a10; + + // operator === + var r7a1 = a1 === b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r7a2 = a2 === b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r7a3 = a3 === b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r7a4 = a4 === b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r7a5 = a5 === b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r7a6 = a6 === b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~~~~~~~~ +!!! error TS2367: This comparison appears to be unintentional because the types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: Derived) => Base' have no overlap. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + var r7a7 = a7 === b7; + ~~ +!!! error TS2454: Variable 'a7' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b7' is used before being assigned. + var r7a8 = a8 === b8; + ~~ +!!! error TS2454: Variable 'a8' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b8' is used before being assigned. + var r7a9 = a9 === b9; + ~~ +!!! error TS2454: Variable 'a9' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b9' is used before being assigned. + //var r7a10 = a10 === b10; + + var r7b1 = b1 === a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r7b2 = b2 === a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r7b3 = b3 === a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r7b4 = b4 === a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r7b5 = b5 === a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r7b6 = b6 === a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~~~~~~~~ +!!! error TS2367: This comparison appears to be unintentional because the types 'new (a: Base, b: Derived) => Base' and 'new (a: Derived, b: Base) => Base' have no overlap. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + var r7b7 = b7 === a7; + ~~ +!!! error TS2454: Variable 'b7' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a7' is used before being assigned. + var r7b8 = b8 === a8; + ~~ +!!! error TS2454: Variable 'b8' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a8' is used before being assigned. + var r7b9 = b9 === a9; + ~~ +!!! error TS2454: Variable 'b9' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a9' is used before being assigned. + //var r7b10 = b10 === a10; + + // operator !== + var r8a1 = a1 !== b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r8a2 = a2 !== b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r8a3 = a3 !== b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r8a4 = a4 !== b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r8a5 = a5 !== b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r8a6 = a6 !== b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~~~~~~~~ +!!! error TS2367: This comparison appears to be unintentional because the types 'new (a: Derived, b: Base) => Base' and 'new (a: Base, b: Derived) => Base' have no overlap. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + var r8a7 = a7 !== b7; + ~~ +!!! error TS2454: Variable 'a7' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b7' is used before being assigned. + var r8a8 = a8 !== b8; + ~~ +!!! error TS2454: Variable 'a8' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b8' is used before being assigned. + var r8a9 = a9 !== b9; + ~~ +!!! error TS2454: Variable 'a9' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b9' is used before being assigned. + //var r8a10 = a10 !== b10; + + var r8b1 = b1 !== a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r8b2 = b2 !== a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r8b3 = b3 !== a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r8b4 = b4 !== a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r8b5 = b5 !== a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r8b6 = b6 !== a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~~~~~~~~ +!!! error TS2367: This comparison appears to be unintentional because the types 'new (a: Base, b: Derived) => Base' and 'new (a: Derived, b: Base) => Base' have no overlap. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + var r8b7 = b7 !== a7; + ~~ +!!! error TS2454: Variable 'b7' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a7' is used before being assigned. + var r8b8 = b8 !== a8; + ~~ +!!! error TS2454: Variable 'b8' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a8' is used before being assigned. + var r8b9 = b9 !== a9; + ~~ +!!! error TS2454: Variable 'b9' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a9' is used before being assigned. + //var r8b10 = b10 !== a10; \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.js index 2d4e346a52335..2ac0d81560bff 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.js @@ -224,6 +224,7 @@ var r8b9 = b9 !== a9; //var r8b10 = b10 !== a10; //// [comparisonOperatorWithSubtypeObjectOnConstructorSignature.js] +"use strict"; class Base { } class Derived extends Base { diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.types b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.types index e740e0c2a8921..91c9b2202c477 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.types +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.types @@ -110,14 +110,14 @@ var b7: { new (): Derived }; var a8: { new (a?: Base): Base }; >a8 : new (a?: Base) => Base > : ^^^^^ ^^^ ^^^^^ ->a : Base -> : ^^^^ +>a : Base | undefined +> : ^^^^^^^^^^^^^^^^ var b8: { new (a?: Derived): Base }; >b8 : new (a?: Derived) => Base > : ^^^^^ ^^^ ^^^^^ ->a : Derived -> : ^^^^^^^ +>a : Derived | undefined +> : ^^^^^^^^^^^^^^^^^^^ var a9: { new (...a: Base[]): Base }; >a9 : new (...a: Base[]) => Base diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.errors.txt b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.errors.txt new file mode 100644 index 0000000000000..552f9f3ddb249 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.errors.txt @@ -0,0 +1,500 @@ +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(2,12): error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(6,12): error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(22,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(22,17): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(23,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(23,17): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(24,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(24,17): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(25,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(25,17): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(27,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(27,17): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(28,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(28,17): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(29,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(29,17): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(30,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(30,17): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(33,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(33,17): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(34,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(34,17): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(35,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(35,17): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(36,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(36,17): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(38,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(38,17): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(39,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(39,17): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(40,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(40,17): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(41,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(41,17): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(44,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(44,18): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(45,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(45,18): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(46,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(46,18): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(47,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(47,18): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(49,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(49,18): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(50,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(50,18): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(51,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(51,18): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(52,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(52,18): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(55,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(55,18): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(56,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(56,18): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(57,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(57,18): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(58,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(58,18): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(60,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(60,18): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(61,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(61,18): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(62,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(62,18): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(63,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(63,18): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(66,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(66,18): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(67,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(67,18): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(68,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(68,18): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(69,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(69,18): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(71,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(71,18): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(72,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(72,18): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(73,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(73,18): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(74,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(74,18): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(77,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(77,18): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(78,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(78,18): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(79,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(79,18): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(80,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(80,18): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(82,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(82,18): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(83,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(83,18): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(84,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(84,18): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(85,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(85,18): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(88,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(88,19): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(89,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(89,19): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(90,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(90,19): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(91,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(91,19): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(93,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(93,19): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(94,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(94,19): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(95,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(95,19): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(96,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(96,19): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(99,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(99,19): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(100,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(100,19): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(101,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(101,19): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(102,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(102,19): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(104,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(104,19): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(105,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(105,19): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(106,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(106,19): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(107,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnIndexSignature.ts(107,19): error TS2454: Variable 'a4' is used before being assigned. + + +==== comparisonOperatorWithSubtypeObjectOnIndexSignature.ts (130 errors) ==== + class Base { + public a: string; + ~ +!!! error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. + } + + class Derived extends Base { + public b: string; + ~ +!!! error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. + } + + var a1: { [a: string]: string }; + var b1: { [b: string]: string }; + + var a2: { [index: string]: Base }; + var b2: { [index: string]: Derived }; + + var a3: { [index: number]: string }; + var b3: { [index: number]: string }; + + var a4: { [index: number]: Base }; + var b4: { [index: string]: Derived }; + + // operator < + var r1a1 = a1 < b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r1a1 = a2 < b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r1a1 = a3 < b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r1a1 = a4 < b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + + var r1b1 = b1 < a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r1b1 = b2 < a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r1b1 = b3 < a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r1b1 = b4 < a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + + // operator > + var r2a1 = a1 > b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r2a1 = a2 > b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r2a1 = a3 > b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r2a1 = a4 > b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + + var r2b1 = b1 > a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r2b1 = b2 > a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r2b1 = b3 > a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r2b1 = b4 > a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + + // operator <= + var r3a1 = a1 <= b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r3a1 = a2 <= b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r3a1 = a3 <= b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r3a1 = a4 <= b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + + var r3b1 = b1 <= a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r3b1 = b2 <= a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r3b1 = b3 <= a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r3b1 = b4 <= a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + + // operator >= + var r4a1 = a1 >= b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r4a1 = a2 >= b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r4a1 = a3 >= b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r4a1 = a4 >= b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + + var r4b1 = b1 >= a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r4b1 = b2 >= a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r4b1 = b3 >= a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r4b1 = b4 >= a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + + // operator == + var r5a1 = a1 == b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r5a1 = a2 == b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r5a1 = a3 == b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r5a1 = a4 == b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + + var r5b1 = b1 == a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r5b1 = b2 == a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r5b1 = b3 == a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r5b1 = b4 == a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + + // operator != + var r6a1 = a1 != b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r6a1 = a2 != b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r6a1 = a3 != b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r6a1 = a4 != b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + + var r6b1 = b1 != a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r6b1 = b2 != a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r6b1 = b3 != a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r6b1 = b4 != a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + + // operator === + var r7a1 = a1 === b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r7a1 = a2 === b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r7a1 = a3 === b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r7a1 = a4 === b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + + var r7b1 = b1 === a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r7b1 = b2 === a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r7b1 = b3 === a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r7b1 = b4 === a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + + // operator !== + var r8a1 = a1 !== b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r8a1 = a2 !== b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r8a1 = a3 !== b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r8a1 = a4 !== b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + + var r8b1 = b1 !== a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r8b1 = b2 !== a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r8b1 = b3 !== a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r8b1 = b4 !== a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.js index 5e3019052937e..2a4804fa95fbf 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.js @@ -110,6 +110,7 @@ var r8b1 = b3 !== a3; var r8b1 = b4 !== a4; //// [comparisonOperatorWithSubtypeObjectOnIndexSignature.js] +"use strict"; class Base { } class Derived extends Base { diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.errors.txt b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.errors.txt new file mode 100644 index 0000000000000..0977af70ef3d0 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.errors.txt @@ -0,0 +1,749 @@ +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(2,12): error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(6,12): error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(31,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(31,17): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(32,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(32,17): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(33,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(33,17): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(34,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(34,17): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(35,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(35,17): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(36,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(36,17): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(39,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(39,17): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(40,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(40,17): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(41,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(41,17): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(42,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(42,17): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(43,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(43,17): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(44,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(44,17): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(48,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(48,17): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(49,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(49,17): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(50,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(50,17): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(51,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(51,17): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(52,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(52,17): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(53,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(53,17): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(56,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(56,17): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(57,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(57,17): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(58,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(58,17): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(59,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(59,17): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(60,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(60,17): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(61,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(61,17): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(65,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(65,18): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(66,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(66,18): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(67,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(67,18): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(68,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(68,18): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(69,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(69,18): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(70,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(70,18): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(73,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(73,18): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(74,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(74,18): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(75,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(75,18): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(76,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(76,18): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(77,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(77,18): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(78,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(78,18): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(82,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(82,18): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(83,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(83,18): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(84,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(84,18): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(85,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(85,18): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(86,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(86,18): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(87,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(87,18): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(90,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(90,18): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(91,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(91,18): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(92,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(92,18): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(93,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(93,18): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(94,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(94,18): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(95,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(95,18): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(99,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(99,18): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(100,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(100,18): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(101,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(101,18): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(102,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(102,18): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(103,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(103,18): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(104,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(104,18): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(107,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(107,18): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(108,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(108,18): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(109,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(109,18): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(110,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(110,18): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(111,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(111,18): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(112,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(112,18): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(116,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(116,18): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(117,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(117,18): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(118,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(118,18): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(119,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(119,18): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(120,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(120,18): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(121,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(121,18): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(124,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(124,18): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(125,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(125,18): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(126,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(126,18): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(127,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(127,18): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(128,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(128,18): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(129,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(129,18): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(133,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(133,19): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(134,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(134,19): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(135,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(135,19): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(136,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(136,19): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(137,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(137,19): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(138,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(138,19): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(141,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(141,19): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(142,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(142,19): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(143,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(143,19): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(144,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(144,19): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(145,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(145,19): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(146,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(146,19): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(150,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(150,19): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(151,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(151,19): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(152,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(152,19): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(153,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(153,19): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(154,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(154,19): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(155,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(155,19): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(158,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(158,19): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(159,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(159,19): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(160,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(160,19): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(161,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(161,19): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(162,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(162,19): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(163,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts(163,19): error TS2454: Variable 'a6' is used before being assigned. + + +==== comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.ts (194 errors) ==== + class Base { + public a: string; + ~ +!!! error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. + } + + class Derived extends Base { + public b: string; + ~ +!!! error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. + } + + var a1: { fn(x: T): T }; + var b1: { fn(x: string): string }; + + var a2: { fn(x: T): T }; + var b2: { fn(x: string, y: number): string }; + + var a3: { fn(x: T, y: U): T }; + var b3: { fn(x: string, y: number): string }; + + var a4: { fn(x?: T): T }; + var b4: { fn(x?: string): string }; + + var a5: { fn(...x: T[]): T }; + var b5: { fn(...x: string[]): string }; + + var a6: { fn(x: T, y: T): T }; + var b6: { fn(x: string, y: number): {} }; + + //var a7: { fn(x: T, y: U): T }; + var b7: { fn(x: Base, y: Derived): Base }; + + // operator < + var r1a1 = a1 < b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r1a2 = a2 < b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r1a3 = a3 < b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r1a4 = a4 < b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r1a5 = a5 < b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r1a6 = a6 < b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + //var r1a7 = a7 < b7; + + var r1b1 = b1 < a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r1b2 = b2 < a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r1b3 = b3 < a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r1b4 = b4 < a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r1b5 = b5 < a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r1b6 = b6 < a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + //var r1b7 = b7 < a7; + + // operator > + var r2a1 = a1 > b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r2a2 = a2 > b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r2a3 = a3 > b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r2a4 = a4 > b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r2a5 = a5 > b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r2a6 = a6 > b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + //var r2a7 = a7 > b7; + + var r2b1 = b1 > a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r2b2 = b2 > a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r2b3 = b3 > a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r2b4 = b4 > a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r2b5 = b5 > a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r2b6 = b6 > a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + //var r2b7 = b7 > a7; + + // operator <= + var r3a1 = a1 <= b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r3a2 = a2 <= b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r3a3 = a3 <= b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r3a4 = a4 <= b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r3a5 = a5 <= b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r3a6 = a6 <= b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + //var r3a7 = a7 <= b7; + + var r3b1 = b1 <= a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r3b2 = b2 <= a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r3b3 = b3 <= a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r3b4 = b4 <= a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r3b5 = b5 <= a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r3b6 = b6 <= a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + //var r3b7 = b7 <= a7; + + // operator >= + var r4a1 = a1 >= b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r4a2 = a2 >= b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r4a3 = a3 >= b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r4a4 = a4 >= b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r4a5 = a5 >= b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r4a6 = a6 >= b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + //var r4a7 = a7 >= b7; + + var r4b1 = b1 >= a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r4b2 = b2 >= a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r4b3 = b3 >= a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r4b4 = b4 >= a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r4b5 = b5 >= a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r4b6 = b6 >= a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + //var r4b7 = b7 >= a7; + + // operator == + var r5a1 = a1 == b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r5a2 = a2 == b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r5a3 = a3 == b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r5a4 = a4 == b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r5a5 = a5 == b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r5a6 = a6 == b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + //var r5a7 = a7 == b7; + + var r5b1 = b1 == a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r5b2 = b2 == a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r5b3 = b3 == a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r5b4 = b4 == a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r5b5 = b5 == a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r5b6 = b6 == a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + //var r5b7 = b7 == a7; + + // operator != + var r6a1 = a1 != b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r6a2 = a2 != b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r6a3 = a3 != b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r6a4 = a4 != b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r6a5 = a5 != b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r6a6 = a6 != b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + //var r6a7 = a7 != b7; + + var r6b1 = b1 != a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r6b2 = b2 != a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r6b3 = b3 != a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r6b4 = b4 != a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r6b5 = b5 != a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r6b6 = b6 != a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + //var r6b7 = b7 != a7; + + // operator === + var r7a1 = a1 === b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r7a2 = a2 === b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r7a3 = a3 === b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r7a4 = a4 === b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r7a5 = a5 === b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r7a6 = a6 === b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + //var r7a7 = a7 === b7; + + var r7b1 = b1 === a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r7b2 = b2 === a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r7b3 = b3 === a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r7b4 = b4 === a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r7b5 = b5 === a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r7b6 = b6 === a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + //var r7b7 = b7 === a7; + + // operator !== + var r8a1 = a1 !== b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r8a2 = a2 !== b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r8a3 = a3 !== b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r8a4 = a4 !== b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r8a5 = a5 !== b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r8a6 = a6 !== b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + //var r8a7 = a7 !== b7; + + var r8b1 = b1 !== a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r8b2 = b2 !== a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r8b3 = b3 !== a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r8b4 = b4 !== a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r8b5 = b5 !== a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r8b6 = b6 !== a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + //var r8b7 = b7 !== a7; \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js index f7eff528797b4..fece91fd5a64c 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js @@ -167,6 +167,7 @@ var r8b6 = b6 !== a6; //var r8b7 = b7 !== a7; //// [comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js] +"use strict"; class Base { } class Derived extends Base { diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.types b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.types index 553082c6e33b2..1e4a7c1eca338 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.types +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.types @@ -80,16 +80,16 @@ var a4: { fn(x?: T): T }; > : ^^^^^ ^^ ^^^ ^^^ ^^^ >fn : (x?: T) => T > : ^ ^^ ^^^ ^^^^^ ->x : T -> : ^ +>x : T | undefined +> : ^^^^^^^^^^^^^ var b4: { fn(x?: string): string }; >b4 : { fn(x?: string): string; } > : ^^^^^ ^^^ ^^^ ^^^ >fn : (x?: string) => string > : ^ ^^^ ^^^^^ ->x : string -> : ^^^^^^ +>x : string | undefined +> : ^^^^^^^^^^^^^^^^^^ var a5: { fn(...x: T[]): T }; >a5 : { fn(...x: T[]): T; } diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.errors.txt b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.errors.txt new file mode 100644 index 0000000000000..7a2e86238c1d3 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.errors.txt @@ -0,0 +1,749 @@ +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(2,12): error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(6,12): error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(31,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(31,17): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(32,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(32,17): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(33,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(33,17): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(34,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(34,17): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(35,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(35,17): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(36,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(36,17): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(39,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(39,17): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(40,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(40,17): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(41,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(41,17): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(42,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(42,17): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(43,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(43,17): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(44,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(44,17): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(48,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(48,17): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(49,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(49,17): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(50,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(50,17): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(51,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(51,17): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(52,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(52,17): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(53,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(53,17): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(56,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(56,17): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(57,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(57,17): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(58,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(58,17): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(59,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(59,17): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(60,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(60,17): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(61,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(61,17): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(65,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(65,18): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(66,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(66,18): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(67,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(67,18): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(68,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(68,18): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(69,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(69,18): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(70,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(70,18): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(73,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(73,18): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(74,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(74,18): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(75,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(75,18): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(76,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(76,18): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(77,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(77,18): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(78,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(78,18): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(82,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(82,18): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(83,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(83,18): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(84,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(84,18): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(85,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(85,18): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(86,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(86,18): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(87,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(87,18): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(90,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(90,18): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(91,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(91,18): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(92,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(92,18): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(93,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(93,18): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(94,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(94,18): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(95,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(95,18): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(99,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(99,18): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(100,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(100,18): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(101,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(101,18): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(102,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(102,18): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(103,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(103,18): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(104,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(104,18): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(107,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(107,18): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(108,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(108,18): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(109,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(109,18): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(110,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(110,18): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(111,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(111,18): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(112,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(112,18): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(116,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(116,18): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(117,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(117,18): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(118,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(118,18): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(119,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(119,18): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(120,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(120,18): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(121,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(121,18): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(124,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(124,18): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(125,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(125,18): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(126,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(126,18): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(127,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(127,18): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(128,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(128,18): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(129,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(129,18): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(133,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(133,19): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(134,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(134,19): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(135,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(135,19): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(136,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(136,19): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(137,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(137,19): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(138,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(138,19): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(141,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(141,19): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(142,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(142,19): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(143,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(143,19): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(144,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(144,19): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(145,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(145,19): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(146,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(146,19): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(150,12): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(150,19): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(151,12): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(151,19): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(152,12): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(152,19): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(153,12): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(153,19): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(154,12): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(154,19): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(155,12): error TS2454: Variable 'a6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(155,19): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(158,12): error TS2454: Variable 'b1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(158,19): error TS2454: Variable 'a1' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(159,12): error TS2454: Variable 'b2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(159,19): error TS2454: Variable 'a2' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(160,12): error TS2454: Variable 'b3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(160,19): error TS2454: Variable 'a3' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(161,12): error TS2454: Variable 'b4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(161,19): error TS2454: Variable 'a4' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(162,12): error TS2454: Variable 'b5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(162,19): error TS2454: Variable 'a5' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(163,12): error TS2454: Variable 'b6' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts(163,19): error TS2454: Variable 'a6' is used before being assigned. + + +==== comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.ts (194 errors) ==== + class Base { + public a: string; + ~ +!!! error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. + } + + class Derived extends Base { + public b: string; + ~ +!!! error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor. + } + + var a1: { new (x: T): T }; + var b1: { new (x: string): string }; + + var a2: { new (x: T): T }; + var b2: { new (x: string, y: number): string }; + + var a3: { new (x: T, y: U): T }; + var b3: { new (x: string, y: number): string }; + + var a4: { new (x?: T): T }; + var b4: { new (x?: string): string }; + + var a5: { new (...x: T[]): T }; + var b5: { new (...x: string[]): string }; + + var a6: { new (x: T, y: T): T }; + var b6: { new (x: string, y: number): {} }; + + //var a7: { new (x: T, y: U): T }; + var b7: { new (x: Base, y: Derived): Base }; + + // operator < + var r1a1 = a1 < b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r1a2 = a2 < b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r1a3 = a3 < b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r1a4 = a4 < b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r1a5 = a5 < b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r1a6 = a6 < b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + //var r1a7 = a7 < b7; + + var r1b1 = b1 < a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r1b2 = b2 < a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r1b3 = b3 < a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r1b4 = b4 < a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r1b5 = b5 < a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r1b6 = b6 < a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + //var r1b7 = b7 < a7; + + // operator > + var r2a1 = a1 > b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r2a2 = a2 > b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r2a3 = a3 > b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r2a4 = a4 > b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r2a5 = a5 > b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r2a6 = a6 > b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + //var r2a7 = a7 > b7; + + var r2b1 = b1 > a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r2b2 = b2 > a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r2b3 = b3 > a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r2b4 = b4 > a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r2b5 = b5 > a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r2b6 = b6 > a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + //var r2b7 = b7 > a7; + + // operator <= + var r3a1 = a1 <= b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r3a2 = a2 <= b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r3a3 = a3 <= b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r3a4 = a4 <= b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r3a5 = a5 <= b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r3a6 = a6 <= b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + //var r3a7 = a7 <= b7; + + var r3b1 = b1 <= a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r3b2 = b2 <= a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r3b3 = b3 <= a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r3b4 = b4 <= a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r3b5 = b5 <= a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r3b6 = b6 <= a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + //var r3b7 = b7 <= a7; + + // operator >= + var r4a1 = a1 >= b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r4a2 = a2 >= b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r4a3 = a3 >= b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r4a4 = a4 >= b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r4a5 = a5 >= b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r4a6 = a6 >= b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + //var r4a7 = a7 >= b7; + + var r4b1 = b1 >= a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r4b2 = b2 >= a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r4b3 = b3 >= a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r4b4 = b4 >= a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r4b5 = b5 >= a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r4b6 = b6 >= a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + //var r4b7 = b7 >= a7; + + // operator == + var r5a1 = a1 == b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r5a2 = a2 == b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r5a3 = a3 == b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r5a4 = a4 == b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r5a5 = a5 == b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r5a6 = a6 == b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + //var r5a7 = a7 == b7; + + var r5b1 = b1 == a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r5b2 = b2 == a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r5b3 = b3 == a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r5b4 = b4 == a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r5b5 = b5 == a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r5b6 = b6 == a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + //var r5b7 = b7 == a7; + + // operator != + var r6a1 = a1 != b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r6a2 = a2 != b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r6a3 = a3 != b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r6a4 = a4 != b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r6a5 = a5 != b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r6a6 = a6 != b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + //var r6a7 = a7 != b7; + + var r6b1 = b1 != a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r6b2 = b2 != a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r6b3 = b3 != a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r6b4 = b4 != a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r6b5 = b5 != a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r6b6 = b6 != a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + //var r6b7 = b7 != a7; + + // operator === + var r7a1 = a1 === b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r7a2 = a2 === b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r7a3 = a3 === b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r7a4 = a4 === b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r7a5 = a5 === b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r7a6 = a6 === b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + //var r7a7 = a7 === b7; + + var r7b1 = b1 === a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r7b2 = b2 === a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r7b3 = b3 === a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r7b4 = b4 === a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r7b5 = b5 === a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r7b6 = b6 === a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + //var r7b7 = b7 === a7; + + // operator !== + var r8a1 = a1 !== b1; + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + var r8a2 = a2 !== b2; + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + var r8a3 = a3 !== b3; + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + var r8a4 = a4 !== b4; + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + var r8a5 = a5 !== b5; + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + var r8a6 = a6 !== b6; + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + //var r8a7 = a7 !== b7; + + var r8b1 = b1 !== a1; + ~~ +!!! error TS2454: Variable 'b1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a1' is used before being assigned. + var r8b2 = b2 !== a2; + ~~ +!!! error TS2454: Variable 'b2' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a2' is used before being assigned. + var r8b3 = b3 !== a3; + ~~ +!!! error TS2454: Variable 'b3' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a3' is used before being assigned. + var r8b4 = b4 !== a4; + ~~ +!!! error TS2454: Variable 'b4' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a4' is used before being assigned. + var r8b5 = b5 !== a5; + ~~ +!!! error TS2454: Variable 'b5' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a5' is used before being assigned. + var r8b6 = b6 !== a6; + ~~ +!!! error TS2454: Variable 'b6' is used before being assigned. + ~~ +!!! error TS2454: Variable 'a6' is used before being assigned. + //var r8b7 = b7 !== a7; \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js index 317c436443d5f..19c07dde1bd9e 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js @@ -167,6 +167,7 @@ var r8b6 = b6 !== a6; //var r8b7 = b7 !== a7; //// [comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js] +"use strict"; class Base { } class Derived extends Base { diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.types b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.types index 454954ac0c783..61650b357ac6f 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.types +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.types @@ -66,14 +66,14 @@ var b3: { new (x: string, y: number): string }; var a4: { new (x?: T): T }; >a4 : new (x?: T) => T > : ^^^^^ ^^ ^^^ ^^^^^ ->x : T -> : ^ +>x : T | undefined +> : ^^^^^^^^^^^^^ var b4: { new (x?: string): string }; >b4 : new (x?: string) => string > : ^^^^^ ^^^ ^^^^^ ->x : string -> : ^^^^^^ +>x : string | undefined +> : ^^^^^^^^^^^^^^^^^^ var a5: { new (...x: T[]): T }; >a5 : new (...x: T[]) => T diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnOptionalProperty.errors.txt b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnOptionalProperty.errors.txt new file mode 100644 index 0000000000000..dd5f58a077991 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnOptionalProperty.errors.txt @@ -0,0 +1,142 @@ +comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts(14,11): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts(14,15): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts(15,11): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts(15,15): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts(18,11): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts(18,15): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts(19,11): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts(19,15): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts(22,11): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts(22,16): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts(23,11): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts(23,16): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts(26,11): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts(26,16): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts(27,11): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts(27,16): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts(30,11): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts(30,16): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts(31,11): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts(31,16): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts(34,11): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts(34,16): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts(35,11): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts(35,16): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts(38,11): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts(38,17): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts(39,11): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts(39,17): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts(42,11): error TS2454: Variable 'a' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts(42,17): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts(43,11): error TS2454: Variable 'b' is used before being assigned. +comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts(43,17): error TS2454: Variable 'a' is used before being assigned. + + +==== comparisonOperatorWithSubtypeObjectOnOptionalProperty.ts (32 errors) ==== + interface I { + a: string; + b?: number; + } + + interface J { + a: string; + } + + var a: I; + var b: J; + + // operator < + var ra1 = a < b; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var ra2 = b < a; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + + // operator > + var rb1 = a > b; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rb2 = b > a; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + + // operator <= + var rc1 = a <= b; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rc2 = b <= a; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + + // operator >= + var rd1 = a >= b; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rd2 = b >= a; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + + // operator == + var re1 = a == b; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var re2 = b == a; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + + // operator != + var rf1 = a != b; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rf2 = b != a; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + + // operator === + var rg1 = a === b; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rg2 = b === a; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + + // operator !== + var rh1 = a !== b; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + var rh2 = b !== a; + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + ~ +!!! error TS2454: Variable 'a' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnOptionalProperty.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnOptionalProperty.js index 6ce9ef250ee14..81aebebb34939 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnOptionalProperty.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnOptionalProperty.js @@ -46,6 +46,7 @@ var rh1 = a !== b; var rh2 = b !== a; //// [comparisonOperatorWithSubtypeObjectOnOptionalProperty.js] +"use strict"; var a; var b; // operator < diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnOptionalProperty.types b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnOptionalProperty.types index 14aa1e794c52d..b2c96f0f79805 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnOptionalProperty.types +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnOptionalProperty.types @@ -7,8 +7,8 @@ interface I { > : ^^^^^^ b?: number; ->b : number -> : ^^^^^^ +>b : number | undefined +> : ^^^^^^^^^^^^^^^^^^ } interface J { diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.js index 6ded99efc041e..f474c34972c36 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.js @@ -81,6 +81,7 @@ var rh3 = b1 !== a1; var rh4 = b2 !== a2; //// [comparisonOperatorWithSubtypeObjectOnProperty.js] +"use strict"; class Base { } class Derived extends Base { diff --git a/tests/baselines/reference/comparisonOperatorWithTwoOperandsAreAny.js b/tests/baselines/reference/comparisonOperatorWithTwoOperandsAreAny.js index 644e2758f3eb7..a8d83eb112a1b 100644 --- a/tests/baselines/reference/comparisonOperatorWithTwoOperandsAreAny.js +++ b/tests/baselines/reference/comparisonOperatorWithTwoOperandsAreAny.js @@ -13,6 +13,7 @@ var r7 = a === a; var r8 = a !== a; //// [comparisonOperatorWithTwoOperandsAreAny.js] +"use strict"; var a; var r1 = a < a; var r2 = a > a; diff --git a/tests/baselines/reference/comparisonOperatorWithTypeParameter.js b/tests/baselines/reference/comparisonOperatorWithTypeParameter.js index 9bcb5e307ea3e..07d51e603ea82 100644 --- a/tests/baselines/reference/comparisonOperatorWithTypeParameter.js +++ b/tests/baselines/reference/comparisonOperatorWithTypeParameter.js @@ -81,6 +81,7 @@ function foo(t: T, u: U, v: V) { } //// [comparisonOperatorWithTypeParameter.js] +"use strict"; var a; var b; function foo(t, u, v) { diff --git a/tests/baselines/reference/compileOnSaveWorksWhenEmitBlockingErrorOnOtherFile.baseline b/tests/baselines/reference/compileOnSaveWorksWhenEmitBlockingErrorOnOtherFile.baseline index 596a2e7819e0e..7993019ac4d2c 100644 --- a/tests/baselines/reference/compileOnSaveWorksWhenEmitBlockingErrorOnOtherFile.baseline +++ b/tests/baselines/reference/compileOnSaveWorksWhenEmitBlockingErrorOnOtherFile.baseline @@ -7,5 +7,6 @@ Diagnostics: EmitSkipped: false FileName : /tests/cases/fourslash/a.js +"use strict"; function foo2() { return 30; } // no error - should emit a.js diff --git a/tests/baselines/reference/completionEntryForUnionMethod.baseline b/tests/baselines/reference/completionEntryForUnionMethod.baseline index c0e0ccc7c838d..8b61cd99f38c6 100644 --- a/tests/baselines/reference/completionEntryForUnionMethod.baseline +++ b/tests/baselines/reference/completionEntryForUnionMethod.baseline @@ -8,20 +8,20 @@ // | (method) Array.every(predicate: (value: string | number, index: number, array: (string | number)[]) => value is S, thisArg?: any): this is S[] (+1 overload) // | (method) Array.filter(predicate: (value: string | number, index: number, array: (string | number)[]) => value is S, thisArg?: any): S[] (+1 overload) // | (method) Array.forEach(callbackfn: ((value: string, index: number, array: string[]) => void) & ((value: number, index: number, array: number[]) => void), thisArg?: any): void -// | (method) Array.indexOf(searchElement: never, fromIndex?: number): number +// | (method) Array.indexOf(searchElement: never, fromIndex?: number | undefined): number // | (method) Array.join(separator?: string): string -// | (method) Array.lastIndexOf(searchElement: never, fromIndex?: number): number +// | (method) Array.lastIndexOf(searchElement: never, fromIndex?: number | undefined): number // | (property) Array.length: number // | (method) Array.map(callbackfn: ((value: string, index: number, array: string[]) => unknown) & ((value: number, index: number, array: number[]) => unknown), thisArg?: any): unknown[] -// | (method) Array.pop(): string | number +// | (method) Array.pop(): string | number | undefined // | (method) Array.push(...items: never[]): number // | (method) Array.reduce(callbackfn: (previousValue: string | number, currentValue: string | number, currentIndex: number, array: (string | number)[]) => string | number): string | number (+2 overloads) // | (method) Array.reduceRight(callbackfn: (previousValue: string | number, currentValue: string | number, currentIndex: number, array: (string | number)[]) => string | number): string | number (+2 overloads) // | (method) Array.reverse(): string[] | number[] -// | (method) Array.shift(): string | number +// | (method) Array.shift(): string | number | undefined // | (method) Array.slice(start?: number, end?: number): string[] | number[] // | (method) Array.some(predicate: ((value: string, index: number, array: string[]) => unknown) & ((value: number, index: number, array: number[]) => unknown), thisArg?: any): boolean -// | (method) Array.sort(compareFn?: ((a: string, b: string) => number) & ((a: number, b: number) => number)): string[] | number[] +// | (method) Array.sort(compareFn?: (((a: string, b: string) => number) & ((a: number, b: number) => number)) | undefined): string[] | number[] // | (method) Array.splice(start: number, deleteCount?: number): string[] | number[] (+2 overloads) // | (method) Array.toLocaleString(): string // | (method) Array.toString(): string @@ -1434,6 +1434,22 @@ "text": "number", "kind": "keyword" }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "undefined", + "kind": "keyword" + }, { "text": ")", "kind": "punctuation" @@ -1701,6 +1717,22 @@ "text": "number", "kind": "keyword" }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "undefined", + "kind": "keyword" + }, { "text": ")", "kind": "punctuation" @@ -2298,6 +2330,22 @@ { "text": "number", "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "undefined", + "kind": "keyword" } ], "documentation": [ @@ -3331,6 +3379,22 @@ { "text": "number", "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "undefined", + "kind": "keyword" } ], "documentation": [ @@ -3974,6 +4038,10 @@ "text": "(", "kind": "punctuation" }, + { + "text": "(", + "kind": "punctuation" + }, { "text": "a", "kind": "parameterName" @@ -4126,6 +4194,26 @@ "text": ")", "kind": "punctuation" }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "undefined", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, { "text": ":", "kind": "punctuation" diff --git a/tests/baselines/reference/completionImportAttributes.baseline b/tests/baselines/reference/completionImportAttributes.baseline index 4634c7da5a327..f85a8e78bab4e 100644 --- a/tests/baselines/reference/completionImportAttributes.baseline +++ b/tests/baselines/reference/completionImportAttributes.baseline @@ -3,14 +3,14 @@ // import("./other.json", {}); // ^ // | ---------------------------------------------------------------------- -// | (property) ImportCallOptions.with?: ImportAttributes -// | (property) ImportCallOptions.assert?: ImportAssertions +// | (property) ImportCallOptions.with?: ImportAttributes | undefined +// | (property) ImportCallOptions.assert?: ImportAssertions | undefined // | ---------------------------------------------------------------------- // import("./other.json", { wi}); // ^^ // | ---------------------------------------------------------------------- -// | (property) ImportCallOptions.with?: ImportAttributes -// | (property) ImportCallOptions.assert?: ImportAssertions +// | (property) ImportCallOptions.with?: ImportAttributes | undefined +// | (property) ImportCallOptions.assert?: ImportAssertions | undefined // | ---------------------------------------------------------------------- [ @@ -75,6 +75,22 @@ { "text": "ImportAttributes", "kind": "interfaceName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "undefined", + "kind": "keyword" } ], "documentation": [] @@ -128,6 +144,22 @@ { "text": "ImportAssertions", "kind": "interfaceName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "undefined", + "kind": "keyword" } ], "documentation": [], @@ -210,6 +242,22 @@ { "text": "ImportAttributes", "kind": "interfaceName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "undefined", + "kind": "keyword" } ], "documentation": [] @@ -263,6 +311,22 @@ { "text": "ImportAssertions", "kind": "interfaceName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "undefined", + "kind": "keyword" } ], "documentation": [], diff --git a/tests/baselines/reference/completionImportCallAssertion.baseline b/tests/baselines/reference/completionImportCallAssertion.baseline index e70b0465d376b..9e2a7c8734ffb 100644 --- a/tests/baselines/reference/completionImportCallAssertion.baseline +++ b/tests/baselines/reference/completionImportCallAssertion.baseline @@ -3,14 +3,14 @@ // import("./other.json", {}); // ^ // | ---------------------------------------------------------------------- -// | (property) ImportCallOptions.with?: ImportAttributes -// | (property) ImportCallOptions.assert?: ImportAssertions +// | (property) ImportCallOptions.with?: ImportAttributes | undefined +// | (property) ImportCallOptions.assert?: ImportAssertions | undefined // | ---------------------------------------------------------------------- // import("./other.json", { asse}); // ^^^^ // | ---------------------------------------------------------------------- -// | (property) ImportCallOptions.with?: ImportAttributes -// | (property) ImportCallOptions.assert?: ImportAssertions +// | (property) ImportCallOptions.with?: ImportAttributes | undefined +// | (property) ImportCallOptions.assert?: ImportAssertions | undefined // | ---------------------------------------------------------------------- [ @@ -75,6 +75,22 @@ { "text": "ImportAttributes", "kind": "interfaceName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "undefined", + "kind": "keyword" } ], "documentation": [] @@ -128,6 +144,22 @@ { "text": "ImportAssertions", "kind": "interfaceName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "undefined", + "kind": "keyword" } ], "documentation": [], @@ -210,6 +242,22 @@ { "text": "ImportAttributes", "kind": "interfaceName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "undefined", + "kind": "keyword" } ], "documentation": [] @@ -263,6 +311,22 @@ { "text": "ImportAssertions", "kind": "interfaceName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "undefined", + "kind": "keyword" } ], "documentation": [], diff --git a/tests/baselines/reference/completionPropertyFromConstraint.baseline b/tests/baselines/reference/completionPropertyFromConstraint.baseline index b2842d70d499f..a96493c3be7b7 100644 --- a/tests/baselines/reference/completionPropertyFromConstraint.baseline +++ b/tests/baselines/reference/completionPropertyFromConstraint.baseline @@ -19,9 +19,9 @@ // '': '' // ^ // | ---------------------------------------------------------------------- -// | (property) alignContent?: string -// | (property) alignItems?: string -// | (property) alignmentBaseline?: string +// | (property) alignContent?: string | null | undefined +// | (property) alignItems?: string | null | undefined +// | (property) alignmentBaseline?: string | null | undefined // | ---------------------------------------------------------------------- // } // }); @@ -87,6 +87,38 @@ { "text": "string", "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "null", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "undefined", + "kind": "keyword" } ], "documentation": [] @@ -136,6 +168,38 @@ { "text": "string", "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "null", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "undefined", + "kind": "keyword" } ], "documentation": [] @@ -185,6 +249,38 @@ { "text": "string", "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "null", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "undefined", + "kind": "keyword" } ], "documentation": [] diff --git a/tests/baselines/reference/completionsCommentsClassMembers.baseline b/tests/baselines/reference/completionsCommentsClassMembers.baseline index ff25fd4893846..83b68c30f5a4f 100644 --- a/tests/baselines/reference/completionsCommentsClassMembers.baseline +++ b/tests/baselines/reference/completionsCommentsClassMembers.baseline @@ -926,10 +926,10 @@ // | (property) c1.s1: number // | (method) c1.s2(b: number): number // | (property) c1.s3: number -// | (method) Function.apply(this: Function, thisArg: any, argArray?: any): any +// | (method) NewableFunction.apply(this: new () => T, thisArg: T): void (+1 overload) // | (property) Function.arguments: any -// | (method) Function.bind(this: Function, thisArg: any, ...argArray: any[]): any -// | (method) Function.call(this: Function, thisArg: any, ...argArray: any[]): any +// | (method) NewableFunction.bind(this: T, thisArg: any): T (+1 overload) +// | (method) NewableFunction.call(this: new (...args: A) => T, thisArg: T, ...args: A): void // | (property) Function.caller: Function // | (property) Function.length: number // | (property) c1.prototype: c1 @@ -1238,10 +1238,10 @@ // | (property) c1.s1: number // | (method) c1.s2(b: number): number // | (property) c1.s3: number -// | (method) Function.apply(this: Function, thisArg: any, argArray?: any): any +// | (method) NewableFunction.apply(this: new () => T, thisArg: T): void (+1 overload) // | (property) Function.arguments: any -// | (method) Function.bind(this: Function, thisArg: any, ...argArray: any[]): any -// | (method) Function.call(this: Function, thisArg: any, ...argArray: any[]): any +// | (method) NewableFunction.bind(this: T, thisArg: any): T (+1 overload) +// | (method) NewableFunction.call(this: new (...args: A) => T, thisArg: T, ...args: A): void // | (property) Function.caller: Function // | (property) Function.length: number // | (property) c1.prototype: c1 @@ -1400,10 +1400,10 @@ // | (property) c1.s1: number // | (method) c1.s2(b: number): number // | (property) c1.s3: number -// | (method) Function.apply(this: Function, thisArg: any, argArray?: any): any +// | (method) NewableFunction.apply(this: new () => T, thisArg: T): void (+1 overload) // | (property) Function.arguments: any -// | (method) Function.bind(this: Function, thisArg: any, ...argArray: any[]): any -// | (method) Function.call(this: Function, thisArg: any, ...argArray: any[]): any +// | (method) NewableFunction.bind(this: T, thisArg: any): T (+1 overload) +// | (method) NewableFunction.call(this: new (...args: A) => T, thisArg: T, ...args: A): void // | (property) Function.caller: Function // | (property) Function.length: number // | (property) c1.prototype: c1 @@ -1567,10 +1567,10 @@ // | (property) c1.s1: number // | (method) c1.s2(b: number): number // | (property) c1.s3: number -// | (method) Function.apply(this: Function, thisArg: any, argArray?: any): any +// | (method) NewableFunction.apply(this: new () => T, thisArg: T): void (+1 overload) // | (property) Function.arguments: any -// | (method) Function.bind(this: Function, thisArg: any, ...argArray: any[]): any -// | (method) Function.call(this: Function, thisArg: any, ...argArray: any[]): any +// | (method) NewableFunction.bind(this: T, thisArg: any): T (+1 overload) +// | (method) NewableFunction.call(this: new (...args: A) => T, thisArg: T, ...args: A): void // | (property) Function.caller: Function // | (property) Function.length: number // | (property) c1.prototype: c1 @@ -1730,10 +1730,10 @@ // | (property) c1.s1: number // | (method) c1.s2(b: number): number // | (property) c1.s3: number -// | (method) Function.apply(this: Function, thisArg: any, argArray?: any): any +// | (method) NewableFunction.apply(this: new () => T, thisArg: T): void (+1 overload) // | (property) Function.arguments: any -// | (method) Function.bind(this: Function, thisArg: any, ...argArray: any[]): any -// | (method) Function.call(this: Function, thisArg: any, ...argArray: any[]): any +// | (method) NewableFunction.bind(this: T, thisArg: any): T (+1 overload) +// | (method) NewableFunction.call(this: new (...args: A) => T, thisArg: T, ...args: A): void // | (property) Function.caller: Function // | (property) Function.length: number // | (property) c1.prototype: c1 @@ -2983,10 +2983,10 @@ // | (property) c1.s1: number // | (method) c1.s2(b: number): number // | (property) c1.s3: number -// | (method) Function.apply(this: Function, thisArg: any, argArray?: any): any +// | (method) NewableFunction.apply(this: new () => T, thisArg: T): void (+1 overload) // | (property) Function.arguments: any -// | (method) Function.bind(this: Function, thisArg: any, ...argArray: any[]): any -// | (method) Function.call(this: Function, thisArg: any, ...argArray: any[]): any +// | (method) NewableFunction.bind(this: T, thisArg: any): T (+1 overload) +// | (method) NewableFunction.call(this: new (...args: A) => T, thisArg: T, ...args: A): void // | (property) Function.caller: Function // | (property) Function.length: number // | (property) c1.prototype: c1 @@ -34029,8 +34029,8 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "NewableFunction", + "kind": "interfaceName" }, { "text": ".", @@ -34040,6 +34040,18 @@ "text": "apply", "kind": "methodName" }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, { "text": "(", "kind": "punctuation" @@ -34057,23 +34069,27 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "new", + "kind": "keyword" }, { - "text": ",", + "text": " ", + "kind": "space" + }, + { + "text": "(", "kind": "punctuation" }, { - "text": " ", - "kind": "space" + "text": ")", + "kind": "punctuation" }, { - "text": "thisArg", - "kind": "parameterName" + "text": " ", + "kind": "space" }, { - "text": ":", + "text": "=>", "kind": "punctuation" }, { @@ -34081,8 +34097,8 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "T", + "kind": "typeParameterName" }, { "text": ",", @@ -34093,13 +34109,9 @@ "kind": "space" }, { - "text": "argArray", + "text": "thisArg", "kind": "parameterName" }, - { - "text": "?", - "kind": "punctuation" - }, { "text": ":", "kind": "punctuation" @@ -34109,8 +34121,8 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "T", + "kind": "typeParameterName" }, { "text": ")", @@ -34125,13 +34137,41 @@ "kind": "space" }, { - "text": "any", + "text": "void", "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "1", + "kind": "numericLiteral" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "overload", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" } ], "documentation": [ { - "text": "Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function.", + "text": "Calls the function with the specified object as the this value and the elements of specified array as the arguments.", "kind": "text" } ], @@ -34152,23 +34192,6 @@ "kind": "text" } ] - }, - { - "name": "param", - "text": [ - { - "text": "argArray", - "kind": "parameterName" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "A set of arguments to be passed to the function.", - "kind": "text" - } - ] } ] }, @@ -34244,8 +34267,8 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "NewableFunction", + "kind": "interfaceName" }, { "text": ".", @@ -34255,6 +34278,18 @@ "text": "bind", "kind": "methodName" }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, { "text": "(", "kind": "punctuation" @@ -34272,8 +34307,8 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "T", + "kind": "typeParameterName" }, { "text": ",", @@ -34300,21 +34335,9 @@ "kind": "keyword" }, { - "text": ",", - "kind": "punctuation" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "...", + "text": ")", "kind": "punctuation" }, - { - "text": "argArray", - "kind": "parameterName" - }, { "text": ":", "kind": "punctuation" @@ -34324,32 +34347,36 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "T", + "kind": "typeParameterName" }, { - "text": "[", - "kind": "punctuation" + "text": " ", + "kind": "space" }, { - "text": "]", + "text": "(", "kind": "punctuation" }, { - "text": ")", - "kind": "punctuation" + "text": "+", + "kind": "operator" }, { - "text": ":", - "kind": "punctuation" + "text": "1", + "kind": "numericLiteral" }, { "text": " ", "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "overload", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" } ], "documentation": [ @@ -34371,24 +34398,7 @@ "kind": "space" }, { - "text": "An object to which the this keyword can refer inside the new function.", - "kind": "text" - } - ] - }, - { - "name": "param", - "text": [ - { - "text": "argArray", - "kind": "parameterName" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "A list of arguments to be passed to the new function.", + "text": "The object to be used as the this object.", "kind": "text" } ] @@ -34418,8 +34428,8 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "NewableFunction", + "kind": "interfaceName" }, { "text": ".", @@ -34429,6 +34439,54 @@ "text": "call", "kind": "methodName" }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "any", + "kind": "keyword" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, { "text": "(", "kind": "punctuation" @@ -34446,19 +34504,23 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "new", + "kind": "keyword" }, { - "text": ",", + "text": " ", + "kind": "space" + }, + { + "text": "(", "kind": "punctuation" }, { - "text": " ", - "kind": "space" + "text": "...", + "kind": "punctuation" }, { - "text": "thisArg", + "text": "args", "kind": "parameterName" }, { @@ -34470,11 +34532,11 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "A", + "kind": "typeParameterName" }, { - "text": ",", + "text": ")", "kind": "punctuation" }, { @@ -34482,11 +34544,27 @@ "kind": "space" }, { - "text": "...", + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ",", "kind": "punctuation" }, { - "text": "argArray", + "text": " ", + "kind": "space" + }, + { + "text": "thisArg", "kind": "parameterName" }, { @@ -34498,17 +34576,37 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "T", + "kind": "typeParameterName" }, { - "text": "[", + "text": ",", "kind": "punctuation" }, { - "text": "]", + "text": " ", + "kind": "space" + }, + { + "text": "...", "kind": "punctuation" }, + { + "text": "args", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A", + "kind": "typeParameterName" + }, { "text": ")", "kind": "punctuation" @@ -34522,13 +34620,13 @@ "kind": "space" }, { - "text": "any", + "text": "void", "kind": "keyword" } ], "documentation": [ { - "text": "Calls a method of an object, substituting another object for the current object.", + "text": "Calls the function with the specified object as the this value and the specified rest arguments as the arguments.", "kind": "text" } ], @@ -34545,7 +34643,7 @@ "kind": "space" }, { - "text": "The object to be used as the current object.", + "text": "The object to be used as the this object.", "kind": "text" } ] @@ -34554,7 +34652,7 @@ "name": "param", "text": [ { - "text": "argArray", + "text": "args", "kind": "parameterName" }, { @@ -34562,7 +34660,7 @@ "kind": "space" }, { - "text": "A list of arguments to be passed to the method.", + "text": "Argument values to be passed to the function.", "kind": "text" } ] @@ -44236,8 +44334,8 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "NewableFunction", + "kind": "interfaceName" }, { "text": ".", @@ -44247,6 +44345,18 @@ "text": "apply", "kind": "methodName" }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, { "text": "(", "kind": "punctuation" @@ -44264,23 +44374,27 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "new", + "kind": "keyword" }, { - "text": ",", + "text": " ", + "kind": "space" + }, + { + "text": "(", "kind": "punctuation" }, { - "text": " ", - "kind": "space" + "text": ")", + "kind": "punctuation" }, { - "text": "thisArg", - "kind": "parameterName" + "text": " ", + "kind": "space" }, { - "text": ":", + "text": "=>", "kind": "punctuation" }, { @@ -44288,8 +44402,8 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "T", + "kind": "typeParameterName" }, { "text": ",", @@ -44300,13 +44414,9 @@ "kind": "space" }, { - "text": "argArray", + "text": "thisArg", "kind": "parameterName" }, - { - "text": "?", - "kind": "punctuation" - }, { "text": ":", "kind": "punctuation" @@ -44316,8 +44426,8 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "T", + "kind": "typeParameterName" }, { "text": ")", @@ -44332,13 +44442,41 @@ "kind": "space" }, { - "text": "any", + "text": "void", "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "1", + "kind": "numericLiteral" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "overload", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" } ], "documentation": [ { - "text": "Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function.", + "text": "Calls the function with the specified object as the this value and the elements of specified array as the arguments.", "kind": "text" } ], @@ -44359,23 +44497,6 @@ "kind": "text" } ] - }, - { - "name": "param", - "text": [ - { - "text": "argArray", - "kind": "parameterName" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "A set of arguments to be passed to the function.", - "kind": "text" - } - ] } ] }, @@ -44451,8 +44572,8 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "NewableFunction", + "kind": "interfaceName" }, { "text": ".", @@ -44462,6 +44583,18 @@ "text": "bind", "kind": "methodName" }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, { "text": "(", "kind": "punctuation" @@ -44479,8 +44612,8 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "T", + "kind": "typeParameterName" }, { "text": ",", @@ -44507,21 +44640,9 @@ "kind": "keyword" }, { - "text": ",", - "kind": "punctuation" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "...", + "text": ")", "kind": "punctuation" }, - { - "text": "argArray", - "kind": "parameterName" - }, { "text": ":", "kind": "punctuation" @@ -44531,32 +44652,36 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "T", + "kind": "typeParameterName" }, { - "text": "[", - "kind": "punctuation" + "text": " ", + "kind": "space" }, { - "text": "]", + "text": "(", "kind": "punctuation" }, { - "text": ")", - "kind": "punctuation" + "text": "+", + "kind": "operator" }, { - "text": ":", - "kind": "punctuation" + "text": "1", + "kind": "numericLiteral" }, { "text": " ", "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "overload", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" } ], "documentation": [ @@ -44578,24 +44703,7 @@ "kind": "space" }, { - "text": "An object to which the this keyword can refer inside the new function.", - "kind": "text" - } - ] - }, - { - "name": "param", - "text": [ - { - "text": "argArray", - "kind": "parameterName" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "A list of arguments to be passed to the new function.", + "text": "The object to be used as the this object.", "kind": "text" } ] @@ -44625,8 +44733,8 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "NewableFunction", + "kind": "interfaceName" }, { "text": ".", @@ -44636,6 +44744,54 @@ "text": "call", "kind": "methodName" }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "any", + "kind": "keyword" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, { "text": "(", "kind": "punctuation" @@ -44653,19 +44809,23 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "new", + "kind": "keyword" }, { - "text": ",", + "text": " ", + "kind": "space" + }, + { + "text": "(", "kind": "punctuation" }, { - "text": " ", - "kind": "space" + "text": "...", + "kind": "punctuation" }, { - "text": "thisArg", + "text": "args", "kind": "parameterName" }, { @@ -44677,11 +44837,11 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "A", + "kind": "typeParameterName" }, { - "text": ",", + "text": ")", "kind": "punctuation" }, { @@ -44689,11 +44849,27 @@ "kind": "space" }, { - "text": "...", + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ",", "kind": "punctuation" }, { - "text": "argArray", + "text": " ", + "kind": "space" + }, + { + "text": "thisArg", "kind": "parameterName" }, { @@ -44705,17 +44881,37 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "T", + "kind": "typeParameterName" }, { - "text": "[", + "text": ",", "kind": "punctuation" }, { - "text": "]", + "text": " ", + "kind": "space" + }, + { + "text": "...", "kind": "punctuation" }, + { + "text": "args", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A", + "kind": "typeParameterName" + }, { "text": ")", "kind": "punctuation" @@ -44729,13 +44925,13 @@ "kind": "space" }, { - "text": "any", + "text": "void", "kind": "keyword" } ], "documentation": [ { - "text": "Calls a method of an object, substituting another object for the current object.", + "text": "Calls the function with the specified object as the this value and the specified rest arguments as the arguments.", "kind": "text" } ], @@ -44752,7 +44948,7 @@ "kind": "space" }, { - "text": "The object to be used as the current object.", + "text": "The object to be used as the this object.", "kind": "text" } ] @@ -44761,7 +44957,7 @@ "name": "param", "text": [ { - "text": "argArray", + "text": "args", "kind": "parameterName" }, { @@ -44769,7 +44965,7 @@ "kind": "space" }, { - "text": "A list of arguments to be passed to the method.", + "text": "Argument values to be passed to the function.", "kind": "text" } ] @@ -49897,8 +50093,8 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "NewableFunction", + "kind": "interfaceName" }, { "text": ".", @@ -49908,6 +50104,18 @@ "text": "apply", "kind": "methodName" }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, { "text": "(", "kind": "punctuation" @@ -49925,23 +50133,27 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "new", + "kind": "keyword" }, { - "text": ",", + "text": " ", + "kind": "space" + }, + { + "text": "(", "kind": "punctuation" }, { - "text": " ", - "kind": "space" + "text": ")", + "kind": "punctuation" }, { - "text": "thisArg", - "kind": "parameterName" + "text": " ", + "kind": "space" }, { - "text": ":", + "text": "=>", "kind": "punctuation" }, { @@ -49949,8 +50161,8 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "T", + "kind": "typeParameterName" }, { "text": ",", @@ -49961,13 +50173,9 @@ "kind": "space" }, { - "text": "argArray", + "text": "thisArg", "kind": "parameterName" }, - { - "text": "?", - "kind": "punctuation" - }, { "text": ":", "kind": "punctuation" @@ -49977,8 +50185,8 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "T", + "kind": "typeParameterName" }, { "text": ")", @@ -49993,13 +50201,41 @@ "kind": "space" }, { - "text": "any", + "text": "void", "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "1", + "kind": "numericLiteral" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "overload", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" } ], "documentation": [ { - "text": "Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function.", + "text": "Calls the function with the specified object as the this value and the elements of specified array as the arguments.", "kind": "text" } ], @@ -50020,23 +50256,6 @@ "kind": "text" } ] - }, - { - "name": "param", - "text": [ - { - "text": "argArray", - "kind": "parameterName" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "A set of arguments to be passed to the function.", - "kind": "text" - } - ] } ] }, @@ -50112,8 +50331,8 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "NewableFunction", + "kind": "interfaceName" }, { "text": ".", @@ -50123,6 +50342,18 @@ "text": "bind", "kind": "methodName" }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, { "text": "(", "kind": "punctuation" @@ -50140,8 +50371,8 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "T", + "kind": "typeParameterName" }, { "text": ",", @@ -50168,21 +50399,9 @@ "kind": "keyword" }, { - "text": ",", - "kind": "punctuation" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "...", + "text": ")", "kind": "punctuation" }, - { - "text": "argArray", - "kind": "parameterName" - }, { "text": ":", "kind": "punctuation" @@ -50192,32 +50411,36 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "T", + "kind": "typeParameterName" }, { - "text": "[", - "kind": "punctuation" + "text": " ", + "kind": "space" }, { - "text": "]", + "text": "(", "kind": "punctuation" }, { - "text": ")", - "kind": "punctuation" + "text": "+", + "kind": "operator" }, { - "text": ":", - "kind": "punctuation" + "text": "1", + "kind": "numericLiteral" }, { "text": " ", "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "overload", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" } ], "documentation": [ @@ -50239,24 +50462,7 @@ "kind": "space" }, { - "text": "An object to which the this keyword can refer inside the new function.", - "kind": "text" - } - ] - }, - { - "name": "param", - "text": [ - { - "text": "argArray", - "kind": "parameterName" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "A list of arguments to be passed to the new function.", + "text": "The object to be used as the this object.", "kind": "text" } ] @@ -50286,8 +50492,8 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "NewableFunction", + "kind": "interfaceName" }, { "text": ".", @@ -50297,6 +50503,54 @@ "text": "call", "kind": "methodName" }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "any", + "kind": "keyword" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, { "text": "(", "kind": "punctuation" @@ -50314,19 +50568,23 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "new", + "kind": "keyword" }, { - "text": ",", + "text": " ", + "kind": "space" + }, + { + "text": "(", "kind": "punctuation" }, { - "text": " ", - "kind": "space" + "text": "...", + "kind": "punctuation" }, { - "text": "thisArg", + "text": "args", "kind": "parameterName" }, { @@ -50338,11 +50596,11 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "A", + "kind": "typeParameterName" }, { - "text": ",", + "text": ")", "kind": "punctuation" }, { @@ -50350,11 +50608,27 @@ "kind": "space" }, { - "text": "...", + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ",", "kind": "punctuation" }, { - "text": "argArray", + "text": " ", + "kind": "space" + }, + { + "text": "thisArg", "kind": "parameterName" }, { @@ -50366,17 +50640,37 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "T", + "kind": "typeParameterName" }, { - "text": "[", + "text": ",", "kind": "punctuation" }, { - "text": "]", + "text": " ", + "kind": "space" + }, + { + "text": "...", "kind": "punctuation" }, + { + "text": "args", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A", + "kind": "typeParameterName" + }, { "text": ")", "kind": "punctuation" @@ -50390,13 +50684,13 @@ "kind": "space" }, { - "text": "any", + "text": "void", "kind": "keyword" } ], "documentation": [ { - "text": "Calls a method of an object, substituting another object for the current object.", + "text": "Calls the function with the specified object as the this value and the specified rest arguments as the arguments.", "kind": "text" } ], @@ -50413,7 +50707,7 @@ "kind": "space" }, { - "text": "The object to be used as the current object.", + "text": "The object to be used as the this object.", "kind": "text" } ] @@ -50422,7 +50716,7 @@ "name": "param", "text": [ { - "text": "argArray", + "text": "args", "kind": "parameterName" }, { @@ -50430,7 +50724,7 @@ "kind": "space" }, { - "text": "A list of arguments to be passed to the method.", + "text": "Argument values to be passed to the function.", "kind": "text" } ] @@ -55604,8 +55898,8 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "NewableFunction", + "kind": "interfaceName" }, { "text": ".", @@ -55615,6 +55909,18 @@ "text": "apply", "kind": "methodName" }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, { "text": "(", "kind": "punctuation" @@ -55632,23 +55938,27 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "new", + "kind": "keyword" }, { - "text": ",", + "text": " ", + "kind": "space" + }, + { + "text": "(", "kind": "punctuation" }, { - "text": " ", - "kind": "space" + "text": ")", + "kind": "punctuation" }, { - "text": "thisArg", - "kind": "parameterName" + "text": " ", + "kind": "space" }, { - "text": ":", + "text": "=>", "kind": "punctuation" }, { @@ -55656,8 +55966,8 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "T", + "kind": "typeParameterName" }, { "text": ",", @@ -55668,13 +55978,9 @@ "kind": "space" }, { - "text": "argArray", + "text": "thisArg", "kind": "parameterName" }, - { - "text": "?", - "kind": "punctuation" - }, { "text": ":", "kind": "punctuation" @@ -55684,8 +55990,8 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "T", + "kind": "typeParameterName" }, { "text": ")", @@ -55700,13 +56006,41 @@ "kind": "space" }, { - "text": "any", + "text": "void", "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "1", + "kind": "numericLiteral" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "overload", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" } ], "documentation": [ { - "text": "Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function.", + "text": "Calls the function with the specified object as the this value and the elements of specified array as the arguments.", "kind": "text" } ], @@ -55727,23 +56061,6 @@ "kind": "text" } ] - }, - { - "name": "param", - "text": [ - { - "text": "argArray", - "kind": "parameterName" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "A set of arguments to be passed to the function.", - "kind": "text" - } - ] } ] }, @@ -55819,8 +56136,8 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "NewableFunction", + "kind": "interfaceName" }, { "text": ".", @@ -55830,6 +56147,18 @@ "text": "bind", "kind": "methodName" }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, { "text": "(", "kind": "punctuation" @@ -55847,8 +56176,8 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "T", + "kind": "typeParameterName" }, { "text": ",", @@ -55875,21 +56204,9 @@ "kind": "keyword" }, { - "text": ",", - "kind": "punctuation" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "...", + "text": ")", "kind": "punctuation" }, - { - "text": "argArray", - "kind": "parameterName" - }, { "text": ":", "kind": "punctuation" @@ -55899,32 +56216,36 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "T", + "kind": "typeParameterName" }, { - "text": "[", - "kind": "punctuation" + "text": " ", + "kind": "space" }, { - "text": "]", + "text": "(", "kind": "punctuation" }, { - "text": ")", - "kind": "punctuation" + "text": "+", + "kind": "operator" }, { - "text": ":", - "kind": "punctuation" + "text": "1", + "kind": "numericLiteral" }, { "text": " ", "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "overload", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" } ], "documentation": [ @@ -55946,24 +56267,7 @@ "kind": "space" }, { - "text": "An object to which the this keyword can refer inside the new function.", - "kind": "text" - } - ] - }, - { - "name": "param", - "text": [ - { - "text": "argArray", - "kind": "parameterName" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "A list of arguments to be passed to the new function.", + "text": "The object to be used as the this object.", "kind": "text" } ] @@ -55993,8 +56297,8 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "NewableFunction", + "kind": "interfaceName" }, { "text": ".", @@ -56004,6 +56308,54 @@ "text": "call", "kind": "methodName" }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "any", + "kind": "keyword" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, { "text": "(", "kind": "punctuation" @@ -56021,19 +56373,23 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "new", + "kind": "keyword" }, { - "text": ",", + "text": " ", + "kind": "space" + }, + { + "text": "(", "kind": "punctuation" }, { - "text": " ", - "kind": "space" + "text": "...", + "kind": "punctuation" }, { - "text": "thisArg", + "text": "args", "kind": "parameterName" }, { @@ -56045,11 +56401,11 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "A", + "kind": "typeParameterName" }, { - "text": ",", + "text": ")", "kind": "punctuation" }, { @@ -56057,11 +56413,27 @@ "kind": "space" }, { - "text": "...", + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ",", "kind": "punctuation" }, { - "text": "argArray", + "text": " ", + "kind": "space" + }, + { + "text": "thisArg", "kind": "parameterName" }, { @@ -56073,17 +56445,37 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "T", + "kind": "typeParameterName" }, { - "text": "[", + "text": ",", "kind": "punctuation" }, { - "text": "]", + "text": " ", + "kind": "space" + }, + { + "text": "...", "kind": "punctuation" }, + { + "text": "args", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A", + "kind": "typeParameterName" + }, { "text": ")", "kind": "punctuation" @@ -56097,13 +56489,13 @@ "kind": "space" }, { - "text": "any", + "text": "void", "kind": "keyword" } ], "documentation": [ { - "text": "Calls a method of an object, substituting another object for the current object.", + "text": "Calls the function with the specified object as the this value and the specified rest arguments as the arguments.", "kind": "text" } ], @@ -56120,7 +56512,7 @@ "kind": "space" }, { - "text": "The object to be used as the current object.", + "text": "The object to be used as the this object.", "kind": "text" } ] @@ -56129,7 +56521,7 @@ "name": "param", "text": [ { - "text": "argArray", + "text": "args", "kind": "parameterName" }, { @@ -56137,7 +56529,7 @@ "kind": "space" }, { - "text": "A list of arguments to be passed to the method.", + "text": "Argument values to be passed to the function.", "kind": "text" } ] @@ -61311,8 +61703,8 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "NewableFunction", + "kind": "interfaceName" }, { "text": ".", @@ -61322,6 +61714,18 @@ "text": "apply", "kind": "methodName" }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, { "text": "(", "kind": "punctuation" @@ -61339,23 +61743,27 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "new", + "kind": "keyword" }, { - "text": ",", + "text": " ", + "kind": "space" + }, + { + "text": "(", "kind": "punctuation" }, { - "text": " ", - "kind": "space" + "text": ")", + "kind": "punctuation" }, { - "text": "thisArg", - "kind": "parameterName" + "text": " ", + "kind": "space" }, { - "text": ":", + "text": "=>", "kind": "punctuation" }, { @@ -61363,8 +61771,8 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "T", + "kind": "typeParameterName" }, { "text": ",", @@ -61375,13 +61783,9 @@ "kind": "space" }, { - "text": "argArray", + "text": "thisArg", "kind": "parameterName" }, - { - "text": "?", - "kind": "punctuation" - }, { "text": ":", "kind": "punctuation" @@ -61391,8 +61795,8 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "T", + "kind": "typeParameterName" }, { "text": ")", @@ -61407,13 +61811,41 @@ "kind": "space" }, { - "text": "any", + "text": "void", "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "1", + "kind": "numericLiteral" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "overload", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" } ], "documentation": [ { - "text": "Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function.", + "text": "Calls the function with the specified object as the this value and the elements of specified array as the arguments.", "kind": "text" } ], @@ -61434,23 +61866,6 @@ "kind": "text" } ] - }, - { - "name": "param", - "text": [ - { - "text": "argArray", - "kind": "parameterName" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "A set of arguments to be passed to the function.", - "kind": "text" - } - ] } ] }, @@ -61526,8 +61941,8 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "NewableFunction", + "kind": "interfaceName" }, { "text": ".", @@ -61537,6 +61952,18 @@ "text": "bind", "kind": "methodName" }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, { "text": "(", "kind": "punctuation" @@ -61554,8 +61981,8 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "T", + "kind": "typeParameterName" }, { "text": ",", @@ -61582,21 +62009,9 @@ "kind": "keyword" }, { - "text": ",", - "kind": "punctuation" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "...", + "text": ")", "kind": "punctuation" }, - { - "text": "argArray", - "kind": "parameterName" - }, { "text": ":", "kind": "punctuation" @@ -61606,32 +62021,36 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "T", + "kind": "typeParameterName" }, { - "text": "[", - "kind": "punctuation" + "text": " ", + "kind": "space" }, { - "text": "]", + "text": "(", "kind": "punctuation" }, { - "text": ")", - "kind": "punctuation" + "text": "+", + "kind": "operator" }, { - "text": ":", - "kind": "punctuation" + "text": "1", + "kind": "numericLiteral" }, { "text": " ", "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "overload", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" } ], "documentation": [ @@ -61653,24 +62072,7 @@ "kind": "space" }, { - "text": "An object to which the this keyword can refer inside the new function.", - "kind": "text" - } - ] - }, - { - "name": "param", - "text": [ - { - "text": "argArray", - "kind": "parameterName" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "A list of arguments to be passed to the new function.", + "text": "The object to be used as the this object.", "kind": "text" } ] @@ -61700,8 +62102,8 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "NewableFunction", + "kind": "interfaceName" }, { "text": ".", @@ -61711,6 +62113,54 @@ "text": "call", "kind": "methodName" }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "any", + "kind": "keyword" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, { "text": "(", "kind": "punctuation" @@ -61728,19 +62178,23 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "new", + "kind": "keyword" }, { - "text": ",", + "text": " ", + "kind": "space" + }, + { + "text": "(", "kind": "punctuation" }, { - "text": " ", - "kind": "space" + "text": "...", + "kind": "punctuation" }, { - "text": "thisArg", + "text": "args", "kind": "parameterName" }, { @@ -61752,11 +62206,11 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "A", + "kind": "typeParameterName" }, { - "text": ",", + "text": ")", "kind": "punctuation" }, { @@ -61764,11 +62218,27 @@ "kind": "space" }, { - "text": "...", + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ",", "kind": "punctuation" }, { - "text": "argArray", + "text": " ", + "kind": "space" + }, + { + "text": "thisArg", "kind": "parameterName" }, { @@ -61780,17 +62250,37 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "T", + "kind": "typeParameterName" }, { - "text": "[", + "text": ",", "kind": "punctuation" }, { - "text": "]", + "text": " ", + "kind": "space" + }, + { + "text": "...", "kind": "punctuation" }, + { + "text": "args", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A", + "kind": "typeParameterName" + }, { "text": ")", "kind": "punctuation" @@ -61804,13 +62294,13 @@ "kind": "space" }, { - "text": "any", + "text": "void", "kind": "keyword" } ], "documentation": [ { - "text": "Calls a method of an object, substituting another object for the current object.", + "text": "Calls the function with the specified object as the this value and the specified rest arguments as the arguments.", "kind": "text" } ], @@ -61827,7 +62317,7 @@ "kind": "space" }, { - "text": "The object to be used as the current object.", + "text": "The object to be used as the this object.", "kind": "text" } ] @@ -61836,7 +62326,7 @@ "name": "param", "text": [ { - "text": "argArray", + "text": "args", "kind": "parameterName" }, { @@ -61844,7 +62334,7 @@ "kind": "space" }, { - "text": "A list of arguments to be passed to the method.", + "text": "Argument values to be passed to the function.", "kind": "text" } ] @@ -99295,8 +99785,8 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "NewableFunction", + "kind": "interfaceName" }, { "text": ".", @@ -99306,6 +99796,18 @@ "text": "apply", "kind": "methodName" }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, { "text": "(", "kind": "punctuation" @@ -99323,23 +99825,27 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "new", + "kind": "keyword" }, { - "text": ",", + "text": " ", + "kind": "space" + }, + { + "text": "(", "kind": "punctuation" }, { - "text": " ", - "kind": "space" + "text": ")", + "kind": "punctuation" }, { - "text": "thisArg", - "kind": "parameterName" + "text": " ", + "kind": "space" }, { - "text": ":", + "text": "=>", "kind": "punctuation" }, { @@ -99347,8 +99853,8 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "T", + "kind": "typeParameterName" }, { "text": ",", @@ -99359,13 +99865,9 @@ "kind": "space" }, { - "text": "argArray", + "text": "thisArg", "kind": "parameterName" }, - { - "text": "?", - "kind": "punctuation" - }, { "text": ":", "kind": "punctuation" @@ -99375,8 +99877,8 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "T", + "kind": "typeParameterName" }, { "text": ")", @@ -99391,13 +99893,41 @@ "kind": "space" }, { - "text": "any", + "text": "void", "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "1", + "kind": "numericLiteral" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "overload", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" } ], "documentation": [ { - "text": "Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function.", + "text": "Calls the function with the specified object as the this value and the elements of specified array as the arguments.", "kind": "text" } ], @@ -99418,23 +99948,6 @@ "kind": "text" } ] - }, - { - "name": "param", - "text": [ - { - "text": "argArray", - "kind": "parameterName" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "A set of arguments to be passed to the function.", - "kind": "text" - } - ] } ] }, @@ -99510,8 +100023,8 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "NewableFunction", + "kind": "interfaceName" }, { "text": ".", @@ -99521,6 +100034,18 @@ "text": "bind", "kind": "methodName" }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, { "text": "(", "kind": "punctuation" @@ -99538,8 +100063,8 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "T", + "kind": "typeParameterName" }, { "text": ",", @@ -99566,21 +100091,9 @@ "kind": "keyword" }, { - "text": ",", - "kind": "punctuation" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "...", + "text": ")", "kind": "punctuation" }, - { - "text": "argArray", - "kind": "parameterName" - }, { "text": ":", "kind": "punctuation" @@ -99590,32 +100103,36 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "T", + "kind": "typeParameterName" }, { - "text": "[", - "kind": "punctuation" + "text": " ", + "kind": "space" }, { - "text": "]", + "text": "(", "kind": "punctuation" }, { - "text": ")", - "kind": "punctuation" + "text": "+", + "kind": "operator" }, { - "text": ":", - "kind": "punctuation" + "text": "1", + "kind": "numericLiteral" }, { "text": " ", "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "overload", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" } ], "documentation": [ @@ -99637,24 +100154,7 @@ "kind": "space" }, { - "text": "An object to which the this keyword can refer inside the new function.", - "kind": "text" - } - ] - }, - { - "name": "param", - "text": [ - { - "text": "argArray", - "kind": "parameterName" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "A list of arguments to be passed to the new function.", + "text": "The object to be used as the this object.", "kind": "text" } ] @@ -99684,8 +100184,8 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "NewableFunction", + "kind": "interfaceName" }, { "text": ".", @@ -99695,6 +100195,54 @@ "text": "call", "kind": "methodName" }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "any", + "kind": "keyword" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + }, { "text": "(", "kind": "punctuation" @@ -99712,19 +100260,23 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "new", + "kind": "keyword" }, { - "text": ",", + "text": " ", + "kind": "space" + }, + { + "text": "(", "kind": "punctuation" }, { - "text": " ", - "kind": "space" + "text": "...", + "kind": "punctuation" }, { - "text": "thisArg", + "text": "args", "kind": "parameterName" }, { @@ -99736,11 +100288,11 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "A", + "kind": "typeParameterName" }, { - "text": ",", + "text": ")", "kind": "punctuation" }, { @@ -99748,11 +100300,27 @@ "kind": "space" }, { - "text": "...", + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ",", "kind": "punctuation" }, { - "text": "argArray", + "text": " ", + "kind": "space" + }, + { + "text": "thisArg", "kind": "parameterName" }, { @@ -99764,17 +100332,37 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "T", + "kind": "typeParameterName" }, { - "text": "[", + "text": ",", "kind": "punctuation" }, { - "text": "]", + "text": " ", + "kind": "space" + }, + { + "text": "...", "kind": "punctuation" }, + { + "text": "args", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A", + "kind": "typeParameterName" + }, { "text": ")", "kind": "punctuation" @@ -99788,13 +100376,13 @@ "kind": "space" }, { - "text": "any", + "text": "void", "kind": "keyword" } ], "documentation": [ { - "text": "Calls a method of an object, substituting another object for the current object.", + "text": "Calls the function with the specified object as the this value and the specified rest arguments as the arguments.", "kind": "text" } ], @@ -99811,7 +100399,7 @@ "kind": "space" }, { - "text": "The object to be used as the current object.", + "text": "The object to be used as the this object.", "kind": "text" } ] @@ -99820,7 +100408,7 @@ "name": "param", "text": [ { - "text": "argArray", + "text": "args", "kind": "parameterName" }, { @@ -99828,7 +100416,7 @@ "kind": "space" }, { - "text": "A list of arguments to be passed to the method.", + "text": "Argument values to be passed to the function.", "kind": "text" } ] diff --git a/tests/baselines/reference/completionsCommitCharactersAfterDot.baseline b/tests/baselines/reference/completionsCommitCharactersAfterDot.baseline index 7ef62c786df3e..3e35e33ce2e79 100644 --- a/tests/baselines/reference/completionsCommitCharactersAfterDot.baseline +++ b/tests/baselines/reference/completionsCommitCharactersAfterDot.baseline @@ -26,10 +26,10 @@ // const w = obj4?. // ^ // | ---------------------------------------------------------------------- -// | (method) Function.apply(this: Function, thisArg: any, argArray?: any): any +// | (method) CallableFunction.apply(this: (this: T) => R, thisArg: T): R (+1 overload) // | (property) Function.arguments: any -// | (method) Function.bind(this: Function, thisArg: any, ...argArray: any[]): any -// | (method) Function.call(this: Function, thisArg: any, ...argArray: any[]): any +// | (method) CallableFunction.bind(this: T, thisArg: ThisParameterType): OmitThisParameter (+1 overload) +// | (method) CallableFunction.call(this: (this: T, ...args: A) => R, thisArg: T, ...args: A): R // | (property) Function.caller: Function // | (property) Function.length: number // | (property) Function.prototype: any @@ -39,10 +39,10 @@ // const a = obj5?. // ^ // | ---------------------------------------------------------------------- -// | (method) Function.apply(this: Function, thisArg: any, argArray?: any): any +// | (method) CallableFunction.apply(this: (this: T) => R, thisArg: T): R (+1 overload) // | (property) Function.arguments: any -// | (method) Function.bind(this: Function, thisArg: any, ...argArray: any[]): any -// | (method) Function.call(this: Function, thisArg: any, ...argArray: any[]): any +// | (method) CallableFunction.bind(this: T, thisArg: ThisParameterType): OmitThisParameter (+1 overload) +// | (method) CallableFunction.call(this: (this: T, ...args: A) => R, thisArg: T, ...args: A): R // | (property) Function.caller: Function // | (property) Function.length: number // | (property) Function.prototype: any @@ -279,8 +279,8 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "CallableFunction", + "kind": "interfaceName" }, { "text": ".", @@ -290,6 +290,30 @@ "text": "apply", "kind": "methodName" }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "R", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, { "text": "(", "kind": "punctuation" @@ -307,11 +331,15 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "(", + "kind": "punctuation" }, { - "text": ",", + "text": "this", + "kind": "parameterName" + }, + { + "text": ":", "kind": "punctuation" }, { @@ -319,11 +347,11 @@ "kind": "space" }, { - "text": "thisArg", - "kind": "parameterName" + "text": "T", + "kind": "typeParameterName" }, { - "text": ":", + "text": ")", "kind": "punctuation" }, { @@ -331,8 +359,16 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "R", + "kind": "typeParameterName" }, { "text": ",", @@ -343,13 +379,9 @@ "kind": "space" }, { - "text": "argArray", + "text": "thisArg", "kind": "parameterName" }, - { - "text": "?", - "kind": "punctuation" - }, { "text": ":", "kind": "punctuation" @@ -359,8 +391,8 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "T", + "kind": "typeParameterName" }, { "text": ")", @@ -375,13 +407,41 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "R", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "1", + "kind": "numericLiteral" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "overload", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" } ], "documentation": [ { - "text": "Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function.", + "text": "Calls the function with the specified object as the this value and the elements of specified array as the arguments.", "kind": "text" } ], @@ -402,23 +462,6 @@ "kind": "text" } ] - }, - { - "name": "param", - "text": [ - { - "text": "argArray", - "kind": "parameterName" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "A set of arguments to be passed to the function.", - "kind": "text" - } - ] } ] }, @@ -494,8 +537,8 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "CallableFunction", + "kind": "interfaceName" }, { "text": ".", @@ -505,6 +548,18 @@ "text": "bind", "kind": "methodName" }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, { "text": "(", "kind": "punctuation" @@ -522,8 +577,8 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "T", + "kind": "typeParameterName" }, { "text": ",", @@ -546,24 +601,24 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "ThisParameterType", + "kind": "aliasName" }, { - "text": ",", + "text": "<", "kind": "punctuation" }, { - "text": " ", - "kind": "space" + "text": "T", + "kind": "typeParameterName" }, { - "text": "...", + "text": ">", "kind": "punctuation" }, { - "text": "argArray", - "kind": "parameterName" + "text": ")", + "kind": "punctuation" }, { "text": ":", @@ -574,32 +629,48 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "OmitThisParameter", + "kind": "aliasName" }, { - "text": "[", + "text": "<", "kind": "punctuation" }, { - "text": "]", - "kind": "punctuation" + "text": "T", + "kind": "typeParameterName" }, { - "text": ")", + "text": ">", "kind": "punctuation" }, { - "text": ":", + "text": " ", + "kind": "space" + }, + { + "text": "(", "kind": "punctuation" }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "1", + "kind": "numericLiteral" + }, { "text": " ", "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "overload", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" } ], "documentation": [ @@ -621,24 +692,7 @@ "kind": "space" }, { - "text": "An object to which the this keyword can refer inside the new function.", - "kind": "text" - } - ] - }, - { - "name": "param", - "text": [ - { - "text": "argArray", - "kind": "parameterName" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "A list of arguments to be passed to the new function.", + "text": "The object to be used as the this object.", "kind": "text" } ] @@ -668,8 +722,8 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "CallableFunction", + "kind": "interfaceName" }, { "text": ".", @@ -679,6 +733,66 @@ "text": "call", "kind": "methodName" }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "any", + "kind": "keyword" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "R", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, { "text": "(", "kind": "punctuation" @@ -696,8 +810,24 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "(", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" }, { "text": ",", @@ -708,7 +838,11 @@ "kind": "space" }, { - "text": "thisArg", + "text": "...", + "kind": "punctuation" + }, + { + "text": "args", "kind": "parameterName" }, { @@ -720,11 +854,11 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "A", + "kind": "typeParameterName" }, { - "text": ",", + "text": ")", "kind": "punctuation" }, { @@ -732,11 +866,27 @@ "kind": "space" }, { - "text": "...", + "text": "=>", "kind": "punctuation" }, { - "text": "argArray", + "text": " ", + "kind": "space" + }, + { + "text": "R", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "thisArg", "kind": "parameterName" }, { @@ -748,17 +898,37 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "T", + "kind": "typeParameterName" }, { - "text": "[", + "text": ",", "kind": "punctuation" }, { - "text": "]", + "text": " ", + "kind": "space" + }, + { + "text": "...", "kind": "punctuation" }, + { + "text": "args", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A", + "kind": "typeParameterName" + }, { "text": ")", "kind": "punctuation" @@ -772,13 +942,13 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "R", + "kind": "typeParameterName" } ], "documentation": [ { - "text": "Calls a method of an object, substituting another object for the current object.", + "text": "Calls the function with the specified object as the this value and the specified rest arguments as the arguments.", "kind": "text" } ], @@ -795,7 +965,7 @@ "kind": "space" }, { - "text": "The object to be used as the current object.", + "text": "The object to be used as the this object.", "kind": "text" } ] @@ -804,7 +974,7 @@ "name": "param", "text": [ { - "text": "argArray", + "text": "args", "kind": "parameterName" }, { @@ -812,7 +982,7 @@ "kind": "space" }, { - "text": "A list of arguments to be passed to the method.", + "text": "Argument values to be passed to the function.", "kind": "text" } ] @@ -1059,24 +1229,64 @@ "kind": "text" }, { - "text": ")", + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "CallableFunction", + "kind": "interfaceName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "apply", + "kind": "methodName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "R", + "kind": "typeParameterName" + }, + { + "text": ">", "kind": "punctuation" }, { - "text": " ", - "kind": "space" + "text": "(", + "kind": "punctuation" }, { - "text": "Function", - "kind": "localName" + "text": "this", + "kind": "parameterName" }, { - "text": ".", + "text": ":", "kind": "punctuation" }, { - "text": "apply", - "kind": "methodName" + "text": " ", + "kind": "space" }, { "text": "(", @@ -1095,11 +1305,11 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "T", + "kind": "typeParameterName" }, { - "text": ",", + "text": ")", "kind": "punctuation" }, { @@ -1107,11 +1317,7 @@ "kind": "space" }, { - "text": "thisArg", - "kind": "parameterName" - }, - { - "text": ":", + "text": "=>", "kind": "punctuation" }, { @@ -1119,8 +1325,8 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "R", + "kind": "typeParameterName" }, { "text": ",", @@ -1131,13 +1337,9 @@ "kind": "space" }, { - "text": "argArray", + "text": "thisArg", "kind": "parameterName" }, - { - "text": "?", - "kind": "punctuation" - }, { "text": ":", "kind": "punctuation" @@ -1147,8 +1349,8 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "T", + "kind": "typeParameterName" }, { "text": ")", @@ -1163,13 +1365,41 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "R", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "1", + "kind": "numericLiteral" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "overload", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" } ], "documentation": [ { - "text": "Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function.", + "text": "Calls the function with the specified object as the this value and the elements of specified array as the arguments.", "kind": "text" } ], @@ -1190,23 +1420,6 @@ "kind": "text" } ] - }, - { - "name": "param", - "text": [ - { - "text": "argArray", - "kind": "parameterName" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "A set of arguments to be passed to the function.", - "kind": "text" - } - ] } ] }, @@ -1282,8 +1495,8 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "CallableFunction", + "kind": "interfaceName" }, { "text": ".", @@ -1293,6 +1506,18 @@ "text": "bind", "kind": "methodName" }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, { "text": "(", "kind": "punctuation" @@ -1310,8 +1535,8 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "T", + "kind": "typeParameterName" }, { "text": ",", @@ -1334,24 +1559,24 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "ThisParameterType", + "kind": "aliasName" }, { - "text": ",", + "text": "<", "kind": "punctuation" }, { - "text": " ", - "kind": "space" + "text": "T", + "kind": "typeParameterName" }, { - "text": "...", + "text": ">", "kind": "punctuation" }, { - "text": "argArray", - "kind": "parameterName" + "text": ")", + "kind": "punctuation" }, { "text": ":", @@ -1362,32 +1587,48 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "OmitThisParameter", + "kind": "aliasName" }, { - "text": "[", + "text": "<", "kind": "punctuation" }, { - "text": "]", - "kind": "punctuation" + "text": "T", + "kind": "typeParameterName" }, { - "text": ")", + "text": ">", "kind": "punctuation" }, { - "text": ":", + "text": " ", + "kind": "space" + }, + { + "text": "(", "kind": "punctuation" }, + { + "text": "+", + "kind": "operator" + }, + { + "text": "1", + "kind": "numericLiteral" + }, { "text": " ", "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "overload", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" } ], "documentation": [ @@ -1409,24 +1650,7 @@ "kind": "space" }, { - "text": "An object to which the this keyword can refer inside the new function.", - "kind": "text" - } - ] - }, - { - "name": "param", - "text": [ - { - "text": "argArray", - "kind": "parameterName" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "A list of arguments to be passed to the new function.", + "text": "The object to be used as the this object.", "kind": "text" } ] @@ -1456,8 +1680,8 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "CallableFunction", + "kind": "interfaceName" }, { "text": ".", @@ -1467,6 +1691,66 @@ "text": "call", "kind": "methodName" }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A", + "kind": "typeParameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "extends", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "any", + "kind": "keyword" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "R", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, { "text": "(", "kind": "punctuation" @@ -1484,8 +1768,24 @@ "kind": "space" }, { - "text": "Function", - "kind": "localName" + "text": "(", + "kind": "punctuation" + }, + { + "text": "this", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "T", + "kind": "typeParameterName" }, { "text": ",", @@ -1496,7 +1796,11 @@ "kind": "space" }, { - "text": "thisArg", + "text": "...", + "kind": "punctuation" + }, + { + "text": "args", "kind": "parameterName" }, { @@ -1508,11 +1812,11 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "A", + "kind": "typeParameterName" }, { - "text": ",", + "text": ")", "kind": "punctuation" }, { @@ -1520,11 +1824,27 @@ "kind": "space" }, { - "text": "...", + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "R", + "kind": "typeParameterName" + }, + { + "text": ",", "kind": "punctuation" }, { - "text": "argArray", + "text": " ", + "kind": "space" + }, + { + "text": "thisArg", "kind": "parameterName" }, { @@ -1536,17 +1856,37 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "T", + "kind": "typeParameterName" }, { - "text": "[", + "text": ",", "kind": "punctuation" }, { - "text": "]", + "text": " ", + "kind": "space" + }, + { + "text": "...", "kind": "punctuation" }, + { + "text": "args", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A", + "kind": "typeParameterName" + }, { "text": ")", "kind": "punctuation" @@ -1560,13 +1900,13 @@ "kind": "space" }, { - "text": "any", - "kind": "keyword" + "text": "R", + "kind": "typeParameterName" } ], "documentation": [ { - "text": "Calls a method of an object, substituting another object for the current object.", + "text": "Calls the function with the specified object as the this value and the specified rest arguments as the arguments.", "kind": "text" } ], @@ -1583,7 +1923,7 @@ "kind": "space" }, { - "text": "The object to be used as the current object.", + "text": "The object to be used as the this object.", "kind": "text" } ] @@ -1592,7 +1932,7 @@ "name": "param", "text": [ { - "text": "argArray", + "text": "args", "kind": "parameterName" }, { @@ -1600,7 +1940,7 @@ "kind": "space" }, { - "text": "A list of arguments to be passed to the method.", + "text": "Argument values to be passed to the function.", "kind": "text" } ] diff --git a/tests/baselines/reference/completionsCommitCharactersGlobal.baseline b/tests/baselines/reference/completionsCommitCharactersGlobal.baseline index 582d3363da492..2dfba3ca71ae6 100644 --- a/tests/baselines/reference/completionsCommitCharactersGlobal.baseline +++ b/tests/baselines/reference/completionsCommitCharactersGlobal.baseline @@ -2601,7 +2601,7 @@ // | interface ArrayConstructor // | interface ArrayLike // | asserts -// | type Awaited = T extends null ? T : T extends object & { +// | type Awaited = T extends null | undefined ? T : T extends object & { // | then(onfulfilled: infer F, ...args: infer _): any; // | } ? F extends (value: infer V, ...args: infer _) => any ? Awaited<...> : never : T // | bigint @@ -2630,7 +2630,7 @@ // | var Date: DateConstructor // | interface DateConstructor // | type DecoratorContext = ClassMemberDecoratorContext | ClassDecoratorContext any> -// | type DecoratorMetadata = Record & object +// | type DecoratorMetadata = DecoratorMetadataObject | undefined // | type DecoratorMetadataObject = Record & object // | interface Error // | var Error: ErrorConstructor @@ -2691,7 +2691,7 @@ // | type OmitThisParameter = unknown extends ThisParameterType ? T : T extends (...args: infer A) => infer R ? (...args: A) => R : T // | type ParameterDecorator = (target: Object, propertyKey: string | symbol | undefined, parameterIndex: number) => void // | type Parameters any> = T extends (...args: infer P) => any ? P : never -// | type Partial = { [P in keyof T]?: T[P]; } +// | type Partial = { [P in keyof T]?: T[P] | undefined; } // | type Pick = { [P in K]: T[P]; } // | interface Promise // | type PromiseConstructorLike = new (executor: (resolve: (value: T | PromiseLike) => void, reject: (reason?: any) => void) => void) => PromiseLike @@ -2781,7 +2781,7 @@ // | interface ArrayConstructor // | interface ArrayLike // | asserts -// | type Awaited = T extends null ? T : T extends object & { +// | type Awaited = T extends null | undefined ? T : T extends object & { // | then(onfulfilled: infer F, ...args: infer _): any; // | } ? F extends (value: infer V, ...args: infer _) => any ? Awaited<...> : never : T // | bigint @@ -2810,7 +2810,7 @@ // | var Date: DateConstructor // | interface DateConstructor // | type DecoratorContext = ClassMemberDecoratorContext | ClassDecoratorContext any> -// | type DecoratorMetadata = Record & object +// | type DecoratorMetadata = DecoratorMetadataObject | undefined // | type DecoratorMetadataObject = Record & object // | interface Error // | var Error: ErrorConstructor @@ -2871,7 +2871,7 @@ // | type OmitThisParameter = unknown extends ThisParameterType ? T : T extends (...args: infer A) => infer R ? (...args: A) => R : T // | type ParameterDecorator = (target: Object, propertyKey: string | symbol | undefined, parameterIndex: number) => void // | type Parameters any> = T extends (...args: infer P) => any ? P : never -// | type Partial = { [P in keyof T]?: T[P]; } +// | type Partial = { [P in keyof T]?: T[P] | undefined; } // | type Pick = { [P in K]: T[P]; } // | interface Promise // | type PromiseConstructorLike = new (executor: (resolve: (value: T | PromiseLike) => void, reject: (reason?: any) => void) => void) => PromiseLike @@ -74743,6 +74743,22 @@ "text": " ", "kind": "space" }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "undefined", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, { "text": "?", "kind": "punctuation" @@ -77379,39 +77395,15 @@ "kind": "space" }, { - "text": "Record", - "kind": "aliasName" - }, - { - "text": "<", - "kind": "punctuation" - }, - { - "text": "PropertyKey", + "text": "DecoratorMetadataObject", "kind": "aliasName" }, - { - "text": ",", - "kind": "punctuation" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "unknown", - "kind": "keyword" - }, - { - "text": ">", - "kind": "punctuation" - }, { "text": " ", "kind": "space" }, { - "text": "&", + "text": "|", "kind": "punctuation" }, { @@ -77419,7 +77411,7 @@ "kind": "space" }, { - "text": "object", + "text": "undefined", "kind": "keyword" } ], @@ -80590,6 +80582,22 @@ "text": "]", "kind": "punctuation" }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "undefined", + "kind": "keyword" + }, { "text": ";", "kind": "punctuation" @@ -84214,6 +84222,22 @@ "text": " ", "kind": "space" }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "undefined", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, { "text": "?", "kind": "punctuation" @@ -86850,39 +86874,15 @@ "kind": "space" }, { - "text": "Record", - "kind": "aliasName" - }, - { - "text": "<", - "kind": "punctuation" - }, - { - "text": "PropertyKey", + "text": "DecoratorMetadataObject", "kind": "aliasName" }, - { - "text": ",", - "kind": "punctuation" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "unknown", - "kind": "keyword" - }, - { - "text": ">", - "kind": "punctuation" - }, { "text": " ", "kind": "space" }, { - "text": "&", + "text": "|", "kind": "punctuation" }, { @@ -86890,7 +86890,7 @@ "kind": "space" }, { - "text": "object", + "text": "undefined", "kind": "keyword" } ], @@ -90061,6 +90061,22 @@ "text": "]", "kind": "punctuation" }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "undefined", + "kind": "keyword" + }, { "text": ";", "kind": "punctuation" diff --git a/tests/baselines/reference/complexClassRelationships(target=es2015).errors.txt b/tests/baselines/reference/complexClassRelationships(target=es2015).errors.txt index ac14126b2e90e..1e00bd017753f 100644 --- a/tests/baselines/reference/complexClassRelationships(target=es2015).errors.txt +++ b/tests/baselines/reference/complexClassRelationships(target=es2015).errors.txt @@ -1,7 +1,9 @@ complexClassRelationships.ts(2,23): error TS2449: Class 'Base' used before its declaration. +complexClassRelationships.ts(14,5): error TS2564: Property 'ownerCollection' has no initializer and is not definitely assigned in the constructor. +complexClassRelationships.ts(18,57): error TS2322: Type 'null' is not assignable to type 'ComponentCollection'. -==== complexClassRelationships.ts (1 errors) ==== +==== complexClassRelationships.ts (3 errors) ==== // There should be no errors in this file class Derived extends Base { ~~~~ @@ -19,10 +21,14 @@ complexClassRelationships.ts(2,23): error TS2449: Class 'Base' used before its d } class Base { ownerCollection: BaseCollection; + ~~~~~~~~~~~~~~~ +!!! error TS2564: Property 'ownerCollection' has no initializer and is not definitely assigned in the constructor. } class Thing { public get Components(): ComponentCollection { return null } + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'ComponentCollection'. } class ComponentCollection { diff --git a/tests/baselines/reference/complexClassRelationships(target=es2015).js b/tests/baselines/reference/complexClassRelationships(target=es2015).js index 36f1b9d253ade..70e7b08333562 100644 --- a/tests/baselines/reference/complexClassRelationships(target=es2015).js +++ b/tests/baselines/reference/complexClassRelationships(target=es2015).js @@ -50,6 +50,7 @@ class FooBase { } //// [complexClassRelationships.js] +"use strict"; // There should be no errors in this file class Derived extends Base { static createEmpty() { diff --git a/tests/baselines/reference/complexClassRelationships(target=es5).errors.txt b/tests/baselines/reference/complexClassRelationships(target=es5).errors.txt index 1350a55b49669..4c2acd7a4b744 100644 --- a/tests/baselines/reference/complexClassRelationships(target=es5).errors.txt +++ b/tests/baselines/reference/complexClassRelationships(target=es5).errors.txt @@ -1,9 +1,11 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. complexClassRelationships.ts(2,23): error TS2449: Class 'Base' used before its declaration. +complexClassRelationships.ts(14,5): error TS2564: Property 'ownerCollection' has no initializer and is not definitely assigned in the constructor. +complexClassRelationships.ts(18,57): error TS2322: Type 'null' is not assignable to type 'ComponentCollection'. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== complexClassRelationships.ts (1 errors) ==== +==== complexClassRelationships.ts (3 errors) ==== // There should be no errors in this file class Derived extends Base { ~~~~ @@ -21,10 +23,14 @@ complexClassRelationships.ts(2,23): error TS2449: Class 'Base' used before its d } class Base { ownerCollection: BaseCollection; + ~~~~~~~~~~~~~~~ +!!! error TS2564: Property 'ownerCollection' has no initializer and is not definitely assigned in the constructor. } class Thing { public get Components(): ComponentCollection { return null } + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'ComponentCollection'. } class ComponentCollection { diff --git a/tests/baselines/reference/complexClassRelationships(target=es5).js b/tests/baselines/reference/complexClassRelationships(target=es5).js index 0ddb1b1403652..7d1f5c568d79d 100644 --- a/tests/baselines/reference/complexClassRelationships(target=es5).js +++ b/tests/baselines/reference/complexClassRelationships(target=es5).js @@ -50,6 +50,7 @@ class FooBase { } //// [complexClassRelationships.js] +"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || diff --git a/tests/baselines/reference/complexRecursiveCollections.errors.txt b/tests/baselines/reference/complexRecursiveCollections.errors.txt index e99afc9dae3bf..ea5bea2bc95b7 100644 --- a/tests/baselines/reference/complexRecursiveCollections.errors.txt +++ b/tests/baselines/reference/complexRecursiveCollections.errors.txt @@ -1,15 +1,26 @@ +immutable.ts(261,76): error TS2344: Type 'T' does not satisfy the constraint 'Object'. +immutable.ts(270,22): error TS2320: Interface 'Keyed' cannot simultaneously extend types 'Seq' and 'Keyed'. + Named property 'size' of types 'Seq' and 'Keyed' are not identical. +immutable.ts(289,22): error TS2320: Interface 'Indexed' cannot simultaneously extend types 'Seq' and 'Indexed'. + Named property 'size' of types 'Seq' and 'Indexed' are not identical. +immutable.ts(305,22): error TS2320: Interface 'Set' cannot simultaneously extend types 'Seq' and 'Set'. + Named property 'size' of types 'Seq' and 'Set' are not identical. +immutable.ts(323,20): error TS2430: Interface 'Seq' incorrectly extends interface 'Collection'. + The types of 'map(...).size' are incompatible between these types. + Type 'number | undefined' is not assignable to type 'number'. + Type 'undefined' is not assignable to type 'number'. immutable.ts(341,22): error TS2430: Interface 'Keyed' incorrectly extends interface 'Collection'. The types returned by 'toSeq()' are incompatible between these types. Type 'Keyed' is not assignable to type 'this'. - 'Keyed' is assignable to the constraint of type 'this', but 'this' could be instantiated with a different subtype of constraint 'Keyed'. + 'this' could be instantiated with an arbitrary type which could be unrelated to 'Keyed'. immutable.ts(359,22): error TS2430: Interface 'Indexed' incorrectly extends interface 'Collection'. The types returned by 'toSeq()' are incompatible between these types. Type 'Indexed' is not assignable to type 'this'. - 'Indexed' is assignable to the constraint of type 'this', but 'this' could be instantiated with a different subtype of constraint 'Indexed'. + 'this' could be instantiated with an arbitrary type which could be unrelated to 'Indexed'. immutable.ts(391,22): error TS2430: Interface 'Set' incorrectly extends interface 'Collection'. The types returned by 'toSeq()' are incompatible between these types. Type 'Set' is not assignable to type 'this'. - 'Set' is assignable to the constraint of type 'this', but 'this' could be instantiated with a different subtype of constraint 'Set'. + 'this' could be instantiated with an arbitrary type which could be unrelated to 'Set'. ==== complex.ts (0 errors) ==== @@ -33,7 +44,7 @@ immutable.ts(391,22): error TS2430: Interface 'Set' incorrectly extends inter flatMap(mapper: (value: T, key: void, iter: this) => Ara, context?: any): N2; toSeq(): N2; } -==== immutable.ts (3 errors) ==== +==== immutable.ts (8 errors) ==== // Test that complex recursive collections can pass the `extends` assignability check without // running out of memory. This bug was exposed in Typescript 2.4 when more generic signatures // started being checked. @@ -295,6 +306,9 @@ immutable.ts(391,22): error TS2430: Interface 'Set' incorrectly extends inter } } export function Record(defaultValues: T, name?: string): Record.Class; + ~ +!!! error TS2344: Type 'T' does not satisfy the constraint 'Object'. +!!! related TS2208 immutable.ts:261:26: This type parameter might need an `extends Object` constraint. export namespace Seq { function isSeq(maybeSeq: any): maybeSeq is Seq.Indexed | Seq.Keyed; function of(...values: Array): Seq.Indexed; @@ -304,6 +318,9 @@ immutable.ts(391,22): error TS2430: Interface 'Set' incorrectly extends inter export function Keyed(): Seq.Keyed; export function Keyed(): Seq.Keyed; export interface Keyed extends Seq, Collection.Keyed { + ~~~~~ +!!! error TS2320: Interface 'Keyed' cannot simultaneously extend types 'Seq' and 'Keyed'. +!!! error TS2320: Named property 'size' of types 'Seq' and 'Keyed' are not identical. toJS(): Object; toJSON(): { [key: string]: V }; toSeq(): this; @@ -323,6 +340,9 @@ immutable.ts(391,22): error TS2430: Interface 'Set' incorrectly extends inter export function Indexed(): Seq.Indexed; export function Indexed(collection: Iterable): Seq.Indexed; export interface Indexed extends Seq, Collection.Indexed { + ~~~~~~~ +!!! error TS2320: Interface 'Indexed' cannot simultaneously extend types 'Seq' and 'Indexed'. +!!! error TS2320: Named property 'size' of types 'Seq' and 'Indexed' are not identical. toJS(): Array; toJSON(): Array; toSeq(): this; @@ -339,6 +359,9 @@ immutable.ts(391,22): error TS2430: Interface 'Set' incorrectly extends inter export function Set(): Seq.Set; export function Set(collection: Iterable): Seq.Set; export interface Set extends Seq, Collection.Set { + ~~~ +!!! error TS2320: Interface 'Set' cannot simultaneously extend types 'Seq' and 'Set'. +!!! error TS2320: Named property 'size' of types 'Seq' and 'Set' are not identical. toJS(): Array; toJSON(): Array; toSeq(): this; @@ -357,6 +380,11 @@ immutable.ts(391,22): error TS2430: Interface 'Set' incorrectly extends inter export function Seq(obj: {[key: string]: V}): Seq.Keyed; export function Seq(): Seq; export interface Seq extends Collection { + ~~~ +!!! error TS2430: Interface 'Seq' incorrectly extends interface 'Collection'. +!!! error TS2430: The types of 'map(...).size' are incompatible between these types. +!!! error TS2430: Type 'number | undefined' is not assignable to type 'number'. +!!! error TS2430: Type 'undefined' is not assignable to type 'number'. readonly size: number | undefined; // Force evaluation cacheResult(): this; @@ -379,7 +407,7 @@ immutable.ts(391,22): error TS2430: Interface 'Set' incorrectly extends inter !!! error TS2430: Interface 'Keyed' incorrectly extends interface 'Collection'. !!! error TS2430: The types returned by 'toSeq()' are incompatible between these types. !!! error TS2430: Type 'Keyed' is not assignable to type 'this'. -!!! error TS2430: 'Keyed' is assignable to the constraint of type 'this', but 'this' could be instantiated with a different subtype of constraint 'Keyed'. +!!! error TS2430: 'this' could be instantiated with an arbitrary type which could be unrelated to 'Keyed'. toJS(): Object; toJSON(): { [key: string]: V }; toSeq(): Seq.Keyed; @@ -402,7 +430,7 @@ immutable.ts(391,22): error TS2430: Interface 'Set' incorrectly extends inter !!! error TS2430: Interface 'Indexed' incorrectly extends interface 'Collection'. !!! error TS2430: The types returned by 'toSeq()' are incompatible between these types. !!! error TS2430: Type 'Indexed' is not assignable to type 'this'. -!!! error TS2430: 'Indexed' is assignable to the constraint of type 'this', but 'this' could be instantiated with a different subtype of constraint 'Indexed'. +!!! error TS2430: 'this' could be instantiated with an arbitrary type which could be unrelated to 'Indexed'. toJS(): Array; toJSON(): Array; // Reading values @@ -439,7 +467,7 @@ immutable.ts(391,22): error TS2430: Interface 'Set' incorrectly extends inter !!! error TS2430: Interface 'Set' incorrectly extends interface 'Collection'. !!! error TS2430: The types returned by 'toSeq()' are incompatible between these types. !!! error TS2430: Type 'Set' is not assignable to type 'this'. -!!! error TS2430: 'Set' is assignable to the constraint of type 'this', but 'this' could be instantiated with a different subtype of constraint 'Set'. +!!! error TS2430: 'this' could be instantiated with an arbitrary type which could be unrelated to 'Set'. toJS(): Array; toJSON(): Array; toSeq(): Seq.Set; diff --git a/tests/baselines/reference/complexRecursiveCollections.js b/tests/baselines/reference/complexRecursiveCollections.js index 267212e6b99bb..46fd3a635cd65 100644 --- a/tests/baselines/reference/complexRecursiveCollections.js +++ b/tests/baselines/reference/complexRecursiveCollections.js @@ -535,4 +535,6 @@ declare module "immutable" { //// [complex.js] +"use strict"; //// [immutable.js] +"use strict"; diff --git a/tests/baselines/reference/complexRecursiveCollections.types b/tests/baselines/reference/complexRecursiveCollections.types index e0d38c147495c..bf8ac7a108566 100644 --- a/tests/baselines/reference/complexRecursiveCollections.types +++ b/tests/baselines/reference/complexRecursiveCollections.types @@ -1,7 +1,8 @@ //// [tests/cases/compiler/complexRecursiveCollections.ts] //// === Performance Stats === -Assignability cache: 10,000 +Identity cache: 2,500 +Assignability cache: 5,000 Type Count: 50,000 Instantiation count: 100,000 Symbol count: 100,000 @@ -148,8 +149,8 @@ declare namespace Immutable { > : ^ ^^ ^^ ^^^ ^^^^^ >jsValue : any > : ^^^ ->reviver : (key: string | number, sequence: Collection.Keyed | Collection.Indexed, path?: Array) => any -> : ^ ^^ ^^ ^^ ^^ ^^^ ^^^^^ +>reviver : ((key: string | number, sequence: Collection.Keyed | Collection.Indexed, path?: Array) => any) | undefined +> : ^^ ^^ ^^ ^^ ^^ ^^^ ^^^^^ ^^^^^^^^^^^^^ >key : string | number > : ^^^^^^^^^^^^^^^ >sequence : Collection.Keyed | Collection.Indexed @@ -158,8 +159,8 @@ declare namespace Immutable { > : ^^^ >Collection : any > : ^^^ ->path : (string | number)[] -> : ^^^^^^^^^^^^^^^^^^^ +>path : (string | number)[] | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ export function is(first: any, second: any): boolean; >is : (first: any, second: any) => boolean @@ -1520,12 +1521,12 @@ declare namespace Immutable { export function Range(start?: number, end?: number, step?: number): Seq.Indexed; >Range : (start?: number, end?: number, step?: number) => Seq.Indexed > : ^ ^^^ ^^ ^^^ ^^ ^^^ ^^^^^ ->start : number -> : ^^^^^^ ->end : number -> : ^^^^^^ ->step : number -> : ^^^^^^ +>start : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>end : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>step : number | undefined +> : ^^^^^^^^^^^^^^^^^^ >Seq : any > : ^^^ @@ -1534,8 +1535,8 @@ declare namespace Immutable { > : ^ ^^ ^^ ^^ ^^^ ^^^^^ >value : T > : ^ ->times : number -> : ^^^^^^ +>times : number | undefined +> : ^^^^^^^^^^^^^^^^^^ >Seq : any > : ^^^ @@ -1559,12 +1560,12 @@ declare namespace Immutable { export interface Class { (values?: Partial | Iterable<[string, any]>): Instance & Readonly; ->values : Partial | Iterable<[string, any]> -> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>values : Partial | Iterable<[string, any]> | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ new (values?: Partial | Iterable<[string, any]>): Instance & Readonly; ->values : Partial | Iterable<[string, any]> -> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>values : Partial | Iterable<[string, any]> | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ } export interface Instance { readonly size: number; @@ -1783,8 +1784,8 @@ declare namespace Immutable { > : ^^^^^^^^^^^^^ >defaultValues : T > : ^ ->name : string -> : ^^^^^^ +>name : string | undefined +> : ^^^^^^^^^^^^^^^^^^ >Record : any > : ^^^ @@ -2268,8 +2269,8 @@ declare namespace Immutable { export interface Seq extends Collection { readonly size: number | undefined; ->size : number -> : ^^^^^^ +>size : number | undefined +> : ^^^^^^^^^^^^^^^^^^ // Force evaluation cacheResult(): this; @@ -3149,8 +3150,8 @@ declare namespace Immutable { sort(comparator?: (valueA: V, valueB: V) => number): this; >sort : (comparator?: (valueA: V, valueB: V) => number) => this > : ^ ^^^ ^^^^^ ->comparator : (valueA: V, valueB: V) => number -> : ^ ^^ ^^ ^^ ^^^^^ +>comparator : ((valueA: V, valueB: V) => number) | undefined +> : ^^ ^^ ^^ ^^ ^^^^^ ^^^^^^^^^^^^^ >valueA : V > : ^ >valueB : V @@ -3167,8 +3168,8 @@ declare namespace Immutable { > : ^ >iter : this > : ^^^^ ->comparator : (valueA: C, valueB: C) => number -> : ^ ^^ ^^ ^^ ^^^^^ +>comparator : ((valueA: C, valueB: C) => number) | undefined +> : ^^ ^^ ^^ ^^ ^^^^^ ^^^^^^^^^^^^^ >valueA : C > : ^ >valueB : C @@ -3209,10 +3210,10 @@ declare namespace Immutable { slice(begin?: number, end?: number): this; >slice : (begin?: number, end?: number) => this > : ^ ^^^ ^^ ^^^ ^^^^^ ->begin : number -> : ^^^^^^ ->end : number -> : ^^^^^^ +>begin : number | undefined +> : ^^^^^^^^^^^^^^^^^^ +>end : number | undefined +> : ^^^^^^^^^^^^^^^^^^ rest(): this; >rest : () => this @@ -3312,14 +3313,14 @@ declare namespace Immutable { flatten(depth?: number): Collection; >flatten : { (depth?: number): Collection; (shallow?: boolean): Collection; } > : ^^^ ^^^ ^^^ ^^^ ^^^ ^^^ ^^^ ->depth : number -> : ^^^^^^ +>depth : number | undefined +> : ^^^^^^^^^^^^^^^^^^ flatten(shallow?: boolean): Collection; >flatten : { (depth?: number): Collection; (shallow?: boolean): Collection; } > : ^^^ ^^^ ^^^ ^^^ ^^^ ^^^ ^^^ ->shallow : boolean -> : ^^^^^^^ +>shallow : boolean | undefined +> : ^^^^^^^^^^^^^^^^^^^ flatMap(mapper: (value: V, key: K, iter: this) => Iterable, context?: any): Collection; >flatMap : (mapper: (value: V, key: K, iter: this) => Iterable, context?: any) => Collection @@ -3431,8 +3432,8 @@ declare namespace Immutable { join(separator?: string): string; >join : (separator?: string) => string > : ^ ^^^ ^^^^^ ->separator : string -> : ^^^^^^ +>separator : string | undefined +> : ^^^^^^^^^^^^^^^^^^ isEmpty(): boolean; >isEmpty : () => boolean @@ -3484,8 +3485,8 @@ declare namespace Immutable { > : ^^^^ >context : any > : ^^^ ->notSetValue : V -> : ^ +>notSetValue : V | undefined +> : ^^^^^^^^^^^^^ findLast(predicate: (value: V, key: K, iter: this) => boolean, context?: any, notSetValue?: V): V | undefined; >findLast : (predicate: (value: V, key: K, iter: this) => boolean, context?: any, notSetValue?: V) => V | undefined @@ -3500,8 +3501,8 @@ declare namespace Immutable { > : ^^^^ >context : any > : ^^^ ->notSetValue : V -> : ^ +>notSetValue : V | undefined +> : ^^^^^^^^^^^^^ findEntry(predicate: (value: V, key: K, iter: this) => boolean, context?: any, notSetValue?: V): [K, V] | undefined; >findEntry : (predicate: (value: V, key: K, iter: this) => boolean, context?: any, notSetValue?: V) => [K, V] | undefined @@ -3516,8 +3517,8 @@ declare namespace Immutable { > : ^^^^ >context : any > : ^^^ ->notSetValue : V -> : ^ +>notSetValue : V | undefined +> : ^^^^^^^^^^^^^ findLastEntry(predicate: (value: V, key: K, iter: this) => boolean, context?: any, notSetValue?: V): [K, V] | undefined; >findLastEntry : (predicate: (value: V, key: K, iter: this) => boolean, context?: any, notSetValue?: V) => [K, V] | undefined @@ -3532,8 +3533,8 @@ declare namespace Immutable { > : ^^^^ >context : any > : ^^^ ->notSetValue : V -> : ^ +>notSetValue : V | undefined +> : ^^^^^^^^^^^^^ findKey(predicate: (value: V, key: K, iter: this) => boolean, context?: any): K | undefined; >findKey : (predicate: (value: V, key: K, iter: this) => boolean, context?: any) => K | undefined @@ -3578,8 +3579,8 @@ declare namespace Immutable { max(comparator?: (valueA: V, valueB: V) => number): V | undefined; >max : (comparator?: (valueA: V, valueB: V) => number) => V | undefined > : ^ ^^^ ^^^^^ ->comparator : (valueA: V, valueB: V) => number -> : ^ ^^ ^^ ^^ ^^^^^ +>comparator : ((valueA: V, valueB: V) => number) | undefined +> : ^^ ^^ ^^ ^^ ^^^^^ ^^^^^^^^^^^^^ >valueA : V > : ^ >valueB : V @@ -3596,8 +3597,8 @@ declare namespace Immutable { > : ^ >iter : this > : ^^^^ ->comparator : (valueA: C, valueB: C) => number -> : ^ ^^ ^^ ^^ ^^^^^ +>comparator : ((valueA: C, valueB: C) => number) | undefined +> : ^^ ^^ ^^ ^^ ^^^^^ ^^^^^^^^^^^^^ >valueA : C > : ^ >valueB : C @@ -3606,8 +3607,8 @@ declare namespace Immutable { min(comparator?: (valueA: V, valueB: V) => number): V | undefined; >min : (comparator?: (valueA: V, valueB: V) => number) => V | undefined > : ^ ^^^ ^^^^^ ->comparator : (valueA: V, valueB: V) => number -> : ^ ^^ ^^ ^^ ^^^^^ +>comparator : ((valueA: V, valueB: V) => number) | undefined +> : ^^ ^^ ^^ ^^ ^^^^^ ^^^^^^^^^^^^^ >valueA : V > : ^ >valueB : V @@ -3624,8 +3625,8 @@ declare namespace Immutable { > : ^ >iter : this > : ^^^^ ->comparator : (valueA: C, valueB: C) => number -> : ^ ^^ ^^ ^^ ^^^^^ +>comparator : ((valueA: C, valueB: C) => number) | undefined +> : ^^ ^^ ^^ ^^ ^^^^^ ^^^^^^^^^^^^^ >valueA : C > : ^ >valueB : C diff --git a/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.js b/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.js index 8c25eb7d7246f..2a7f4eb8f4102 100644 --- a/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.js +++ b/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.js @@ -8,6 +8,7 @@ class S18 extends S18 //// [complicatedGenericRecursiveBaseClassReference.js] +"use strict"; class S18 extends S18 { } (new S18(123)).S18 = 0; diff --git a/tests/baselines/reference/complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.types b/tests/baselines/reference/complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.types index bfb1d6d746566..75cf0e8dbb3c5 100644 --- a/tests/baselines/reference/complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.types +++ b/tests/baselines/reference/complicatedIndexedAccessKeyofReliesOnKeyofNeverUpperBound.types @@ -104,12 +104,12 @@ const newTextChannel = makeNewChannel('text'); newTextChannel.phoneNumber = '613-555-1234'; >newTextChannel.phoneNumber = '613-555-1234' : "613-555-1234" > : ^^^^^^^^^^^^^^ ->newTextChannel.phoneNumber : string -> : ^^^^^^ +>newTextChannel.phoneNumber : string | undefined +> : ^^^^^^^^^^^^^^^^^^ >newTextChannel : NewChannel > : ^^^^^^^^^^^^^^^^^^^^^^^ ->phoneNumber : string -> : ^^^^^^ +>phoneNumber : string | undefined +> : ^^^^^^^^^^^^^^^^^^ >'613-555-1234' : "613-555-1234" > : ^^^^^^^^^^^^^^ @@ -127,12 +127,12 @@ const newTextChannel2 : NewChannel = makeNewChannel('text'); newTextChannel2.phoneNumber = '613-555-1234'; >newTextChannel2.phoneNumber = '613-555-1234' : "613-555-1234" > : ^^^^^^^^^^^^^^ ->newTextChannel2.phoneNumber : string -> : ^^^^^^ +>newTextChannel2.phoneNumber : string | undefined +> : ^^^^^^^^^^^^^^^^^^ >newTextChannel2 : NewChannel > : ^^^^^^^^^^^^^^^^^^^^^^^ ->phoneNumber : string -> : ^^^^^^ +>phoneNumber : string | undefined +> : ^^^^^^^^^^^^^^^^^^ >'613-555-1234' : "613-555-1234" > : ^^^^^^^^^^^^^^ diff --git a/tests/baselines/reference/complicatedPrivacy(target=es2015).js b/tests/baselines/reference/complicatedPrivacy(target=es2015).js index d83a150339f13..085199218c6ef 100644 --- a/tests/baselines/reference/complicatedPrivacy(target=es2015).js +++ b/tests/baselines/reference/complicatedPrivacy(target=es2015).js @@ -107,6 +107,7 @@ namespace mglo5 { //// [complicatedPrivacy.js] +"use strict"; var m1; (function (m1) { let m2; diff --git a/tests/baselines/reference/complicatedPrivacy(target=es5).js b/tests/baselines/reference/complicatedPrivacy(target=es5).js index 0b8d56d8611c1..7bd5ed9a08354 100644 --- a/tests/baselines/reference/complicatedPrivacy(target=es5).js +++ b/tests/baselines/reference/complicatedPrivacy(target=es5).js @@ -107,6 +107,7 @@ namespace mglo5 { //// [complicatedPrivacy.js] +"use strict"; var m1; (function (m1) { var m2; diff --git a/tests/baselines/reference/compositeGenericFunction.errors.txt b/tests/baselines/reference/compositeGenericFunction.errors.txt new file mode 100644 index 0000000000000..ce6288182b1fe --- /dev/null +++ b/tests/baselines/reference/compositeGenericFunction.errors.txt @@ -0,0 +1,14 @@ +compositeGenericFunction.ts(3,44): error TS2322: Type 'null' is not assignable to type 'R'. + 'R' could be instantiated with an arbitrary type which could be unrelated to 'null'. + + +==== compositeGenericFunction.ts (1 errors) ==== + function f(value: T) { return value; }; + + function h(func: (x: number) => R): R { return null; } + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'R'. +!!! error TS2322: 'R' could be instantiated with an arbitrary type which could be unrelated to 'null'. + + var z: number = h(f); + var z: number = h(f); \ No newline at end of file diff --git a/tests/baselines/reference/compositeGenericFunction.js b/tests/baselines/reference/compositeGenericFunction.js index fc60f37904ce5..e3e5839814c32 100644 --- a/tests/baselines/reference/compositeGenericFunction.js +++ b/tests/baselines/reference/compositeGenericFunction.js @@ -9,6 +9,7 @@ var z: number = h(f); var z: number = h(f); //// [compositeGenericFunction.js] +"use strict"; function f(value) { return value; } ; function h(func) { return null; } diff --git a/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.errors.txt b/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.errors.txt index 38ebd30e53539..e68a5f09ec17f 100644 --- a/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.errors.txt +++ b/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.errors.txt @@ -1,7 +1,7 @@ -compoundAdditionAssignmentLHSCanBeAssigned.ts(32,1): error TS2365: Operator '+=' cannot be applied to types 'number' and 'null'. -compoundAdditionAssignmentLHSCanBeAssigned.ts(33,1): error TS2365: Operator '+=' cannot be applied to types 'number' and 'undefined'. -compoundAdditionAssignmentLHSCanBeAssigned.ts(39,1): error TS2365: Operator '+=' cannot be applied to types 'E' and 'null'. -compoundAdditionAssignmentLHSCanBeAssigned.ts(40,1): error TS2365: Operator '+=' cannot be applied to types 'E' and 'undefined'. +compoundAdditionAssignmentLHSCanBeAssigned.ts(32,7): error TS18050: The value 'null' cannot be used here. +compoundAdditionAssignmentLHSCanBeAssigned.ts(33,7): error TS18050: The value 'undefined' cannot be used here. +compoundAdditionAssignmentLHSCanBeAssigned.ts(39,7): error TS18050: The value 'null' cannot be used here. +compoundAdditionAssignmentLHSCanBeAssigned.ts(40,7): error TS18050: The value 'undefined' cannot be used here. ==== compoundAdditionAssignmentLHSCanBeAssigned.ts (4 errors) ==== @@ -37,22 +37,22 @@ compoundAdditionAssignmentLHSCanBeAssigned.ts(40,1): error TS2365: Operator '+=' x3 += 0; x3 += E.a; x3 += null; - ~~~~~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types 'number' and 'null'. + ~~~~ +!!! error TS18050: The value 'null' cannot be used here. x3 += undefined; - ~~~~~~~~~~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types 'number' and 'undefined'. + ~~~~~~~~~ +!!! error TS18050: The value 'undefined' cannot be used here. declare var x4: E; x4 += a; x4 += 0; x4 += E.a; x4 += null; - ~~~~~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types 'E' and 'null'. + ~~~~ +!!! error TS18050: The value 'null' cannot be used here. x4 += undefined; - ~~~~~~~~~~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types 'E' and 'undefined'. + ~~~~~~~~~ +!!! error TS18050: The value 'undefined' cannot be used here. declare var x5: boolean; x5 += a; diff --git a/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.js b/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.js index 6e1cdb2348145..754cd1eafd5fa 100644 --- a/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.js +++ b/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.js @@ -53,6 +53,7 @@ declare var x7: void; x7 += a; //// [compoundAdditionAssignmentLHSCanBeAssigned.js] +"use strict"; var E; (function (E) { E[E["a"] = 0] = "a"; diff --git a/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.js b/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.js index 4cb2a4fd99579..6a5066273a8fc 100644 --- a/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.js +++ b/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.js @@ -20,6 +20,7 @@ declare var x5: void; x5 += ''; //// [compoundAdditionAssignmentLHSCannotBeAssigned.js] +"use strict"; // string can add every type, and result string cannot be assigned to below types var E; (function (E) { diff --git a/tests/baselines/reference/compoundAdditionAssignmentWithInvalidOperands.errors.txt b/tests/baselines/reference/compoundAdditionAssignmentWithInvalidOperands.errors.txt index 50ca18d2c1184..f716275a1ffe9 100644 --- a/tests/baselines/reference/compoundAdditionAssignmentWithInvalidOperands.errors.txt +++ b/tests/baselines/reference/compoundAdditionAssignmentWithInvalidOperands.errors.txt @@ -3,22 +3,22 @@ compoundAdditionAssignmentWithInvalidOperands.ts(7,1): error TS2365: Operator '+ compoundAdditionAssignmentWithInvalidOperands.ts(8,1): error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'number'. compoundAdditionAssignmentWithInvalidOperands.ts(9,1): error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'E'. compoundAdditionAssignmentWithInvalidOperands.ts(10,1): error TS2365: Operator '+=' cannot be applied to types 'boolean' and '{}'. -compoundAdditionAssignmentWithInvalidOperands.ts(11,1): error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'null'. -compoundAdditionAssignmentWithInvalidOperands.ts(12,1): error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'undefined'. +compoundAdditionAssignmentWithInvalidOperands.ts(11,7): error TS18050: The value 'null' cannot be used here. +compoundAdditionAssignmentWithInvalidOperands.ts(12,7): error TS18050: The value 'undefined' cannot be used here. compoundAdditionAssignmentWithInvalidOperands.ts(15,1): error TS2365: Operator '+=' cannot be applied to types '{}' and 'void'. compoundAdditionAssignmentWithInvalidOperands.ts(16,1): error TS2365: Operator '+=' cannot be applied to types '{}' and 'boolean'. compoundAdditionAssignmentWithInvalidOperands.ts(17,1): error TS2365: Operator '+=' cannot be applied to types '{}' and 'number'. compoundAdditionAssignmentWithInvalidOperands.ts(18,1): error TS2365: Operator '+=' cannot be applied to types '{}' and 'E'. compoundAdditionAssignmentWithInvalidOperands.ts(19,1): error TS2365: Operator '+=' cannot be applied to types '{}' and '{}'. -compoundAdditionAssignmentWithInvalidOperands.ts(20,1): error TS2365: Operator '+=' cannot be applied to types '{}' and 'null'. -compoundAdditionAssignmentWithInvalidOperands.ts(21,1): error TS2365: Operator '+=' cannot be applied to types '{}' and 'undefined'. +compoundAdditionAssignmentWithInvalidOperands.ts(20,7): error TS18050: The value 'null' cannot be used here. +compoundAdditionAssignmentWithInvalidOperands.ts(21,7): error TS18050: The value 'undefined' cannot be used here. compoundAdditionAssignmentWithInvalidOperands.ts(24,1): error TS2365: Operator '+=' cannot be applied to types 'void' and 'void'. compoundAdditionAssignmentWithInvalidOperands.ts(25,1): error TS2365: Operator '+=' cannot be applied to types 'void' and 'boolean'. compoundAdditionAssignmentWithInvalidOperands.ts(26,1): error TS2365: Operator '+=' cannot be applied to types 'void' and 'number'. compoundAdditionAssignmentWithInvalidOperands.ts(27,1): error TS2365: Operator '+=' cannot be applied to types 'void' and 'E'. compoundAdditionAssignmentWithInvalidOperands.ts(28,1): error TS2365: Operator '+=' cannot be applied to types 'void' and '{}'. -compoundAdditionAssignmentWithInvalidOperands.ts(29,1): error TS2365: Operator '+=' cannot be applied to types 'void' and 'null'. -compoundAdditionAssignmentWithInvalidOperands.ts(30,1): error TS2365: Operator '+=' cannot be applied to types 'void' and 'undefined'. +compoundAdditionAssignmentWithInvalidOperands.ts(29,7): error TS18050: The value 'null' cannot be used here. +compoundAdditionAssignmentWithInvalidOperands.ts(30,7): error TS18050: The value 'undefined' cannot be used here. compoundAdditionAssignmentWithInvalidOperands.ts(33,1): error TS2365: Operator '+=' cannot be applied to types 'number' and 'void'. compoundAdditionAssignmentWithInvalidOperands.ts(34,1): error TS2365: Operator '+=' cannot be applied to types 'number' and 'boolean'. compoundAdditionAssignmentWithInvalidOperands.ts(35,1): error TS2365: Operator '+=' cannot be applied to types 'number' and '{}'. @@ -49,11 +49,11 @@ compoundAdditionAssignmentWithInvalidOperands.ts(40,1): error TS2365: Operator ' ~~~~~~~~ !!! error TS2365: Operator '+=' cannot be applied to types 'boolean' and '{}'. x1 += null; - ~~~~~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'null'. + ~~~~ +!!! error TS18050: The value 'null' cannot be used here. x1 += undefined; - ~~~~~~~~~~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types 'boolean' and 'undefined'. + ~~~~~~~~~ +!!! error TS18050: The value 'undefined' cannot be used here. declare var x2: {}; x2 += a; @@ -72,11 +72,11 @@ compoundAdditionAssignmentWithInvalidOperands.ts(40,1): error TS2365: Operator ' ~~~~~~~~ !!! error TS2365: Operator '+=' cannot be applied to types '{}' and '{}'. x2 += null; - ~~~~~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types '{}' and 'null'. + ~~~~ +!!! error TS18050: The value 'null' cannot be used here. x2 += undefined; - ~~~~~~~~~~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types '{}' and 'undefined'. + ~~~~~~~~~ +!!! error TS18050: The value 'undefined' cannot be used here. declare var x3: void; x3 += a; @@ -95,11 +95,11 @@ compoundAdditionAssignmentWithInvalidOperands.ts(40,1): error TS2365: Operator ' ~~~~~~~~ !!! error TS2365: Operator '+=' cannot be applied to types 'void' and '{}'. x3 += null; - ~~~~~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types 'void' and 'null'. + ~~~~ +!!! error TS18050: The value 'null' cannot be used here. x3 += undefined; - ~~~~~~~~~~~~~~~ -!!! error TS2365: Operator '+=' cannot be applied to types 'void' and 'undefined'. + ~~~~~~~~~ +!!! error TS18050: The value 'undefined' cannot be used here. declare var x4: number; x4 += a; diff --git a/tests/baselines/reference/compoundAdditionAssignmentWithInvalidOperands.js b/tests/baselines/reference/compoundAdditionAssignmentWithInvalidOperands.js index 4227fc1bd64f3..ef5c068a6b4f0 100644 --- a/tests/baselines/reference/compoundAdditionAssignmentWithInvalidOperands.js +++ b/tests/baselines/reference/compoundAdditionAssignmentWithInvalidOperands.js @@ -43,6 +43,7 @@ x5 += true; x5 += {}; //// [compoundAdditionAssignmentWithInvalidOperands.js] +"use strict"; var E; (function (E) { E[E["a"] = 0] = "a"; diff --git a/tests/baselines/reference/compoundArithmeticAssignmentLHSCanBeAssigned.js b/tests/baselines/reference/compoundArithmeticAssignmentLHSCanBeAssigned.js index 0d234db3d1166..4f0be32b48aef 100644 --- a/tests/baselines/reference/compoundArithmeticAssignmentLHSCanBeAssigned.js +++ b/tests/baselines/reference/compoundArithmeticAssignmentLHSCanBeAssigned.js @@ -29,6 +29,7 @@ x3 *= null; x3 *= undefined; //// [compoundArithmeticAssignmentLHSCanBeAssigned.js] +"use strict"; var E; (function (E) { E[E["a"] = 0] = "a"; diff --git a/tests/baselines/reference/compoundArithmeticAssignmentWithInvalidOperands.js b/tests/baselines/reference/compoundArithmeticAssignmentWithInvalidOperands.js index f63a4ecd520f4..0492b888059f3 100644 --- a/tests/baselines/reference/compoundArithmeticAssignmentWithInvalidOperands.js +++ b/tests/baselines/reference/compoundArithmeticAssignmentWithInvalidOperands.js @@ -63,6 +63,7 @@ x6 *= '' x6 *= {}; //// [compoundArithmeticAssignmentWithInvalidOperands.js] +"use strict"; var E; (function (E) { E[E["a"] = 0] = "a"; diff --git a/tests/baselines/reference/compoundAssignmentLHSIsReference.js b/tests/baselines/reference/compoundAssignmentLHSIsReference.js index b828b631724f0..70937b90fcf0e 100644 --- a/tests/baselines/reference/compoundAssignmentLHSIsReference.js +++ b/tests/baselines/reference/compoundAssignmentLHSIsReference.js @@ -37,6 +37,7 @@ function fn2(x4: number) { (x3['a']) += value; //// [compoundAssignmentLHSIsReference.js] +"use strict"; var value; // identifiers: variable and parameter var x1; diff --git a/tests/baselines/reference/compoundAssignmentLHSIsValue.js b/tests/baselines/reference/compoundAssignmentLHSIsValue.js index bde07a458cd32..042bc14865bf0 100644 --- a/tests/baselines/reference/compoundAssignmentLHSIsValue.js +++ b/tests/baselines/reference/compoundAssignmentLHSIsValue.js @@ -125,6 +125,7 @@ foo() += value; (foo()) += value; //// [compoundAssignmentLHSIsValue.js] +"use strict"; // expected error for all the LHS of compound assignments (arithmetic and addition) var value; // this diff --git a/tests/baselines/reference/compoundExponentiationAssignmentLHSCanBeAssigned1.js b/tests/baselines/reference/compoundExponentiationAssignmentLHSCanBeAssigned1.js index aacdc430b452d..f8ad0e746bfeb 100644 --- a/tests/baselines/reference/compoundExponentiationAssignmentLHSCanBeAssigned1.js +++ b/tests/baselines/reference/compoundExponentiationAssignmentLHSCanBeAssigned1.js @@ -29,6 +29,7 @@ x3 **= null; x3 **= undefined; //// [compoundExponentiationAssignmentLHSCanBeAssigned1.js] +"use strict"; var E; (function (E) { E[E["a"] = 0] = "a"; diff --git a/tests/baselines/reference/compoundExponentiationAssignmentLHSCannotBeAssigned.js b/tests/baselines/reference/compoundExponentiationAssignmentLHSCannotBeAssigned.js index ffbe6ed056dc3..a69c6a38f023f 100644 --- a/tests/baselines/reference/compoundExponentiationAssignmentLHSCannotBeAssigned.js +++ b/tests/baselines/reference/compoundExponentiationAssignmentLHSCannotBeAssigned.js @@ -63,6 +63,7 @@ x6 **= '' x6 **= {}; //// [compoundExponentiationAssignmentLHSCannotBeAssigned.js] +"use strict"; var E; (function (E) { E[E["a"] = 0] = "a"; diff --git a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.errors.txt b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.errors.txt new file mode 100644 index 0000000000000..8c6f04230acfe --- /dev/null +++ b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.errors.txt @@ -0,0 +1,47 @@ +compoundExponentiationAssignmentLHSIsReference.ts(5,1): error TS2454: Variable 'x1' is used before being assigned. +compoundExponentiationAssignmentLHSIsReference.ts(13,1): error TS2454: Variable 'x3' is used before being assigned. +compoundExponentiationAssignmentLHSIsReference.ts(15,1): error TS2454: Variable 'x3' is used before being assigned. +compoundExponentiationAssignmentLHSIsReference.ts(18,2): error TS2454: Variable 'x1' is used before being assigned. +compoundExponentiationAssignmentLHSIsReference.ts(24,2): error TS2454: Variable 'x3' is used before being assigned. +compoundExponentiationAssignmentLHSIsReference.ts(26,2): error TS2454: Variable 'x3' is used before being assigned. + + +==== compoundExponentiationAssignmentLHSIsReference.ts (6 errors) ==== + var value: any; + + // identifiers: variable and parameter + var x1: number; + x1 **= value; + ~~ +!!! error TS2454: Variable 'x1' is used before being assigned. + + function fn1(x2: number) { + x2 **= value; + } + + // property accesses + var x3: { a: number }; + x3.a **= value; + ~~ +!!! error TS2454: Variable 'x3' is used before being assigned. + + x3['a'] **= value; + ~~ +!!! error TS2454: Variable 'x3' is used before being assigned. + + // parentheses, the contained expression is reference + (x1) **= value; + ~~ +!!! error TS2454: Variable 'x1' is used before being assigned. + + function fn2(x4: number) { + (x4) **= value; + } + + (x3.a) **= value; + ~~ +!!! error TS2454: Variable 'x3' is used before being assigned. + + (x3['a']) **= value; + ~~ +!!! error TS2454: Variable 'x3' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.js b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.js index fa934526c5424..3410267ab5a2f 100644 --- a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.js +++ b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.js @@ -29,6 +29,7 @@ function fn2(x4: number) { (x3['a']) **= value; //// [compoundExponentiationAssignmentLHSIsReference.js] +"use strict"; var _a, _b, _c; var value; // identifiers: variable and parameter diff --git a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.types b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.types index 9a71c0e71ec45..fe0f6640ee69d 100644 --- a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.types +++ b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsReference.types @@ -3,6 +3,7 @@ === compoundExponentiationAssignmentLHSIsReference.ts === var value: any; >value : any +> : ^^^ // identifiers: variable and parameter var x1: number; @@ -15,6 +16,7 @@ x1 **= value; >x1 : number > : ^^^^^^ >value : any +> : ^^^ function fn1(x2: number) { >fn1 : (x2: number) => void @@ -28,6 +30,7 @@ function fn1(x2: number) { >x2 : number > : ^^^^^^ >value : any +> : ^^^ } // property accesses @@ -47,6 +50,7 @@ x3.a **= value; >a : number > : ^^^^^^ >value : any +> : ^^^ x3['a'] **= value; >x3['a'] **= value : number @@ -58,6 +62,7 @@ x3['a'] **= value; >'a' : "a" > : ^^^ >value : any +> : ^^^ // parentheses, the contained expression is reference (x1) **= value; @@ -68,6 +73,7 @@ x3['a'] **= value; >x1 : number > : ^^^^^^ >value : any +> : ^^^ function fn2(x4: number) { >fn2 : (x4: number) => void @@ -83,6 +89,7 @@ function fn2(x4: number) { >x4 : number > : ^^^^^^ >value : any +> : ^^^ } (x3.a) **= value; @@ -97,6 +104,7 @@ function fn2(x4: number) { >a : number > : ^^^^^^ >value : any +> : ^^^ (x3['a']) **= value; >(x3['a']) **= value : number @@ -110,4 +118,5 @@ function fn2(x4: number) { >'a' : "a" > : ^^^ >value : any +> : ^^^ diff --git a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js index 9610f25b58ce0..41d3f079f71a3 100644 --- a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js +++ b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js @@ -88,6 +88,7 @@ foo() **= value; (foo()) **= value; //// [compoundExponentiationAssignmentLHSIsValue.js] +"use strict"; // expected error for all the LHS of compound assignments (arithmetic and addition) var value; // this diff --git a/tests/baselines/reference/compoundVarDecl1.js b/tests/baselines/reference/compoundVarDecl1.js index 1b9992d5f5355..3b899b4738879 100644 --- a/tests/baselines/reference/compoundVarDecl1.js +++ b/tests/baselines/reference/compoundVarDecl1.js @@ -6,6 +6,7 @@ namespace Foo { var a = 1, b = 1; a = b + 2; } var foo = 4, bar = 5; //// [compoundVarDecl1.js] +"use strict"; var Foo; (function (Foo) { var a = 1, b = 1; diff --git a/tests/baselines/reference/computedEnumMemberSyntacticallyString(isolatedmodules=false).js b/tests/baselines/reference/computedEnumMemberSyntacticallyString(isolatedmodules=false).js index 38c360bdf0c83..f41e64f9d7576 100644 --- a/tests/baselines/reference/computedEnumMemberSyntacticallyString(isolatedmodules=false).js +++ b/tests/baselines/reference/computedEnumMemberSyntacticallyString(isolatedmodules=false).js @@ -18,6 +18,7 @@ enum Foo { //// [computedEnumMemberSyntacticallyString.js] +"use strict"; const BAR = 2..toFixed(0); var Foo; (function (Foo) { diff --git a/tests/baselines/reference/computedEnumMemberSyntacticallyString(isolatedmodules=true).js b/tests/baselines/reference/computedEnumMemberSyntacticallyString(isolatedmodules=true).js index 38c360bdf0c83..f41e64f9d7576 100644 --- a/tests/baselines/reference/computedEnumMemberSyntacticallyString(isolatedmodules=true).js +++ b/tests/baselines/reference/computedEnumMemberSyntacticallyString(isolatedmodules=true).js @@ -18,6 +18,7 @@ enum Foo { //// [computedEnumMemberSyntacticallyString.js] +"use strict"; const BAR = 2..toFixed(0); var Foo; (function (Foo) { diff --git a/tests/baselines/reference/computedPropertiesInDestructuring1.js b/tests/baselines/reference/computedPropertiesInDestructuring1.js index 83a70411f35eb..ea1dde9c34a7b 100644 --- a/tests/baselines/reference/computedPropertiesInDestructuring1.js +++ b/tests/baselines/reference/computedPropertiesInDestructuring1.js @@ -40,6 +40,7 @@ let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}]; //// [computedPropertiesInDestructuring1.js] +"use strict"; // destructuring in variable declarations let foo = "bar"; let { [foo]: bar } = { bar: "bar" }; diff --git a/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.js b/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.js index aa101eec9421b..84fef73b17eea 100644 --- a/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.js +++ b/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.js @@ -39,6 +39,7 @@ let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}]; //// [computedPropertiesInDestructuring1_ES6.js] +"use strict"; // destructuring in variable declarations let foo = "bar"; let { [foo]: bar } = { bar: "bar" }; diff --git a/tests/baselines/reference/computedPropertiesInDestructuring2.js b/tests/baselines/reference/computedPropertiesInDestructuring2.js index 54238b6f76192..f1db40b746f14 100644 --- a/tests/baselines/reference/computedPropertiesInDestructuring2.js +++ b/tests/baselines/reference/computedPropertiesInDestructuring2.js @@ -5,5 +5,6 @@ let foo2 = () => "bar"; let {[foo2()]: bar3} = {}; //// [computedPropertiesInDestructuring2.js] +"use strict"; let foo2 = () => "bar"; let { [foo2()]: bar3 } = {}; diff --git a/tests/baselines/reference/computedPropertiesInDestructuring2_ES6.js b/tests/baselines/reference/computedPropertiesInDestructuring2_ES6.js index 98a257f0c354b..7466a63c3a68e 100644 --- a/tests/baselines/reference/computedPropertiesInDestructuring2_ES6.js +++ b/tests/baselines/reference/computedPropertiesInDestructuring2_ES6.js @@ -5,5 +5,6 @@ let foo2 = () => "bar"; let {[foo2()]: bar3} = {}; //// [computedPropertiesInDestructuring2_ES6.js] +"use strict"; let foo2 = () => "bar"; let { [foo2()]: bar3 } = {}; diff --git a/tests/baselines/reference/computedPropertiesTransformedInOtherwiseNonTSClasses.errors.txt b/tests/baselines/reference/computedPropertiesTransformedInOtherwiseNonTSClasses.errors.txt new file mode 100644 index 0000000000000..3fc146b6f6a52 --- /dev/null +++ b/tests/baselines/reference/computedPropertiesTransformedInOtherwiseNonTSClasses.errors.txt @@ -0,0 +1,14 @@ +computedPropertiesTransformedInOtherwiseNonTSClasses.ts(5,9): error TS2564: Property '[NS.x]' has no initializer and is not definitely assigned in the constructor. + + +==== computedPropertiesTransformedInOtherwiseNonTSClasses.ts (1 errors) ==== + namespace NS { + export const x = Symbol(); + + class NotTransformed { + [NS.x]: number; + ~~~~~~ +!!! error TS2564: Property '[NS.x]' has no initializer and is not definitely assigned in the constructor. + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertiesTransformedInOtherwiseNonTSClasses.js b/tests/baselines/reference/computedPropertiesTransformedInOtherwiseNonTSClasses.js index bd632e809c7a6..bba6acc2d7543 100644 --- a/tests/baselines/reference/computedPropertiesTransformedInOtherwiseNonTSClasses.js +++ b/tests/baselines/reference/computedPropertiesTransformedInOtherwiseNonTSClasses.js @@ -11,6 +11,7 @@ namespace NS { //// [computedPropertiesTransformedInOtherwiseNonTSClasses.js] +"use strict"; var NS; (function (NS) { NS.x = Symbol(); diff --git a/tests/baselines/reference/computedPropertyName.types b/tests/baselines/reference/computedPropertyName.types index bad69ad360fc6..c424739f3e612 100644 --- a/tests/baselines/reference/computedPropertyName.types +++ b/tests/baselines/reference/computedPropertyName.types @@ -18,8 +18,8 @@ import type { onInit } from "./framework-hooks"; interface Component { [onInit]?(): void; ->[onInit] : () => void -> : ^^^^^^ +>[onInit] : (() => void) | undefined +> : ^^^^^^^ ^^^^^^^^^^^^^ >onInit : unique symbol > : ^^^^^^^^^^^^^ } diff --git a/tests/baselines/reference/computedPropertyNameAndTypeParameterConflict.js b/tests/baselines/reference/computedPropertyNameAndTypeParameterConflict.js index 128045887ae86..f0c7ccf3d1bc8 100644 --- a/tests/baselines/reference/computedPropertyNameAndTypeParameterConflict.js +++ b/tests/baselines/reference/computedPropertyNameAndTypeParameterConflict.js @@ -9,6 +9,7 @@ declare class Bar { //// [computedPropertyNameAndTypeParameterConflict.js] +"use strict"; //// [computedPropertyNameAndTypeParameterConflict.d.ts] diff --git a/tests/baselines/reference/computedPropertyNames10_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames10_ES5(target=es2015).js index 2f67b0207abc1..4624e04b5dba2 100644 --- a/tests/baselines/reference/computedPropertyNames10_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames10_ES5(target=es2015).js @@ -19,6 +19,7 @@ var v = { } //// [computedPropertyNames10_ES5.js] +"use strict"; var s; var n; var a; diff --git a/tests/baselines/reference/computedPropertyNames10_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames10_ES5(target=es5).js index 7a2aafa52e628..4f7bdd03756df 100644 --- a/tests/baselines/reference/computedPropertyNames10_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames10_ES5(target=es5).js @@ -19,6 +19,7 @@ var v = { } //// [computedPropertyNames10_ES5.js] +"use strict"; var _a; var s; var n; diff --git a/tests/baselines/reference/computedPropertyNames10_ES6.js b/tests/baselines/reference/computedPropertyNames10_ES6.js index af1090b6b5895..47a42a7b4d6ed 100644 --- a/tests/baselines/reference/computedPropertyNames10_ES6.js +++ b/tests/baselines/reference/computedPropertyNames10_ES6.js @@ -19,6 +19,7 @@ var v = { } //// [computedPropertyNames10_ES6.js] +"use strict"; var s; var n; var a; diff --git a/tests/baselines/reference/computedPropertyNames11_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames11_ES5(target=es2015).js index fb24a97a34b26..82fba237cdbe2 100644 --- a/tests/baselines/reference/computedPropertyNames11_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames11_ES5(target=es2015).js @@ -19,6 +19,7 @@ var v = { } //// [computedPropertyNames11_ES5.js] +"use strict"; var s; var n; var a; diff --git a/tests/baselines/reference/computedPropertyNames11_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames11_ES5(target=es5).js index c856cec1f87fb..67d54e10c131d 100644 --- a/tests/baselines/reference/computedPropertyNames11_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames11_ES5(target=es5).js @@ -19,6 +19,7 @@ var v = { } //// [computedPropertyNames11_ES5.js] +"use strict"; var _a; var s; var n; diff --git a/tests/baselines/reference/computedPropertyNames11_ES6.js b/tests/baselines/reference/computedPropertyNames11_ES6.js index 7535bc8d563ee..d278b6de647c5 100644 --- a/tests/baselines/reference/computedPropertyNames11_ES6.js +++ b/tests/baselines/reference/computedPropertyNames11_ES6.js @@ -19,6 +19,7 @@ var v = { } //// [computedPropertyNames11_ES6.js] +"use strict"; var s; var n; var a; diff --git a/tests/baselines/reference/computedPropertyNames12_ES5(target=es2015).errors.txt b/tests/baselines/reference/computedPropertyNames12_ES5(target=es2015).errors.txt index 7803fd8078d63..3670ce712ebc2 100644 --- a/tests/baselines/reference/computedPropertyNames12_ES5(target=es2015).errors.txt +++ b/tests/baselines/reference/computedPropertyNames12_ES5(target=es2015).errors.txt @@ -1,18 +1,24 @@ +computedPropertyNames12_ES5.ts(5,5): error TS2564: Property '[s]' has no initializer and is not definitely assigned in the constructor. computedPropertyNames12_ES5.ts(7,12): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type. computedPropertyNames12_ES5.ts(8,5): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type. computedPropertyNames12_ES5.ts(9,5): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type. computedPropertyNames12_ES5.ts(9,5): error TS2411: Property '[+s]' of type 'string' is not assignable to 'number' index type 'number'. computedPropertyNames12_ES5.ts(9,5): error TS2411: Property '[+s]' of type 'string' is not assignable to 'string' index type 'number'. +computedPropertyNames12_ES5.ts(9,5): error TS2564: Property '[+s]' has no initializer and is not definitely assigned in the constructor. +computedPropertyNames12_ES5.ts(11,5): error TS2564: Property '[0]' has no initializer and is not definitely assigned in the constructor. +computedPropertyNames12_ES5.ts(12,5): error TS2564: Property '[a]' has no initializer and is not definitely assigned in the constructor. computedPropertyNames12_ES5.ts(13,12): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type. computedPropertyNames12_ES5.ts(15,12): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type. -==== computedPropertyNames12_ES5.ts (7 errors) ==== +==== computedPropertyNames12_ES5.ts (11 errors) ==== var s: string; var n: number; var a: any; class C { [s]: number; + ~~~ +!!! error TS2564: Property '[s]' has no initializer and is not definitely assigned in the constructor. [n] = n; static [s + s]: string; ~~~~~~~ @@ -27,9 +33,15 @@ computedPropertyNames12_ES5.ts(15,12): error TS1166: A computed property name in !!! error TS2411: Property '[+s]' of type 'string' is not assignable to 'number' index type 'number'. ~~~~ !!! error TS2411: Property '[+s]' of type 'string' is not assignable to 'string' index type 'number'. + ~~~~ +!!! error TS2564: Property '[+s]' has no initializer and is not definitely assigned in the constructor. static [""]: number; [0]: number; + ~~~ +!!! error TS2564: Property '[0]' has no initializer and is not definitely assigned in the constructor. [a]: number; + ~~~ +!!! error TS2564: Property '[a]' has no initializer and is not definitely assigned in the constructor. static [true]: number; ~~~~~~~~~~~ !!! error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type. diff --git a/tests/baselines/reference/computedPropertyNames12_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames12_ES5(target=es2015).js index 487f1cc7d7a6a..97332695b8020 100644 --- a/tests/baselines/reference/computedPropertyNames12_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames12_ES5(target=es2015).js @@ -19,6 +19,7 @@ class C { } //// [computedPropertyNames12_ES5.js] +"use strict"; var _a, _b, _c; var s; var n; diff --git a/tests/baselines/reference/computedPropertyNames12_ES5(target=es5).errors.txt b/tests/baselines/reference/computedPropertyNames12_ES5(target=es5).errors.txt index 7c292e4d6519c..ef17b9f2618aa 100644 --- a/tests/baselines/reference/computedPropertyNames12_ES5(target=es5).errors.txt +++ b/tests/baselines/reference/computedPropertyNames12_ES5(target=es5).errors.txt @@ -1,20 +1,26 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +computedPropertyNames12_ES5.ts(5,5): error TS2564: Property '[s]' has no initializer and is not definitely assigned in the constructor. computedPropertyNames12_ES5.ts(7,12): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type. computedPropertyNames12_ES5.ts(8,5): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type. computedPropertyNames12_ES5.ts(9,5): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type. computedPropertyNames12_ES5.ts(9,5): error TS2411: Property '[+s]' of type 'string' is not assignable to 'number' index type 'number'. computedPropertyNames12_ES5.ts(9,5): error TS2411: Property '[+s]' of type 'string' is not assignable to 'string' index type 'number'. +computedPropertyNames12_ES5.ts(9,5): error TS2564: Property '[+s]' has no initializer and is not definitely assigned in the constructor. +computedPropertyNames12_ES5.ts(11,5): error TS2564: Property '[0]' has no initializer and is not definitely assigned in the constructor. +computedPropertyNames12_ES5.ts(12,5): error TS2564: Property '[a]' has no initializer and is not definitely assigned in the constructor. computedPropertyNames12_ES5.ts(13,12): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type. computedPropertyNames12_ES5.ts(15,12): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== computedPropertyNames12_ES5.ts (7 errors) ==== +==== computedPropertyNames12_ES5.ts (11 errors) ==== var s: string; var n: number; var a: any; class C { [s]: number; + ~~~ +!!! error TS2564: Property '[s]' has no initializer and is not definitely assigned in the constructor. [n] = n; static [s + s]: string; ~~~~~~~ @@ -29,9 +35,15 @@ computedPropertyNames12_ES5.ts(15,12): error TS1166: A computed property name in !!! error TS2411: Property '[+s]' of type 'string' is not assignable to 'number' index type 'number'. ~~~~ !!! error TS2411: Property '[+s]' of type 'string' is not assignable to 'string' index type 'number'. + ~~~~ +!!! error TS2564: Property '[+s]' has no initializer and is not definitely assigned in the constructor. static [""]: number; [0]: number; + ~~~ +!!! error TS2564: Property '[0]' has no initializer and is not definitely assigned in the constructor. [a]: number; + ~~~ +!!! error TS2564: Property '[a]' has no initializer and is not definitely assigned in the constructor. static [true]: number; ~~~~~~~~~~~ !!! error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type. diff --git a/tests/baselines/reference/computedPropertyNames12_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames12_ES5(target=es5).js index 0c2ef338b76e3..e2043208f09a2 100644 --- a/tests/baselines/reference/computedPropertyNames12_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames12_ES5(target=es5).js @@ -19,6 +19,7 @@ class C { } //// [computedPropertyNames12_ES5.js] +"use strict"; var s; var n; var a; diff --git a/tests/baselines/reference/computedPropertyNames12_ES6.errors.txt b/tests/baselines/reference/computedPropertyNames12_ES6.errors.txt index 08016db3ddd77..5225a99c3a120 100644 --- a/tests/baselines/reference/computedPropertyNames12_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNames12_ES6.errors.txt @@ -1,18 +1,24 @@ +computedPropertyNames12_ES6.ts(5,5): error TS2564: Property '[s]' has no initializer and is not definitely assigned in the constructor. computedPropertyNames12_ES6.ts(7,12): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type. computedPropertyNames12_ES6.ts(8,5): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type. computedPropertyNames12_ES6.ts(9,5): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type. computedPropertyNames12_ES6.ts(9,5): error TS2411: Property '[+s]' of type 'string' is not assignable to 'number' index type 'number'. computedPropertyNames12_ES6.ts(9,5): error TS2411: Property '[+s]' of type 'string' is not assignable to 'string' index type 'number'. +computedPropertyNames12_ES6.ts(9,5): error TS2564: Property '[+s]' has no initializer and is not definitely assigned in the constructor. +computedPropertyNames12_ES6.ts(11,5): error TS2564: Property '[0]' has no initializer and is not definitely assigned in the constructor. +computedPropertyNames12_ES6.ts(12,5): error TS2564: Property '[a]' has no initializer and is not definitely assigned in the constructor. computedPropertyNames12_ES6.ts(13,12): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type. computedPropertyNames12_ES6.ts(15,12): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type. -==== computedPropertyNames12_ES6.ts (7 errors) ==== +==== computedPropertyNames12_ES6.ts (11 errors) ==== var s: string; var n: number; var a: any; class C { [s]: number; + ~~~ +!!! error TS2564: Property '[s]' has no initializer and is not definitely assigned in the constructor. [n] = n; static [s + s]: string; ~~~~~~~ @@ -27,9 +33,15 @@ computedPropertyNames12_ES6.ts(15,12): error TS1166: A computed property name in !!! error TS2411: Property '[+s]' of type 'string' is not assignable to 'number' index type 'number'. ~~~~ !!! error TS2411: Property '[+s]' of type 'string' is not assignable to 'string' index type 'number'. + ~~~~ +!!! error TS2564: Property '[+s]' has no initializer and is not definitely assigned in the constructor. static [""]: number; [0]: number; + ~~~ +!!! error TS2564: Property '[0]' has no initializer and is not definitely assigned in the constructor. [a]: number; + ~~~ +!!! error TS2564: Property '[a]' has no initializer and is not definitely assigned in the constructor. static [true]: number; ~~~~~~~~~~~ !!! error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type. diff --git a/tests/baselines/reference/computedPropertyNames12_ES6.js b/tests/baselines/reference/computedPropertyNames12_ES6.js index b60a25b174583..e2c2f6aaffa79 100644 --- a/tests/baselines/reference/computedPropertyNames12_ES6.js +++ b/tests/baselines/reference/computedPropertyNames12_ES6.js @@ -19,6 +19,7 @@ class C { } //// [computedPropertyNames12_ES6.js] +"use strict"; var _a, _b, _c; var s; var n; diff --git a/tests/baselines/reference/computedPropertyNames13_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames13_ES5(target=es2015).js index 92f8fdbf6b032..4649855e37173 100644 --- a/tests/baselines/reference/computedPropertyNames13_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames13_ES5(target=es2015).js @@ -19,6 +19,7 @@ class C { } //// [computedPropertyNames13_ES5.js] +"use strict"; var s; var n; var a; diff --git a/tests/baselines/reference/computedPropertyNames13_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames13_ES5(target=es5).js index 6f4394a391ebd..ecf98dde003f5 100644 --- a/tests/baselines/reference/computedPropertyNames13_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames13_ES5(target=es5).js @@ -19,6 +19,7 @@ class C { } //// [computedPropertyNames13_ES5.js] +"use strict"; var s; var n; var a; diff --git a/tests/baselines/reference/computedPropertyNames13_ES6.js b/tests/baselines/reference/computedPropertyNames13_ES6.js index 0fdc03e0f4ef7..506dc7a5db824 100644 --- a/tests/baselines/reference/computedPropertyNames13_ES6.js +++ b/tests/baselines/reference/computedPropertyNames13_ES6.js @@ -19,6 +19,7 @@ class C { } //// [computedPropertyNames13_ES6.js] +"use strict"; var s; var n; var a; diff --git a/tests/baselines/reference/computedPropertyNames14_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames14_ES5(target=es2015).js index 86bdcb25d7efd..720e93f5e22ae 100644 --- a/tests/baselines/reference/computedPropertyNames14_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames14_ES5(target=es2015).js @@ -12,6 +12,7 @@ class C { } //// [computedPropertyNames14_ES5.js] +"use strict"; var b; class C { [b]() { } diff --git a/tests/baselines/reference/computedPropertyNames14_ES5(target=es2015).types b/tests/baselines/reference/computedPropertyNames14_ES5(target=es2015).types index 933177e0c7d96..396dad652debc 100644 --- a/tests/baselines/reference/computedPropertyNames14_ES5(target=es2015).types +++ b/tests/baselines/reference/computedPropertyNames14_ES5(target=es2015).types @@ -24,8 +24,8 @@ class C { [[]]() { } >[[]] : () => void > : ^^^^^^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ static [{}]() { } >[{}] : () => void diff --git a/tests/baselines/reference/computedPropertyNames14_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames14_ES5(target=es5).js index 97a4402baf4cb..1a7f612d747e5 100644 --- a/tests/baselines/reference/computedPropertyNames14_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames14_ES5(target=es5).js @@ -12,6 +12,7 @@ class C { } //// [computedPropertyNames14_ES5.js] +"use strict"; var b; var C = /** @class */ (function () { function C() { diff --git a/tests/baselines/reference/computedPropertyNames14_ES5(target=es5).types b/tests/baselines/reference/computedPropertyNames14_ES5(target=es5).types index 933177e0c7d96..396dad652debc 100644 --- a/tests/baselines/reference/computedPropertyNames14_ES5(target=es5).types +++ b/tests/baselines/reference/computedPropertyNames14_ES5(target=es5).types @@ -24,8 +24,8 @@ class C { [[]]() { } >[[]] : () => void > : ^^^^^^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ static [{}]() { } >[{}] : () => void diff --git a/tests/baselines/reference/computedPropertyNames14_ES6.js b/tests/baselines/reference/computedPropertyNames14_ES6.js index b59a5943b96e7..edf150aef3ddb 100644 --- a/tests/baselines/reference/computedPropertyNames14_ES6.js +++ b/tests/baselines/reference/computedPropertyNames14_ES6.js @@ -12,6 +12,7 @@ class C { } //// [computedPropertyNames14_ES6.js] +"use strict"; var b; class C { [b]() { } diff --git a/tests/baselines/reference/computedPropertyNames14_ES6.types b/tests/baselines/reference/computedPropertyNames14_ES6.types index fa9df05a268b8..c4df90616b946 100644 --- a/tests/baselines/reference/computedPropertyNames14_ES6.types +++ b/tests/baselines/reference/computedPropertyNames14_ES6.types @@ -24,8 +24,8 @@ class C { [[]]() { } >[[]] : () => void > : ^^^^^^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ static [{}]() { } >[{}] : () => void diff --git a/tests/baselines/reference/computedPropertyNames15_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames15_ES5(target=es2015).js index 00977adb1c90e..534cb94d5a6ed 100644 --- a/tests/baselines/reference/computedPropertyNames15_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames15_ES5(target=es2015).js @@ -11,6 +11,7 @@ class C { } //// [computedPropertyNames15_ES5.js] +"use strict"; var p1; var p2; var p3; diff --git a/tests/baselines/reference/computedPropertyNames15_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames15_ES5(target=es5).js index e59f8df25b74e..8b5c68241304b 100644 --- a/tests/baselines/reference/computedPropertyNames15_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames15_ES5(target=es5).js @@ -11,6 +11,7 @@ class C { } //// [computedPropertyNames15_ES5.js] +"use strict"; var p1; var p2; var p3; diff --git a/tests/baselines/reference/computedPropertyNames15_ES6.js b/tests/baselines/reference/computedPropertyNames15_ES6.js index ca6a9b790496b..01201dd43190c 100644 --- a/tests/baselines/reference/computedPropertyNames15_ES6.js +++ b/tests/baselines/reference/computedPropertyNames15_ES6.js @@ -11,6 +11,7 @@ class C { } //// [computedPropertyNames15_ES6.js] +"use strict"; var p1; var p2; var p3; diff --git a/tests/baselines/reference/computedPropertyNames16_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames16_ES5(target=es2015).js index 542d1615cca68..a11a50b4ab97b 100644 --- a/tests/baselines/reference/computedPropertyNames16_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames16_ES5(target=es2015).js @@ -19,6 +19,7 @@ class C { } //// [computedPropertyNames16_ES5.js] +"use strict"; var s; var n; var a; diff --git a/tests/baselines/reference/computedPropertyNames16_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames16_ES5(target=es5).js index acabab442ced2..6ff455596590b 100644 --- a/tests/baselines/reference/computedPropertyNames16_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames16_ES5(target=es5).js @@ -19,6 +19,7 @@ class C { } //// [computedPropertyNames16_ES5.js] +"use strict"; var s; var n; var a; diff --git a/tests/baselines/reference/computedPropertyNames16_ES6.js b/tests/baselines/reference/computedPropertyNames16_ES6.js index 9017a6feb78de..fdf30496d6693 100644 --- a/tests/baselines/reference/computedPropertyNames16_ES6.js +++ b/tests/baselines/reference/computedPropertyNames16_ES6.js @@ -19,6 +19,7 @@ class C { } //// [computedPropertyNames16_ES6.js] +"use strict"; var s; var n; var a; diff --git a/tests/baselines/reference/computedPropertyNames17_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames17_ES5(target=es2015).js index da59f5a575ff2..75e1c4e2a07d0 100644 --- a/tests/baselines/reference/computedPropertyNames17_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames17_ES5(target=es2015).js @@ -12,6 +12,7 @@ class C { } //// [computedPropertyNames17_ES5.js] +"use strict"; var b; class C { get [b]() { return 0; } diff --git a/tests/baselines/reference/computedPropertyNames17_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames17_ES5(target=es5).js index 0d6e549d5bb42..559ad1c39a703 100644 --- a/tests/baselines/reference/computedPropertyNames17_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames17_ES5(target=es5).js @@ -12,6 +12,7 @@ class C { } //// [computedPropertyNames17_ES5.js] +"use strict"; var b; var C = /** @class */ (function () { function C() { diff --git a/tests/baselines/reference/computedPropertyNames17_ES6.js b/tests/baselines/reference/computedPropertyNames17_ES6.js index f3b9d31756c8d..4b0b296282711 100644 --- a/tests/baselines/reference/computedPropertyNames17_ES6.js +++ b/tests/baselines/reference/computedPropertyNames17_ES6.js @@ -12,6 +12,7 @@ class C { } //// [computedPropertyNames17_ES6.js] +"use strict"; var b; class C { get [b]() { return 0; } diff --git a/tests/baselines/reference/computedPropertyNames18_ES5(target=es2015).errors.txt b/tests/baselines/reference/computedPropertyNames18_ES5(target=es2015).errors.txt new file mode 100644 index 0000000000000..47cad1603ee7a --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames18_ES5(target=es2015).errors.txt @@ -0,0 +1,11 @@ +computedPropertyNames18_ES5.ts(3,10): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. + + +==== computedPropertyNames18_ES5.ts (1 errors) ==== + function foo() { + var obj = { + [this.bar]: 0 + ~~~~ +!!! error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames18_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames18_ES5(target=es2015).js index 4f72f1156a427..b29e4366e7276 100644 --- a/tests/baselines/reference/computedPropertyNames18_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames18_ES5(target=es2015).js @@ -8,6 +8,7 @@ function foo() { } //// [computedPropertyNames18_ES5.js] +"use strict"; function foo() { var obj = { [this.bar]: 0 diff --git a/tests/baselines/reference/computedPropertyNames18_ES5(target=es2015).types b/tests/baselines/reference/computedPropertyNames18_ES5(target=es2015).types index fba7ca0fa899c..31b06d5eea6ab 100644 --- a/tests/baselines/reference/computedPropertyNames18_ES5(target=es2015).types +++ b/tests/baselines/reference/computedPropertyNames18_ES5(target=es2015).types @@ -15,6 +15,7 @@ function foo() { >[this.bar] : number > : ^^^^^^ >this.bar : any +> : ^^^ >this : any > : ^^^ >bar : any diff --git a/tests/baselines/reference/computedPropertyNames18_ES5(target=es5).errors.txt b/tests/baselines/reference/computedPropertyNames18_ES5(target=es5).errors.txt index ba02cfe5b5285..f7ac4134965fe 100644 --- a/tests/baselines/reference/computedPropertyNames18_ES5(target=es5).errors.txt +++ b/tests/baselines/reference/computedPropertyNames18_ES5(target=es5).errors.txt @@ -1,10 +1,13 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +computedPropertyNames18_ES5.ts(3,10): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== computedPropertyNames18_ES5.ts (0 errors) ==== +==== computedPropertyNames18_ES5.ts (1 errors) ==== function foo() { var obj = { [this.bar]: 0 + ~~~~ +!!! error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. } } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames18_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames18_ES5(target=es5).js index 2e3907003e23c..b604798444c66 100644 --- a/tests/baselines/reference/computedPropertyNames18_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames18_ES5(target=es5).js @@ -8,6 +8,7 @@ function foo() { } //// [computedPropertyNames18_ES5.js] +"use strict"; function foo() { var _a; var obj = (_a = {}, diff --git a/tests/baselines/reference/computedPropertyNames18_ES6.errors.txt b/tests/baselines/reference/computedPropertyNames18_ES6.errors.txt new file mode 100644 index 0000000000000..d30a3f2ee8445 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames18_ES6.errors.txt @@ -0,0 +1,11 @@ +computedPropertyNames18_ES6.ts(3,10): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. + + +==== computedPropertyNames18_ES6.ts (1 errors) ==== + function foo() { + var obj = { + [this.bar]: 0 + ~~~~ +!!! error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames18_ES6.js b/tests/baselines/reference/computedPropertyNames18_ES6.js index 11248db1ab658..fec1ee2a2b7ae 100644 --- a/tests/baselines/reference/computedPropertyNames18_ES6.js +++ b/tests/baselines/reference/computedPropertyNames18_ES6.js @@ -8,6 +8,7 @@ function foo() { } //// [computedPropertyNames18_ES6.js] +"use strict"; function foo() { var obj = { [this.bar]: 0 diff --git a/tests/baselines/reference/computedPropertyNames18_ES6.types b/tests/baselines/reference/computedPropertyNames18_ES6.types index d7539447e1f0d..22f5870b42620 100644 --- a/tests/baselines/reference/computedPropertyNames18_ES6.types +++ b/tests/baselines/reference/computedPropertyNames18_ES6.types @@ -15,6 +15,7 @@ function foo() { >[this.bar] : number > : ^^^^^^ >this.bar : any +> : ^^^ >this : any > : ^^^ >bar : any diff --git a/tests/baselines/reference/computedPropertyNames19_ES5(target=es2015).errors.txt b/tests/baselines/reference/computedPropertyNames19_ES5(target=es2015).errors.txt index b5b9ae897a980..6628fbb855de0 100644 --- a/tests/baselines/reference/computedPropertyNames19_ES5(target=es2015).errors.txt +++ b/tests/baselines/reference/computedPropertyNames19_ES5(target=es2015).errors.txt @@ -1,11 +1,14 @@ computedPropertyNames19_ES5.ts(3,10): error TS2331: 'this' cannot be referenced in a module or namespace body. +computedPropertyNames19_ES5.ts(3,10): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. -==== computedPropertyNames19_ES5.ts (1 errors) ==== +==== computedPropertyNames19_ES5.ts (2 errors) ==== namespace M { var obj = { [this.bar]: 0 ~~~~ !!! error TS2331: 'this' cannot be referenced in a module or namespace body. + ~~~~ +!!! error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. } } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames19_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames19_ES5(target=es2015).js index c0cb91152bafd..34f7bf4583778 100644 --- a/tests/baselines/reference/computedPropertyNames19_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames19_ES5(target=es2015).js @@ -8,6 +8,7 @@ namespace M { } //// [computedPropertyNames19_ES5.js] +"use strict"; var M; (function (M) { var obj = { diff --git a/tests/baselines/reference/computedPropertyNames19_ES5(target=es5).errors.txt b/tests/baselines/reference/computedPropertyNames19_ES5(target=es5).errors.txt index b0022f3985cbc..5edd4a630563f 100644 --- a/tests/baselines/reference/computedPropertyNames19_ES5(target=es5).errors.txt +++ b/tests/baselines/reference/computedPropertyNames19_ES5(target=es5).errors.txt @@ -1,13 +1,16 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. computedPropertyNames19_ES5.ts(3,10): error TS2331: 'this' cannot be referenced in a module or namespace body. +computedPropertyNames19_ES5.ts(3,10): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== computedPropertyNames19_ES5.ts (1 errors) ==== +==== computedPropertyNames19_ES5.ts (2 errors) ==== namespace M { var obj = { [this.bar]: 0 ~~~~ !!! error TS2331: 'this' cannot be referenced in a module or namespace body. + ~~~~ +!!! error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. } } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames19_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames19_ES5(target=es5).js index f100c749eb00c..a46498206bbbe 100644 --- a/tests/baselines/reference/computedPropertyNames19_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames19_ES5(target=es5).js @@ -8,6 +8,7 @@ namespace M { } //// [computedPropertyNames19_ES5.js] +"use strict"; var M; (function (M) { var _a; diff --git a/tests/baselines/reference/computedPropertyNames19_ES6.errors.txt b/tests/baselines/reference/computedPropertyNames19_ES6.errors.txt index 7155a3c3fb3a8..35c3cbb153289 100644 --- a/tests/baselines/reference/computedPropertyNames19_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNames19_ES6.errors.txt @@ -1,11 +1,14 @@ computedPropertyNames19_ES6.ts(3,10): error TS2331: 'this' cannot be referenced in a module or namespace body. +computedPropertyNames19_ES6.ts(3,10): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. -==== computedPropertyNames19_ES6.ts (1 errors) ==== +==== computedPropertyNames19_ES6.ts (2 errors) ==== namespace M { var obj = { [this.bar]: 0 ~~~~ !!! error TS2331: 'this' cannot be referenced in a module or namespace body. + ~~~~ +!!! error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. } } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames19_ES6.js b/tests/baselines/reference/computedPropertyNames19_ES6.js index d604ea36c3f53..8ebcda740148e 100644 --- a/tests/baselines/reference/computedPropertyNames19_ES6.js +++ b/tests/baselines/reference/computedPropertyNames19_ES6.js @@ -8,6 +8,7 @@ namespace M { } //// [computedPropertyNames19_ES6.js] +"use strict"; var M; (function (M) { var obj = { diff --git a/tests/baselines/reference/computedPropertyNames1_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames1_ES5(target=es2015).js index 6b2f5aa68577e..30692cdd9edba 100644 --- a/tests/baselines/reference/computedPropertyNames1_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames1_ES5(target=es2015).js @@ -7,6 +7,7 @@ var v = { } //// [computedPropertyNames1_ES5.js] +"use strict"; var v = { get [0 + 1]() { return 0; }, set [0 + 1](v) { } //No error diff --git a/tests/baselines/reference/computedPropertyNames1_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames1_ES5(target=es5).js index 33d2ac8ac315b..96d0976c3d903 100644 --- a/tests/baselines/reference/computedPropertyNames1_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames1_ES5(target=es5).js @@ -7,6 +7,7 @@ var v = { } //// [computedPropertyNames1_ES5.js] +"use strict"; var _a; var v = (_a = {}, Object.defineProperty(_a, 0 + 1, { diff --git a/tests/baselines/reference/computedPropertyNames1_ES6.js b/tests/baselines/reference/computedPropertyNames1_ES6.js index d482a3fce71f4..e50d4292e4635 100644 --- a/tests/baselines/reference/computedPropertyNames1_ES6.js +++ b/tests/baselines/reference/computedPropertyNames1_ES6.js @@ -7,6 +7,7 @@ var v = { } //// [computedPropertyNames1_ES6.js] +"use strict"; var v = { get [0 + 1]() { return 0; }, set [0 + 1](v) { } //No error diff --git a/tests/baselines/reference/computedPropertyNames20_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames20_ES5(target=es2015).js index 8f654f3f3a76f..ae098b7e30f9f 100644 --- a/tests/baselines/reference/computedPropertyNames20_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames20_ES5(target=es2015).js @@ -6,6 +6,7 @@ var obj = { } //// [computedPropertyNames20_ES5.js] +"use strict"; var obj = { [this.bar]: 0 }; diff --git a/tests/baselines/reference/computedPropertyNames20_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames20_ES5(target=es5).js index 1b85ac6da761e..d9ba8b5832a59 100644 --- a/tests/baselines/reference/computedPropertyNames20_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames20_ES5(target=es5).js @@ -6,6 +6,7 @@ var obj = { } //// [computedPropertyNames20_ES5.js] +"use strict"; var _a; var obj = (_a = {}, _a[this.bar] = 0, diff --git a/tests/baselines/reference/computedPropertyNames20_ES6.js b/tests/baselines/reference/computedPropertyNames20_ES6.js index aa6387c17536f..c5bf75210a465 100644 --- a/tests/baselines/reference/computedPropertyNames20_ES6.js +++ b/tests/baselines/reference/computedPropertyNames20_ES6.js @@ -6,6 +6,7 @@ var obj = { } //// [computedPropertyNames20_ES6.js] +"use strict"; var obj = { [this.bar]: 0 }; diff --git a/tests/baselines/reference/computedPropertyNames21_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames21_ES5(target=es2015).js index 2233c127c3122..ff19b449abb24 100644 --- a/tests/baselines/reference/computedPropertyNames21_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames21_ES5(target=es2015).js @@ -9,6 +9,7 @@ class C { } //// [computedPropertyNames21_ES5.js] +"use strict"; class C { bar() { return 0; diff --git a/tests/baselines/reference/computedPropertyNames21_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames21_ES5(target=es5).js index 6f2c99bbfe4db..a0261b4c7696c 100644 --- a/tests/baselines/reference/computedPropertyNames21_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames21_ES5(target=es5).js @@ -9,6 +9,7 @@ class C { } //// [computedPropertyNames21_ES5.js] +"use strict"; var C = /** @class */ (function () { function C() { } diff --git a/tests/baselines/reference/computedPropertyNames21_ES6.js b/tests/baselines/reference/computedPropertyNames21_ES6.js index 351b0b3a649f2..5014117d8cb0a 100644 --- a/tests/baselines/reference/computedPropertyNames21_ES6.js +++ b/tests/baselines/reference/computedPropertyNames21_ES6.js @@ -9,6 +9,7 @@ class C { } //// [computedPropertyNames21_ES6.js] +"use strict"; class C { bar() { return 0; diff --git a/tests/baselines/reference/computedPropertyNames22_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames22_ES5(target=es2015).js index 57379b6af5b8d..b44fe419a2fb8 100644 --- a/tests/baselines/reference/computedPropertyNames22_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames22_ES5(target=es2015).js @@ -11,6 +11,7 @@ class C { } //// [computedPropertyNames22_ES5.js] +"use strict"; class C { bar() { var obj = { diff --git a/tests/baselines/reference/computedPropertyNames22_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames22_ES5(target=es5).js index 9e204ca9b9ea5..507f68b12f4c3 100644 --- a/tests/baselines/reference/computedPropertyNames22_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames22_ES5(target=es5).js @@ -11,6 +11,7 @@ class C { } //// [computedPropertyNames22_ES5.js] +"use strict"; var C = /** @class */ (function () { function C() { } diff --git a/tests/baselines/reference/computedPropertyNames22_ES6.js b/tests/baselines/reference/computedPropertyNames22_ES6.js index 39f6eb34fa67f..b6cb25853957a 100644 --- a/tests/baselines/reference/computedPropertyNames22_ES6.js +++ b/tests/baselines/reference/computedPropertyNames22_ES6.js @@ -11,6 +11,7 @@ class C { } //// [computedPropertyNames22_ES6.js] +"use strict"; class C { bar() { var obj = { diff --git a/tests/baselines/reference/computedPropertyNames23_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames23_ES5(target=es2015).js index 7fca2f7f32cf7..b2d4f87968d22 100644 --- a/tests/baselines/reference/computedPropertyNames23_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames23_ES5(target=es2015).js @@ -11,6 +11,7 @@ class C { } //// [computedPropertyNames23_ES5.js] +"use strict"; class C { bar() { return 0; diff --git a/tests/baselines/reference/computedPropertyNames23_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames23_ES5(target=es5).js index ea0d5c255d3a6..908063985e81c 100644 --- a/tests/baselines/reference/computedPropertyNames23_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames23_ES5(target=es5).js @@ -11,6 +11,7 @@ class C { } //// [computedPropertyNames23_ES5.js] +"use strict"; var C = /** @class */ (function () { var _a; function C() { diff --git a/tests/baselines/reference/computedPropertyNames23_ES6.js b/tests/baselines/reference/computedPropertyNames23_ES6.js index 102e74c002440..6ed14dee6a4dd 100644 --- a/tests/baselines/reference/computedPropertyNames23_ES6.js +++ b/tests/baselines/reference/computedPropertyNames23_ES6.js @@ -11,6 +11,7 @@ class C { } //// [computedPropertyNames23_ES6.js] +"use strict"; class C { bar() { return 0; diff --git a/tests/baselines/reference/computedPropertyNames24_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames24_ES5(target=es2015).js index 4e6e21f5e878c..b81b492791e47 100644 --- a/tests/baselines/reference/computedPropertyNames24_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames24_ES5(target=es2015).js @@ -11,6 +11,7 @@ class C extends Base { } //// [computedPropertyNames24_ES5.js] +"use strict"; class Base { bar() { return 0; diff --git a/tests/baselines/reference/computedPropertyNames24_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames24_ES5(target=es5).js index 9149fb2b7f7da..d06c20b9b7658 100644 --- a/tests/baselines/reference/computedPropertyNames24_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames24_ES5(target=es5).js @@ -11,6 +11,7 @@ class C extends Base { } //// [computedPropertyNames24_ES5.js] +"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || diff --git a/tests/baselines/reference/computedPropertyNames24_ES6.js b/tests/baselines/reference/computedPropertyNames24_ES6.js index 67649001d7e7a..759680d9a4a81 100644 --- a/tests/baselines/reference/computedPropertyNames24_ES6.js +++ b/tests/baselines/reference/computedPropertyNames24_ES6.js @@ -13,6 +13,7 @@ class C extends Base { } //// [computedPropertyNames24_ES6.js] +"use strict"; class Base { bar() { return 0; diff --git a/tests/baselines/reference/computedPropertyNames25_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames25_ES5(target=es2015).js index f88a8d16d5ef1..8774e396a6d51 100644 --- a/tests/baselines/reference/computedPropertyNames25_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames25_ES5(target=es2015).js @@ -16,6 +16,7 @@ class C extends Base { } //// [computedPropertyNames25_ES5.js] +"use strict"; class Base { bar() { return 0; diff --git a/tests/baselines/reference/computedPropertyNames25_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames25_ES5(target=es5).js index b1fcee5d2093c..454a0d0a7cd56 100644 --- a/tests/baselines/reference/computedPropertyNames25_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames25_ES5(target=es5).js @@ -16,6 +16,7 @@ class C extends Base { } //// [computedPropertyNames25_ES5.js] +"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || diff --git a/tests/baselines/reference/computedPropertyNames25_ES6.js b/tests/baselines/reference/computedPropertyNames25_ES6.js index 192c1151b677f..24ac126c671f0 100644 --- a/tests/baselines/reference/computedPropertyNames25_ES6.js +++ b/tests/baselines/reference/computedPropertyNames25_ES6.js @@ -16,6 +16,7 @@ class C extends Base { } //// [computedPropertyNames25_ES6.js] +"use strict"; class Base { bar() { return 0; diff --git a/tests/baselines/reference/computedPropertyNames26_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames26_ES5(target=es2015).js index 86dc0fcc4e11f..ed29730ab3140 100644 --- a/tests/baselines/reference/computedPropertyNames26_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames26_ES5(target=es2015).js @@ -13,6 +13,7 @@ class C extends Base { } //// [computedPropertyNames26_ES5.js] +"use strict"; class Base { bar() { return 0; diff --git a/tests/baselines/reference/computedPropertyNames26_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames26_ES5(target=es5).js index d11d3e62daf04..9416c8f0dc976 100644 --- a/tests/baselines/reference/computedPropertyNames26_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames26_ES5(target=es5).js @@ -13,6 +13,7 @@ class C extends Base { } //// [computedPropertyNames26_ES5.js] +"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || diff --git a/tests/baselines/reference/computedPropertyNames26_ES6.js b/tests/baselines/reference/computedPropertyNames26_ES6.js index df2b9c63f883a..e4f2ff3fcd74d 100644 --- a/tests/baselines/reference/computedPropertyNames26_ES6.js +++ b/tests/baselines/reference/computedPropertyNames26_ES6.js @@ -15,6 +15,7 @@ class C extends Base { } //// [computedPropertyNames26_ES6.js] +"use strict"; class Base { bar() { return 0; diff --git a/tests/baselines/reference/computedPropertyNames27_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames27_ES5(target=es2015).js index c821f62c459c4..0a9851ec9a297 100644 --- a/tests/baselines/reference/computedPropertyNames27_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames27_ES5(target=es2015).js @@ -8,6 +8,7 @@ class C extends Base { } //// [computedPropertyNames27_ES5.js] +"use strict"; class Base { } class C extends Base { diff --git a/tests/baselines/reference/computedPropertyNames27_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames27_ES5(target=es5).js index b211de70f6f4f..537b6a79b0862 100644 --- a/tests/baselines/reference/computedPropertyNames27_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames27_ES5(target=es5).js @@ -8,6 +8,7 @@ class C extends Base { } //// [computedPropertyNames27_ES5.js] +"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || diff --git a/tests/baselines/reference/computedPropertyNames27_ES6.js b/tests/baselines/reference/computedPropertyNames27_ES6.js index 8063ea9abc6c0..c045c493f0285 100644 --- a/tests/baselines/reference/computedPropertyNames27_ES6.js +++ b/tests/baselines/reference/computedPropertyNames27_ES6.js @@ -8,6 +8,7 @@ class C extends Base { } //// [computedPropertyNames27_ES6.js] +"use strict"; class Base { } class C extends Base { diff --git a/tests/baselines/reference/computedPropertyNames28_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames28_ES5(target=es2015).js index 8d25479ae5e06..7480c2fcc2c98 100644 --- a/tests/baselines/reference/computedPropertyNames28_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames28_ES5(target=es2015).js @@ -13,6 +13,7 @@ class C extends Base { } //// [computedPropertyNames28_ES5.js] +"use strict"; class Base { } class C extends Base { diff --git a/tests/baselines/reference/computedPropertyNames28_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames28_ES5(target=es5).js index 2268c134780b6..edc141e9e04db 100644 --- a/tests/baselines/reference/computedPropertyNames28_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames28_ES5(target=es5).js @@ -13,6 +13,7 @@ class C extends Base { } //// [computedPropertyNames28_ES5.js] +"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || diff --git a/tests/baselines/reference/computedPropertyNames28_ES6.js b/tests/baselines/reference/computedPropertyNames28_ES6.js index 6f3dbf9d915ae..41d980ae9ec35 100644 --- a/tests/baselines/reference/computedPropertyNames28_ES6.js +++ b/tests/baselines/reference/computedPropertyNames28_ES6.js @@ -13,6 +13,7 @@ class C extends Base { } //// [computedPropertyNames28_ES6.js] +"use strict"; class Base { } class C extends Base { diff --git a/tests/baselines/reference/computedPropertyNames29_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames29_ES5(target=es2015).js index 1e7bdff5a6faa..25a89454ee62c 100644 --- a/tests/baselines/reference/computedPropertyNames29_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames29_ES5(target=es2015).js @@ -13,6 +13,7 @@ class C { } //// [computedPropertyNames29_ES5.js] +"use strict"; class C { bar() { () => { diff --git a/tests/baselines/reference/computedPropertyNames29_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames29_ES5(target=es5).js index ba27977b67018..4a6462481ed88 100644 --- a/tests/baselines/reference/computedPropertyNames29_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames29_ES5(target=es5).js @@ -13,6 +13,7 @@ class C { } //// [computedPropertyNames29_ES5.js] +"use strict"; var C = /** @class */ (function () { function C() { } diff --git a/tests/baselines/reference/computedPropertyNames29_ES6.js b/tests/baselines/reference/computedPropertyNames29_ES6.js index 210ab45c06bd7..b6f748f79ca45 100644 --- a/tests/baselines/reference/computedPropertyNames29_ES6.js +++ b/tests/baselines/reference/computedPropertyNames29_ES6.js @@ -13,6 +13,7 @@ class C { } //// [computedPropertyNames29_ES6.js] +"use strict"; class C { bar() { () => { diff --git a/tests/baselines/reference/computedPropertyNames2_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames2_ES5(target=es2015).js index 2af28cda81d3c..5e1a5849f3ebe 100644 --- a/tests/baselines/reference/computedPropertyNames2_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames2_ES5(target=es2015).js @@ -13,6 +13,7 @@ class C { } //// [computedPropertyNames2_ES5.js] +"use strict"; var methodName = "method"; var accessorName = "accessor"; class C { diff --git a/tests/baselines/reference/computedPropertyNames2_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames2_ES5(target=es5).js index 45419aa3fc4bc..620c302972c79 100644 --- a/tests/baselines/reference/computedPropertyNames2_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames2_ES5(target=es5).js @@ -13,6 +13,7 @@ class C { } //// [computedPropertyNames2_ES5.js] +"use strict"; var methodName = "method"; var accessorName = "accessor"; var C = /** @class */ (function () { diff --git a/tests/baselines/reference/computedPropertyNames2_ES6.js b/tests/baselines/reference/computedPropertyNames2_ES6.js index 8a1cf475b636f..0574efabca9a5 100644 --- a/tests/baselines/reference/computedPropertyNames2_ES6.js +++ b/tests/baselines/reference/computedPropertyNames2_ES6.js @@ -13,6 +13,7 @@ class C { } //// [computedPropertyNames2_ES6.js] +"use strict"; var methodName = "method"; var accessorName = "accessor"; class C { diff --git a/tests/baselines/reference/computedPropertyNames30_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames30_ES5(target=es2015).js index d3b0ba152a841..73887acfa6175 100644 --- a/tests/baselines/reference/computedPropertyNames30_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames30_ES5(target=es2015).js @@ -18,6 +18,7 @@ class C extends Base { } //// [computedPropertyNames30_ES5.js] +"use strict"; class Base { } class C extends Base { diff --git a/tests/baselines/reference/computedPropertyNames30_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames30_ES5(target=es5).js index 77ee8645565cd..98f31227f22ab 100644 --- a/tests/baselines/reference/computedPropertyNames30_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames30_ES5(target=es5).js @@ -18,6 +18,7 @@ class C extends Base { } //// [computedPropertyNames30_ES5.js] +"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || diff --git a/tests/baselines/reference/computedPropertyNames30_ES6.js b/tests/baselines/reference/computedPropertyNames30_ES6.js index 4fed08e614eb9..9253a4194b745 100644 --- a/tests/baselines/reference/computedPropertyNames30_ES6.js +++ b/tests/baselines/reference/computedPropertyNames30_ES6.js @@ -18,6 +18,7 @@ class C extends Base { } //// [computedPropertyNames30_ES6.js] +"use strict"; class Base { } class C extends Base { diff --git a/tests/baselines/reference/computedPropertyNames31_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames31_ES5(target=es2015).js index 4d35049eec9c6..1fb02300da753 100644 --- a/tests/baselines/reference/computedPropertyNames31_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames31_ES5(target=es2015).js @@ -18,6 +18,7 @@ class C extends Base { } //// [computedPropertyNames31_ES5.js] +"use strict"; class Base { bar() { return 0; diff --git a/tests/baselines/reference/computedPropertyNames31_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames31_ES5(target=es5).js index 4fe7dbdf7ac7f..044782f7932de 100644 --- a/tests/baselines/reference/computedPropertyNames31_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames31_ES5(target=es5).js @@ -18,6 +18,7 @@ class C extends Base { } //// [computedPropertyNames31_ES5.js] +"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || diff --git a/tests/baselines/reference/computedPropertyNames31_ES6.js b/tests/baselines/reference/computedPropertyNames31_ES6.js index 56e257d5960cc..7db1e6c75f212 100644 --- a/tests/baselines/reference/computedPropertyNames31_ES6.js +++ b/tests/baselines/reference/computedPropertyNames31_ES6.js @@ -18,6 +18,7 @@ class C extends Base { } //// [computedPropertyNames31_ES6.js] +"use strict"; class Base { bar() { return 0; diff --git a/tests/baselines/reference/computedPropertyNames32_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames32_ES5(target=es2015).js index b28ee1a326945..f0b70a16192b2 100644 --- a/tests/baselines/reference/computedPropertyNames32_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames32_ES5(target=es2015).js @@ -10,6 +10,7 @@ class C { } //// [computedPropertyNames32_ES5.js] +"use strict"; function foo() { return ''; } class C { bar() { diff --git a/tests/baselines/reference/computedPropertyNames32_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames32_ES5(target=es5).js index 247415e020928..3846c512c5a14 100644 --- a/tests/baselines/reference/computedPropertyNames32_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames32_ES5(target=es5).js @@ -10,6 +10,7 @@ class C { } //// [computedPropertyNames32_ES5.js] +"use strict"; function foo() { return ''; } var C = /** @class */ (function () { function C() { diff --git a/tests/baselines/reference/computedPropertyNames32_ES6.js b/tests/baselines/reference/computedPropertyNames32_ES6.js index ad99ed359e137..eabd2e3e8a99f 100644 --- a/tests/baselines/reference/computedPropertyNames32_ES6.js +++ b/tests/baselines/reference/computedPropertyNames32_ES6.js @@ -10,6 +10,7 @@ class C { } //// [computedPropertyNames32_ES6.js] +"use strict"; function foo() { return ''; } class C { bar() { diff --git a/tests/baselines/reference/computedPropertyNames33_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames33_ES5(target=es2015).js index 742d79c6542fe..a4257d17ba6af 100644 --- a/tests/baselines/reference/computedPropertyNames33_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames33_ES5(target=es2015).js @@ -12,6 +12,7 @@ class C { } //// [computedPropertyNames33_ES5.js] +"use strict"; function foo() { return ''; } class C { bar() { diff --git a/tests/baselines/reference/computedPropertyNames33_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames33_ES5(target=es5).js index a46f02a460274..184a184e391e4 100644 --- a/tests/baselines/reference/computedPropertyNames33_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames33_ES5(target=es5).js @@ -12,6 +12,7 @@ class C { } //// [computedPropertyNames33_ES5.js] +"use strict"; function foo() { return ''; } var C = /** @class */ (function () { function C() { diff --git a/tests/baselines/reference/computedPropertyNames33_ES6.js b/tests/baselines/reference/computedPropertyNames33_ES6.js index c0439d4b75503..3857799ca1f47 100644 --- a/tests/baselines/reference/computedPropertyNames33_ES6.js +++ b/tests/baselines/reference/computedPropertyNames33_ES6.js @@ -12,6 +12,7 @@ class C { } //// [computedPropertyNames33_ES6.js] +"use strict"; function foo() { return ''; } class C { bar() { diff --git a/tests/baselines/reference/computedPropertyNames34_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames34_ES5(target=es2015).js index 7c3669b6cf83f..0353a13299e90 100644 --- a/tests/baselines/reference/computedPropertyNames34_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames34_ES5(target=es2015).js @@ -12,6 +12,7 @@ class C { } //// [computedPropertyNames34_ES5.js] +"use strict"; function foo() { return ''; } class C { static bar() { diff --git a/tests/baselines/reference/computedPropertyNames34_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames34_ES5(target=es5).js index 50c8ad1832c17..5b28afab91544 100644 --- a/tests/baselines/reference/computedPropertyNames34_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames34_ES5(target=es5).js @@ -12,6 +12,7 @@ class C { } //// [computedPropertyNames34_ES5.js] +"use strict"; function foo() { return ''; } var C = /** @class */ (function () { function C() { diff --git a/tests/baselines/reference/computedPropertyNames34_ES6.js b/tests/baselines/reference/computedPropertyNames34_ES6.js index 5866089dfe216..3634638f6fb8a 100644 --- a/tests/baselines/reference/computedPropertyNames34_ES6.js +++ b/tests/baselines/reference/computedPropertyNames34_ES6.js @@ -12,6 +12,7 @@ class C { } //// [computedPropertyNames34_ES6.js] +"use strict"; function foo() { return ''; } class C { static bar() { diff --git a/tests/baselines/reference/computedPropertyNames35_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames35_ES5(target=es2015).js index d5b1fad93b457..968b3c961b883 100644 --- a/tests/baselines/reference/computedPropertyNames35_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames35_ES5(target=es2015).js @@ -8,4 +8,5 @@ interface I { } //// [computedPropertyNames35_ES5.js] +"use strict"; function foo() { return ''; } diff --git a/tests/baselines/reference/computedPropertyNames35_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames35_ES5(target=es5).js index d5b1fad93b457..968b3c961b883 100644 --- a/tests/baselines/reference/computedPropertyNames35_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames35_ES5(target=es5).js @@ -8,4 +8,5 @@ interface I { } //// [computedPropertyNames35_ES5.js] +"use strict"; function foo() { return ''; } diff --git a/tests/baselines/reference/computedPropertyNames35_ES6.js b/tests/baselines/reference/computedPropertyNames35_ES6.js index d84dc086c70c5..d67d5516b5958 100644 --- a/tests/baselines/reference/computedPropertyNames35_ES6.js +++ b/tests/baselines/reference/computedPropertyNames35_ES6.js @@ -8,4 +8,5 @@ interface I { } //// [computedPropertyNames35_ES6.js] +"use strict"; function foo() { return ''; } diff --git a/tests/baselines/reference/computedPropertyNames36_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames36_ES5(target=es2015).js index 6cdb46e204fcc..e43c108277596 100644 --- a/tests/baselines/reference/computedPropertyNames36_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames36_ES5(target=es2015).js @@ -13,6 +13,7 @@ class C { } //// [computedPropertyNames36_ES5.js] +"use strict"; class Foo { } class Foo2 { diff --git a/tests/baselines/reference/computedPropertyNames36_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames36_ES5(target=es5).js index 0b511af7605ba..d4f6c71567366 100644 --- a/tests/baselines/reference/computedPropertyNames36_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames36_ES5(target=es5).js @@ -13,6 +13,7 @@ class C { } //// [computedPropertyNames36_ES5.js] +"use strict"; var Foo = /** @class */ (function () { function Foo() { } diff --git a/tests/baselines/reference/computedPropertyNames36_ES6.js b/tests/baselines/reference/computedPropertyNames36_ES6.js index 03a026c0c1b9f..82657054d6775 100644 --- a/tests/baselines/reference/computedPropertyNames36_ES6.js +++ b/tests/baselines/reference/computedPropertyNames36_ES6.js @@ -13,6 +13,7 @@ class C { } //// [computedPropertyNames36_ES6.js] +"use strict"; class Foo { } class Foo2 { diff --git a/tests/baselines/reference/computedPropertyNames37_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames37_ES5(target=es2015).js index 5a1635fe3207b..d774f40f0f7bf 100644 --- a/tests/baselines/reference/computedPropertyNames37_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames37_ES5(target=es2015).js @@ -13,6 +13,7 @@ class C { } //// [computedPropertyNames37_ES5.js] +"use strict"; class Foo { } class Foo2 { diff --git a/tests/baselines/reference/computedPropertyNames37_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames37_ES5(target=es5).js index 13b1d0ade0515..f9f88f3922bb1 100644 --- a/tests/baselines/reference/computedPropertyNames37_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames37_ES5(target=es5).js @@ -13,6 +13,7 @@ class C { } //// [computedPropertyNames37_ES5.js] +"use strict"; var Foo = /** @class */ (function () { function Foo() { } diff --git a/tests/baselines/reference/computedPropertyNames37_ES6.js b/tests/baselines/reference/computedPropertyNames37_ES6.js index 6e1f6242d205d..e5ae4e15f4ffa 100644 --- a/tests/baselines/reference/computedPropertyNames37_ES6.js +++ b/tests/baselines/reference/computedPropertyNames37_ES6.js @@ -13,6 +13,7 @@ class C { } //// [computedPropertyNames37_ES6.js] +"use strict"; class Foo { } class Foo2 { diff --git a/tests/baselines/reference/computedPropertyNames38_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames38_ES5(target=es2015).js index 05613dc4cd61e..80378c4b441b4 100644 --- a/tests/baselines/reference/computedPropertyNames38_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames38_ES5(target=es2015).js @@ -13,6 +13,7 @@ class C { } //// [computedPropertyNames38_ES5.js] +"use strict"; class Foo { } class Foo2 { diff --git a/tests/baselines/reference/computedPropertyNames38_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames38_ES5(target=es5).js index 8daec73bff09b..d78e829f7b593 100644 --- a/tests/baselines/reference/computedPropertyNames38_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames38_ES5(target=es5).js @@ -13,6 +13,7 @@ class C { } //// [computedPropertyNames38_ES5.js] +"use strict"; var Foo = /** @class */ (function () { function Foo() { } diff --git a/tests/baselines/reference/computedPropertyNames38_ES6.js b/tests/baselines/reference/computedPropertyNames38_ES6.js index 805c81bc24f22..3315299dbe191 100644 --- a/tests/baselines/reference/computedPropertyNames38_ES6.js +++ b/tests/baselines/reference/computedPropertyNames38_ES6.js @@ -13,6 +13,7 @@ class C { } //// [computedPropertyNames38_ES6.js] +"use strict"; class Foo { } class Foo2 { diff --git a/tests/baselines/reference/computedPropertyNames39_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames39_ES5(target=es2015).js index b203e11def7b5..e10b53e12aeef 100644 --- a/tests/baselines/reference/computedPropertyNames39_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames39_ES5(target=es2015).js @@ -13,6 +13,7 @@ class C { } //// [computedPropertyNames39_ES5.js] +"use strict"; class Foo { } class Foo2 { diff --git a/tests/baselines/reference/computedPropertyNames39_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames39_ES5(target=es5).js index f90979b888f9e..d13d1afc0663f 100644 --- a/tests/baselines/reference/computedPropertyNames39_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames39_ES5(target=es5).js @@ -13,6 +13,7 @@ class C { } //// [computedPropertyNames39_ES5.js] +"use strict"; var Foo = /** @class */ (function () { function Foo() { } diff --git a/tests/baselines/reference/computedPropertyNames39_ES6.js b/tests/baselines/reference/computedPropertyNames39_ES6.js index e8a7b8cd7d293..55d88b7597c1c 100644 --- a/tests/baselines/reference/computedPropertyNames39_ES6.js +++ b/tests/baselines/reference/computedPropertyNames39_ES6.js @@ -13,6 +13,7 @@ class C { } //// [computedPropertyNames39_ES6.js] +"use strict"; class Foo { } class Foo2 { diff --git a/tests/baselines/reference/computedPropertyNames3_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames3_ES5(target=es2015).js index 9ce0d476a48be..3a80e83dde7d5 100644 --- a/tests/baselines/reference/computedPropertyNames3_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames3_ES5(target=es2015).js @@ -12,6 +12,7 @@ class C { } //// [computedPropertyNames3_ES5.js] +"use strict"; var id; class C { [0 + 1]() { } diff --git a/tests/baselines/reference/computedPropertyNames3_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames3_ES5(target=es5).js index 704185c43934f..f57e5bd3fe8b1 100644 --- a/tests/baselines/reference/computedPropertyNames3_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames3_ES5(target=es5).js @@ -12,6 +12,7 @@ class C { } //// [computedPropertyNames3_ES5.js] +"use strict"; var id; var C = /** @class */ (function () { function C() { diff --git a/tests/baselines/reference/computedPropertyNames3_ES6.js b/tests/baselines/reference/computedPropertyNames3_ES6.js index 47f74c659daf4..d1db482b80b13 100644 --- a/tests/baselines/reference/computedPropertyNames3_ES6.js +++ b/tests/baselines/reference/computedPropertyNames3_ES6.js @@ -12,6 +12,7 @@ class C { } //// [computedPropertyNames3_ES6.js] +"use strict"; var id; class C { [0 + 1]() { } diff --git a/tests/baselines/reference/computedPropertyNames40_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames40_ES5(target=es2015).js index 665b22af28ff3..ae8dc4b5f884c 100644 --- a/tests/baselines/reference/computedPropertyNames40_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames40_ES5(target=es2015).js @@ -13,6 +13,7 @@ class C { } //// [computedPropertyNames40_ES5.js] +"use strict"; class Foo { } class Foo2 { diff --git a/tests/baselines/reference/computedPropertyNames40_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames40_ES5(target=es5).js index f0195986a8ec1..6cca0b5e8a502 100644 --- a/tests/baselines/reference/computedPropertyNames40_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames40_ES5(target=es5).js @@ -13,6 +13,7 @@ class C { } //// [computedPropertyNames40_ES5.js] +"use strict"; var Foo = /** @class */ (function () { function Foo() { } diff --git a/tests/baselines/reference/computedPropertyNames40_ES6.js b/tests/baselines/reference/computedPropertyNames40_ES6.js index 1d5ed8cfd221e..21ad19a1953a7 100644 --- a/tests/baselines/reference/computedPropertyNames40_ES6.js +++ b/tests/baselines/reference/computedPropertyNames40_ES6.js @@ -13,6 +13,7 @@ class C { } //// [computedPropertyNames40_ES6.js] +"use strict"; class Foo { } class Foo2 { diff --git a/tests/baselines/reference/computedPropertyNames41_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames41_ES5(target=es2015).js index d88d39f21d1ef..7e1990c4f7876 100644 --- a/tests/baselines/reference/computedPropertyNames41_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames41_ES5(target=es2015).js @@ -12,6 +12,7 @@ class C { } //// [computedPropertyNames41_ES5.js] +"use strict"; class Foo { } class Foo2 { diff --git a/tests/baselines/reference/computedPropertyNames41_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames41_ES5(target=es5).js index 176c71ea25da3..9b81465e3aed9 100644 --- a/tests/baselines/reference/computedPropertyNames41_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames41_ES5(target=es5).js @@ -12,6 +12,7 @@ class C { } //// [computedPropertyNames41_ES5.js] +"use strict"; var Foo = /** @class */ (function () { function Foo() { } diff --git a/tests/baselines/reference/computedPropertyNames41_ES6.js b/tests/baselines/reference/computedPropertyNames41_ES6.js index f8ebfaf75d4c6..441e9522349de 100644 --- a/tests/baselines/reference/computedPropertyNames41_ES6.js +++ b/tests/baselines/reference/computedPropertyNames41_ES6.js @@ -12,6 +12,7 @@ class C { } //// [computedPropertyNames41_ES6.js] +"use strict"; class Foo { } class Foo2 { diff --git a/tests/baselines/reference/computedPropertyNames42_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames42_ES5(target=es2015).js index 0a6fc7fdb9849..c28b9414b35d7 100644 --- a/tests/baselines/reference/computedPropertyNames42_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames42_ES5(target=es2015).js @@ -12,6 +12,7 @@ class C { } //// [computedPropertyNames42_ES5.js] +"use strict"; class Foo { } class Foo2 { diff --git a/tests/baselines/reference/computedPropertyNames42_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames42_ES5(target=es5).js index 52210d8559c4d..0a5bea745bc34 100644 --- a/tests/baselines/reference/computedPropertyNames42_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames42_ES5(target=es5).js @@ -12,6 +12,7 @@ class C { } //// [computedPropertyNames42_ES5.js] +"use strict"; var Foo = /** @class */ (function () { function Foo() { } diff --git a/tests/baselines/reference/computedPropertyNames42_ES6.js b/tests/baselines/reference/computedPropertyNames42_ES6.js index 16617edbf3790..e8234920f35bb 100644 --- a/tests/baselines/reference/computedPropertyNames42_ES6.js +++ b/tests/baselines/reference/computedPropertyNames42_ES6.js @@ -12,6 +12,7 @@ class C { } //// [computedPropertyNames42_ES6.js] +"use strict"; class Foo { } class Foo2 { diff --git a/tests/baselines/reference/computedPropertyNames43_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames43_ES5(target=es2015).js index c362d71605aed..a1c1dcb450771 100644 --- a/tests/baselines/reference/computedPropertyNames43_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames43_ES5(target=es2015).js @@ -15,6 +15,7 @@ class D extends C { } //// [computedPropertyNames43_ES5.js] +"use strict"; class Foo { } class Foo2 { diff --git a/tests/baselines/reference/computedPropertyNames43_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames43_ES5(target=es5).js index 5a5ff015ebb0e..1264fa10bcfac 100644 --- a/tests/baselines/reference/computedPropertyNames43_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames43_ES5(target=es5).js @@ -15,6 +15,7 @@ class D extends C { } //// [computedPropertyNames43_ES5.js] +"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || diff --git a/tests/baselines/reference/computedPropertyNames43_ES6.js b/tests/baselines/reference/computedPropertyNames43_ES6.js index ba36972d1babb..6ee01281b746d 100644 --- a/tests/baselines/reference/computedPropertyNames43_ES6.js +++ b/tests/baselines/reference/computedPropertyNames43_ES6.js @@ -15,6 +15,7 @@ class D extends C { } //// [computedPropertyNames43_ES6.js] +"use strict"; class Foo { } class Foo2 { diff --git a/tests/baselines/reference/computedPropertyNames44_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames44_ES5(target=es2015).js index 4810f3cb29970..26bb7e519ccdb 100644 --- a/tests/baselines/reference/computedPropertyNames44_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames44_ES5(target=es2015).js @@ -14,6 +14,7 @@ class D extends C { } //// [computedPropertyNames44_ES5.js] +"use strict"; class Foo { } class Foo2 { diff --git a/tests/baselines/reference/computedPropertyNames44_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames44_ES5(target=es5).js index a0db5485d62b7..7dd045b667dd1 100644 --- a/tests/baselines/reference/computedPropertyNames44_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames44_ES5(target=es5).js @@ -14,6 +14,7 @@ class D extends C { } //// [computedPropertyNames44_ES5.js] +"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || diff --git a/tests/baselines/reference/computedPropertyNames44_ES6.js b/tests/baselines/reference/computedPropertyNames44_ES6.js index 3cc2451317c19..dce10a58bafbf 100644 --- a/tests/baselines/reference/computedPropertyNames44_ES6.js +++ b/tests/baselines/reference/computedPropertyNames44_ES6.js @@ -14,6 +14,7 @@ class D extends C { } //// [computedPropertyNames44_ES6.js] +"use strict"; class Foo { } class Foo2 { diff --git a/tests/baselines/reference/computedPropertyNames45_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames45_ES5(target=es2015).js index 72c19390ec333..60e45f39d1612 100644 --- a/tests/baselines/reference/computedPropertyNames45_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames45_ES5(target=es2015).js @@ -15,6 +15,7 @@ class D extends C { } //// [computedPropertyNames45_ES5.js] +"use strict"; class Foo { } class Foo2 { diff --git a/tests/baselines/reference/computedPropertyNames45_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames45_ES5(target=es5).js index 19b8fdacbcdfd..c2e55ca6931bb 100644 --- a/tests/baselines/reference/computedPropertyNames45_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames45_ES5(target=es5).js @@ -15,6 +15,7 @@ class D extends C { } //// [computedPropertyNames45_ES5.js] +"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || diff --git a/tests/baselines/reference/computedPropertyNames45_ES6.js b/tests/baselines/reference/computedPropertyNames45_ES6.js index 23849240b51f5..df49aa6b0aee3 100644 --- a/tests/baselines/reference/computedPropertyNames45_ES6.js +++ b/tests/baselines/reference/computedPropertyNames45_ES6.js @@ -15,6 +15,7 @@ class D extends C { } //// [computedPropertyNames45_ES6.js] +"use strict"; class Foo { } class Foo2 { diff --git a/tests/baselines/reference/computedPropertyNames46_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames46_ES5(target=es2015).js index e50583ef71fb1..90551eca9ff0c 100644 --- a/tests/baselines/reference/computedPropertyNames46_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames46_ES5(target=es2015).js @@ -6,6 +6,7 @@ var o = { }; //// [computedPropertyNames46_ES5.js] +"use strict"; var o = { ["" || 0]: 0 }; diff --git a/tests/baselines/reference/computedPropertyNames46_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames46_ES5(target=es5).js index 6c74630e658a2..85e98d865a1dc 100644 --- a/tests/baselines/reference/computedPropertyNames46_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames46_ES5(target=es5).js @@ -6,6 +6,7 @@ var o = { }; //// [computedPropertyNames46_ES5.js] +"use strict"; var _a; var o = (_a = {}, _a["" || 0] = 0, diff --git a/tests/baselines/reference/computedPropertyNames46_ES6.js b/tests/baselines/reference/computedPropertyNames46_ES6.js index 88cf4efd32aa2..f331bf6df4220 100644 --- a/tests/baselines/reference/computedPropertyNames46_ES6.js +++ b/tests/baselines/reference/computedPropertyNames46_ES6.js @@ -6,6 +6,7 @@ var o = { }; //// [computedPropertyNames46_ES6.js] +"use strict"; var o = { ["" || 0]: 0 }; diff --git a/tests/baselines/reference/computedPropertyNames47_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames47_ES5(target=es2015).js index 40a4adc05dae6..895a0179c18fe 100644 --- a/tests/baselines/reference/computedPropertyNames47_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames47_ES5(target=es2015).js @@ -8,6 +8,7 @@ var o = { }; //// [computedPropertyNames47_ES5.js] +"use strict"; var E1; (function (E1) { E1[E1["x"] = 0] = "x"; diff --git a/tests/baselines/reference/computedPropertyNames47_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames47_ES5(target=es5).js index 67d76a25d4b79..faa7e7a97b3b2 100644 --- a/tests/baselines/reference/computedPropertyNames47_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames47_ES5(target=es5).js @@ -8,6 +8,7 @@ var o = { }; //// [computedPropertyNames47_ES5.js] +"use strict"; var _a; var E1; (function (E1) { diff --git a/tests/baselines/reference/computedPropertyNames47_ES6.js b/tests/baselines/reference/computedPropertyNames47_ES6.js index 2f511279917ea..2275ff3dd2c3a 100644 --- a/tests/baselines/reference/computedPropertyNames47_ES6.js +++ b/tests/baselines/reference/computedPropertyNames47_ES6.js @@ -8,6 +8,7 @@ var o = { }; //// [computedPropertyNames47_ES6.js] +"use strict"; var E1; (function (E1) { E1[E1["x"] = 0] = "x"; diff --git a/tests/baselines/reference/computedPropertyNames48_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames48_ES5(target=es2015).js index 62409b5c9f47c..f6aacf9c4511e 100644 --- a/tests/baselines/reference/computedPropertyNames48_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames48_ES5(target=es2015).js @@ -20,6 +20,7 @@ extractIndexer({ }); // Should return any (widened form of undefined) //// [computedPropertyNames48_ES5.js] +"use strict"; var E; (function (E) { E[E["x"] = 0] = "x"; diff --git a/tests/baselines/reference/computedPropertyNames48_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames48_ES5(target=es5).js index 8d8fbe74dfbe3..dacf8a43b338e 100644 --- a/tests/baselines/reference/computedPropertyNames48_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames48_ES5(target=es5).js @@ -20,6 +20,7 @@ extractIndexer({ }); // Should return any (widened form of undefined) //// [computedPropertyNames48_ES5.js] +"use strict"; var _a, _b, _c; var E; (function (E) { diff --git a/tests/baselines/reference/computedPropertyNames48_ES6.js b/tests/baselines/reference/computedPropertyNames48_ES6.js index e167d19506ce0..af3934a77bfad 100644 --- a/tests/baselines/reference/computedPropertyNames48_ES6.js +++ b/tests/baselines/reference/computedPropertyNames48_ES6.js @@ -20,6 +20,7 @@ extractIndexer({ }); // Should return any (widened form of undefined) //// [computedPropertyNames48_ES6.js] +"use strict"; var E; (function (E) { E[E["x"] = 0] = "x"; diff --git a/tests/baselines/reference/computedPropertyNames49_ES5.js b/tests/baselines/reference/computedPropertyNames49_ES5.js index cf8abfebafcc6..323740da4abe1 100644 --- a/tests/baselines/reference/computedPropertyNames49_ES5.js +++ b/tests/baselines/reference/computedPropertyNames49_ES5.js @@ -27,6 +27,7 @@ var x = { } //// [computedPropertyNames49_ES5.js] +"use strict"; var x = { p1: 10, get [1 + 1]() { diff --git a/tests/baselines/reference/computedPropertyNames49_ES6.js b/tests/baselines/reference/computedPropertyNames49_ES6.js index 3dec94ce1d9aa..b9a838526e48e 100644 --- a/tests/baselines/reference/computedPropertyNames49_ES6.js +++ b/tests/baselines/reference/computedPropertyNames49_ES6.js @@ -27,6 +27,7 @@ var x = { } //// [computedPropertyNames49_ES6.js] +"use strict"; var x = { p1: 10, get [1 + 1]() { diff --git a/tests/baselines/reference/computedPropertyNames4_ES5(target=es2015).errors.txt b/tests/baselines/reference/computedPropertyNames4_ES5(target=es2015).errors.txt new file mode 100644 index 0000000000000..ce9ee936006f7 --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames4_ES5(target=es2015).errors.txt @@ -0,0 +1,46 @@ +computedPropertyNames4_ES5.ts(5,6): error TS2454: Variable 's' is used before being assigned. +computedPropertyNames4_ES5.ts(6,6): error TS2454: Variable 'n' is used before being assigned. +computedPropertyNames4_ES5.ts(6,10): error TS2454: Variable 'n' is used before being assigned. +computedPropertyNames4_ES5.ts(7,6): error TS2454: Variable 's' is used before being assigned. +computedPropertyNames4_ES5.ts(7,10): error TS2454: Variable 's' is used before being assigned. +computedPropertyNames4_ES5.ts(8,6): error TS2454: Variable 's' is used before being assigned. +computedPropertyNames4_ES5.ts(8,10): error TS2454: Variable 'n' is used before being assigned. +computedPropertyNames4_ES5.ts(9,7): error TS2454: Variable 's' is used before being assigned. +computedPropertyNames4_ES5.ts(9,11): error TS2454: Variable 's' is used before being assigned. + + +==== computedPropertyNames4_ES5.ts (9 errors) ==== + var s: string; + var n: number; + var a: any; + var v = { + [s]: 0, + ~ +!!! error TS2454: Variable 's' is used before being assigned. + [n]: n, + ~ +!!! error TS2454: Variable 'n' is used before being assigned. + ~ +!!! error TS2454: Variable 'n' is used before being assigned. + [s + s]: 1, + ~ +!!! error TS2454: Variable 's' is used before being assigned. + ~ +!!! error TS2454: Variable 's' is used before being assigned. + [s + n]: 2, + ~ +!!! error TS2454: Variable 's' is used before being assigned. + ~ +!!! error TS2454: Variable 'n' is used before being assigned. + [+s]: s, + ~ +!!! error TS2454: Variable 's' is used before being assigned. + ~ +!!! error TS2454: Variable 's' is used before being assigned. + [""]: 0, + [0]: 0, + [a]: 1, + [true]: 0, + [`hello bye`]: 0, + [`hello ${a} bye`]: 0 + } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames4_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames4_ES5(target=es2015).js index 416d7cbc62e79..768aac5de893b 100644 --- a/tests/baselines/reference/computedPropertyNames4_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames4_ES5(target=es2015).js @@ -19,6 +19,7 @@ var v = { } //// [computedPropertyNames4_ES5.js] +"use strict"; var s; var n; var a; diff --git a/tests/baselines/reference/computedPropertyNames4_ES5(target=es2015).types b/tests/baselines/reference/computedPropertyNames4_ES5(target=es2015).types index 809126b9fcb45..2728dfb0c33b2 100644 --- a/tests/baselines/reference/computedPropertyNames4_ES5(target=es2015).types +++ b/tests/baselines/reference/computedPropertyNames4_ES5(target=es2015).types @@ -11,6 +11,7 @@ var n: number; var a: any; >a : any +> : ^^^ var v = { >v : { [x: string]: string | number; [x: number]: string | number; "": number; 0: number; "hello bye": number; } @@ -88,6 +89,7 @@ var v = { >[a] : number > : ^^^^^^ >a : any +> : ^^^ >1 : 1 > : ^ @@ -95,6 +97,7 @@ var v = { >[true] : number > : ^^^^^^ >true : any +> : ^^^ >true : true > : ^^^^ >0 : 0 @@ -114,6 +117,7 @@ var v = { >`hello ${a} bye` : string > : ^^^^^^ >a : any +> : ^^^ >0 : 0 > : ^ } diff --git a/tests/baselines/reference/computedPropertyNames4_ES5(target=es5).errors.txt b/tests/baselines/reference/computedPropertyNames4_ES5(target=es5).errors.txt index 9d3fed09ce3ac..2b3185a783bb3 100644 --- a/tests/baselines/reference/computedPropertyNames4_ES5(target=es5).errors.txt +++ b/tests/baselines/reference/computedPropertyNames4_ES5(target=es5).errors.txt @@ -1,17 +1,44 @@ error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +computedPropertyNames4_ES5.ts(5,6): error TS2454: Variable 's' is used before being assigned. +computedPropertyNames4_ES5.ts(6,6): error TS2454: Variable 'n' is used before being assigned. +computedPropertyNames4_ES5.ts(6,10): error TS2454: Variable 'n' is used before being assigned. +computedPropertyNames4_ES5.ts(7,6): error TS2454: Variable 's' is used before being assigned. +computedPropertyNames4_ES5.ts(7,10): error TS2454: Variable 's' is used before being assigned. +computedPropertyNames4_ES5.ts(8,6): error TS2454: Variable 's' is used before being assigned. +computedPropertyNames4_ES5.ts(8,10): error TS2454: Variable 'n' is used before being assigned. +computedPropertyNames4_ES5.ts(9,7): error TS2454: Variable 's' is used before being assigned. +computedPropertyNames4_ES5.ts(9,11): error TS2454: Variable 's' is used before being assigned. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. -==== computedPropertyNames4_ES5.ts (0 errors) ==== +==== computedPropertyNames4_ES5.ts (9 errors) ==== var s: string; var n: number; var a: any; var v = { [s]: 0, + ~ +!!! error TS2454: Variable 's' is used before being assigned. [n]: n, + ~ +!!! error TS2454: Variable 'n' is used before being assigned. + ~ +!!! error TS2454: Variable 'n' is used before being assigned. [s + s]: 1, + ~ +!!! error TS2454: Variable 's' is used before being assigned. + ~ +!!! error TS2454: Variable 's' is used before being assigned. [s + n]: 2, + ~ +!!! error TS2454: Variable 's' is used before being assigned. + ~ +!!! error TS2454: Variable 'n' is used before being assigned. [+s]: s, + ~ +!!! error TS2454: Variable 's' is used before being assigned. + ~ +!!! error TS2454: Variable 's' is used before being assigned. [""]: 0, [0]: 0, [a]: 1, diff --git a/tests/baselines/reference/computedPropertyNames4_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames4_ES5(target=es5).js index e1bcc7035c87f..f31062d422178 100644 --- a/tests/baselines/reference/computedPropertyNames4_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames4_ES5(target=es5).js @@ -19,6 +19,7 @@ var v = { } //// [computedPropertyNames4_ES5.js] +"use strict"; var _a; var s; var n; diff --git a/tests/baselines/reference/computedPropertyNames4_ES6.errors.txt b/tests/baselines/reference/computedPropertyNames4_ES6.errors.txt new file mode 100644 index 0000000000000..9bdf4eacfa35d --- /dev/null +++ b/tests/baselines/reference/computedPropertyNames4_ES6.errors.txt @@ -0,0 +1,46 @@ +computedPropertyNames4_ES6.ts(5,6): error TS2454: Variable 's' is used before being assigned. +computedPropertyNames4_ES6.ts(6,6): error TS2454: Variable 'n' is used before being assigned. +computedPropertyNames4_ES6.ts(6,10): error TS2454: Variable 'n' is used before being assigned. +computedPropertyNames4_ES6.ts(7,6): error TS2454: Variable 's' is used before being assigned. +computedPropertyNames4_ES6.ts(7,10): error TS2454: Variable 's' is used before being assigned. +computedPropertyNames4_ES6.ts(8,6): error TS2454: Variable 's' is used before being assigned. +computedPropertyNames4_ES6.ts(8,10): error TS2454: Variable 'n' is used before being assigned. +computedPropertyNames4_ES6.ts(9,7): error TS2454: Variable 's' is used before being assigned. +computedPropertyNames4_ES6.ts(9,11): error TS2454: Variable 's' is used before being assigned. + + +==== computedPropertyNames4_ES6.ts (9 errors) ==== + var s: string; + var n: number; + var a: any; + var v = { + [s]: 0, + ~ +!!! error TS2454: Variable 's' is used before being assigned. + [n]: n, + ~ +!!! error TS2454: Variable 'n' is used before being assigned. + ~ +!!! error TS2454: Variable 'n' is used before being assigned. + [s + s]: 1, + ~ +!!! error TS2454: Variable 's' is used before being assigned. + ~ +!!! error TS2454: Variable 's' is used before being assigned. + [s + n]: 2, + ~ +!!! error TS2454: Variable 's' is used before being assigned. + ~ +!!! error TS2454: Variable 'n' is used before being assigned. + [+s]: s, + ~ +!!! error TS2454: Variable 's' is used before being assigned. + ~ +!!! error TS2454: Variable 's' is used before being assigned. + [""]: 0, + [0]: 0, + [a]: 1, + [true]: 0, + [`hello bye`]: 0, + [`hello ${a} bye`]: 0 + } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNames4_ES6.js b/tests/baselines/reference/computedPropertyNames4_ES6.js index 65645e2591aa2..1b7131424c840 100644 --- a/tests/baselines/reference/computedPropertyNames4_ES6.js +++ b/tests/baselines/reference/computedPropertyNames4_ES6.js @@ -19,6 +19,7 @@ var v = { } //// [computedPropertyNames4_ES6.js] +"use strict"; var s; var n; var a; diff --git a/tests/baselines/reference/computedPropertyNames4_ES6.types b/tests/baselines/reference/computedPropertyNames4_ES6.types index 41ff603041538..c1734ed5ad255 100644 --- a/tests/baselines/reference/computedPropertyNames4_ES6.types +++ b/tests/baselines/reference/computedPropertyNames4_ES6.types @@ -11,6 +11,7 @@ var n: number; var a: any; >a : any +> : ^^^ var v = { >v : { [x: string]: string | number; [x: number]: string | number; "": number; 0: number; "hello bye": number; } @@ -88,6 +89,7 @@ var v = { >[a] : number > : ^^^^^^ >a : any +> : ^^^ >1 : 1 > : ^ @@ -95,6 +97,7 @@ var v = { >[true] : number > : ^^^^^^ >true : any +> : ^^^ >true : true > : ^^^^ >0 : 0 @@ -114,6 +117,7 @@ var v = { >`hello ${a} bye` : string > : ^^^^^^ >a : any +> : ^^^ >0 : 0 > : ^ } diff --git a/tests/baselines/reference/computedPropertyNames50_ES5.js b/tests/baselines/reference/computedPropertyNames50_ES5.js index 58d296a4f7680..167e55cac0ede 100644 --- a/tests/baselines/reference/computedPropertyNames50_ES5.js +++ b/tests/baselines/reference/computedPropertyNames50_ES5.js @@ -27,6 +27,7 @@ var x = { } //// [computedPropertyNames50_ES5.js] +"use strict"; var x = { p1: 10, get foo() { diff --git a/tests/baselines/reference/computedPropertyNames50_ES6.js b/tests/baselines/reference/computedPropertyNames50_ES6.js index 64d7c8d8e9c94..eb3e781f55dd9 100644 --- a/tests/baselines/reference/computedPropertyNames50_ES6.js +++ b/tests/baselines/reference/computedPropertyNames50_ES6.js @@ -27,6 +27,7 @@ var x = { } //// [computedPropertyNames50_ES6.js] +"use strict"; var x = { p1: 10, get foo() { diff --git a/tests/baselines/reference/computedPropertyNames51_ES5.js b/tests/baselines/reference/computedPropertyNames51_ES5.js index e0ce30e5d9f5e..073549b64a721 100644 --- a/tests/baselines/reference/computedPropertyNames51_ES5.js +++ b/tests/baselines/reference/computedPropertyNames51_ES5.js @@ -12,6 +12,7 @@ function f() { //// [computedPropertyNames51_ES5.js] +"use strict"; function f() { var t; var k; diff --git a/tests/baselines/reference/computedPropertyNames51_ES6.js b/tests/baselines/reference/computedPropertyNames51_ES6.js index c01180775aadb..66ac077dbc548 100644 --- a/tests/baselines/reference/computedPropertyNames51_ES6.js +++ b/tests/baselines/reference/computedPropertyNames51_ES6.js @@ -12,6 +12,7 @@ function f() { //// [computedPropertyNames51_ES6.js] +"use strict"; function f() { var t; var k; diff --git a/tests/baselines/reference/computedPropertyNames52(target=es2015).js b/tests/baselines/reference/computedPropertyNames52(target=es2015).js index e3ec395c756dc..c888a9d14f2fa 100644 --- a/tests/baselines/reference/computedPropertyNames52(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames52(target=es2015).js @@ -11,6 +11,7 @@ for (let i = 0; i < 10; ++i) { //// [computedPropertyNames52-emit.js] +"use strict"; var _a; const array = []; for (let i = 0; i < 10; ++i) { diff --git a/tests/baselines/reference/computedPropertyNames52(target=es2015).types b/tests/baselines/reference/computedPropertyNames52(target=es2015).types index df52d0e4b1c76..6748b7276d81d 100644 --- a/tests/baselines/reference/computedPropertyNames52(target=es2015).types +++ b/tests/baselines/reference/computedPropertyNames52(target=es2015).types @@ -4,8 +4,8 @@ const array = []; >array : any[] > : ^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ for (let i = 0; i < 10; ++i) { >i : number diff --git a/tests/baselines/reference/computedPropertyNames52(target=es5).js b/tests/baselines/reference/computedPropertyNames52(target=es5).js index 83d8cea45f921..65d190303e82f 100644 --- a/tests/baselines/reference/computedPropertyNames52(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames52(target=es5).js @@ -11,6 +11,7 @@ for (let i = 0; i < 10; ++i) { //// [computedPropertyNames52-emit.js] +"use strict"; var _a; var array = []; var _loop_1 = function (i) { diff --git a/tests/baselines/reference/computedPropertyNames52(target=es5).types b/tests/baselines/reference/computedPropertyNames52(target=es5).types index df52d0e4b1c76..6748b7276d81d 100644 --- a/tests/baselines/reference/computedPropertyNames52(target=es5).types +++ b/tests/baselines/reference/computedPropertyNames52(target=es5).types @@ -4,8 +4,8 @@ const array = []; >array : any[] > : ^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ for (let i = 0; i < 10; ++i) { >i : number diff --git a/tests/baselines/reference/computedPropertyNames5_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames5_ES5(target=es2015).js index 14931b10c5c00..de281f53be23c 100644 --- a/tests/baselines/reference/computedPropertyNames5_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames5_ES5(target=es2015).js @@ -12,6 +12,7 @@ var v = { } //// [computedPropertyNames5_ES5.js] +"use strict"; var v = { [b]: 0, [true]: 1, diff --git a/tests/baselines/reference/computedPropertyNames5_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames5_ES5(target=es5).js index c39dc301a05eb..e0896fa4eb2e0 100644 --- a/tests/baselines/reference/computedPropertyNames5_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames5_ES5(target=es5).js @@ -12,6 +12,7 @@ var v = { } //// [computedPropertyNames5_ES5.js] +"use strict"; var _a; var v = (_a = {}, _a[b] = 0, diff --git a/tests/baselines/reference/computedPropertyNames5_ES6.js b/tests/baselines/reference/computedPropertyNames5_ES6.js index 97b0076dc43cd..a803274745b22 100644 --- a/tests/baselines/reference/computedPropertyNames5_ES6.js +++ b/tests/baselines/reference/computedPropertyNames5_ES6.js @@ -12,6 +12,7 @@ var v = { } //// [computedPropertyNames5_ES6.js] +"use strict"; var v = { [b]: 0, [true]: 1, diff --git a/tests/baselines/reference/computedPropertyNames6_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames6_ES5(target=es2015).js index b51de15ce753f..53ae1e3b01493 100644 --- a/tests/baselines/reference/computedPropertyNames6_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames6_ES5(target=es2015).js @@ -11,6 +11,7 @@ var v = { } //// [computedPropertyNames6_ES5.js] +"use strict"; var v = { [p1]: 0, [p2]: 1, diff --git a/tests/baselines/reference/computedPropertyNames6_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames6_ES5(target=es5).js index 63193cbe7fe00..d0713d49c2e54 100644 --- a/tests/baselines/reference/computedPropertyNames6_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames6_ES5(target=es5).js @@ -11,6 +11,7 @@ var v = { } //// [computedPropertyNames6_ES5.js] +"use strict"; var _a; var v = (_a = {}, _a[p1] = 0, diff --git a/tests/baselines/reference/computedPropertyNames6_ES6.js b/tests/baselines/reference/computedPropertyNames6_ES6.js index 74c13b0c5eeaa..5307db5e14e9f 100644 --- a/tests/baselines/reference/computedPropertyNames6_ES6.js +++ b/tests/baselines/reference/computedPropertyNames6_ES6.js @@ -11,6 +11,7 @@ var v = { } //// [computedPropertyNames6_ES6.js] +"use strict"; var v = { [p1]: 0, [p2]: 1, diff --git a/tests/baselines/reference/computedPropertyNames7_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames7_ES5(target=es2015).js index 00030eb741613..c6dfd52fed080 100644 --- a/tests/baselines/reference/computedPropertyNames7_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames7_ES5(target=es2015).js @@ -9,6 +9,7 @@ var v = { } //// [computedPropertyNames7_ES5.js] +"use strict"; var E; (function (E) { E[E["member"] = 0] = "member"; diff --git a/tests/baselines/reference/computedPropertyNames7_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames7_ES5(target=es5).js index 26edf7b93ab0c..d36f7ddc99967 100644 --- a/tests/baselines/reference/computedPropertyNames7_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames7_ES5(target=es5).js @@ -9,6 +9,7 @@ var v = { } //// [computedPropertyNames7_ES5.js] +"use strict"; var _a; var E; (function (E) { diff --git a/tests/baselines/reference/computedPropertyNames7_ES6.js b/tests/baselines/reference/computedPropertyNames7_ES6.js index daa6bc2995c2f..f3e1cb65b3cac 100644 --- a/tests/baselines/reference/computedPropertyNames7_ES6.js +++ b/tests/baselines/reference/computedPropertyNames7_ES6.js @@ -9,6 +9,7 @@ var v = { } //// [computedPropertyNames7_ES6.js] +"use strict"; var E; (function (E) { E[E["member"] = 0] = "member"; diff --git a/tests/baselines/reference/computedPropertyNames8_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames8_ES5(target=es2015).js index ba93ad46048f7..45aa76c28ccf8 100644 --- a/tests/baselines/reference/computedPropertyNames8_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames8_ES5(target=es2015).js @@ -11,6 +11,7 @@ function f() { } //// [computedPropertyNames8_ES5.js] +"use strict"; function f() { var t; var u; diff --git a/tests/baselines/reference/computedPropertyNames8_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames8_ES5(target=es5).js index cb9359fba6d28..ef3dffc1266b9 100644 --- a/tests/baselines/reference/computedPropertyNames8_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames8_ES5(target=es5).js @@ -11,6 +11,7 @@ function f() { } //// [computedPropertyNames8_ES5.js] +"use strict"; function f() { var _a; var t; diff --git a/tests/baselines/reference/computedPropertyNames8_ES6.js b/tests/baselines/reference/computedPropertyNames8_ES6.js index 02c894eedf2e7..b50c57d4e13b4 100644 --- a/tests/baselines/reference/computedPropertyNames8_ES6.js +++ b/tests/baselines/reference/computedPropertyNames8_ES6.js @@ -11,6 +11,7 @@ function f() { } //// [computedPropertyNames8_ES6.js] +"use strict"; function f() { var t; var u; diff --git a/tests/baselines/reference/computedPropertyNames9_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNames9_ES5(target=es2015).js index 7a5ec5dd1ba49..68fd40cd0031c 100644 --- a/tests/baselines/reference/computedPropertyNames9_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNames9_ES5(target=es2015).js @@ -13,6 +13,7 @@ var v = { } //// [computedPropertyNames9_ES5.js] +"use strict"; function f(x) { } var v = { [f("")]: 0, diff --git a/tests/baselines/reference/computedPropertyNames9_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNames9_ES5(target=es5).js index 5cbd14985e98a..66e5aa0c216fa 100644 --- a/tests/baselines/reference/computedPropertyNames9_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNames9_ES5(target=es5).js @@ -13,6 +13,7 @@ var v = { } //// [computedPropertyNames9_ES5.js] +"use strict"; var _a; function f(x) { } var v = (_a = {}, diff --git a/tests/baselines/reference/computedPropertyNames9_ES6.js b/tests/baselines/reference/computedPropertyNames9_ES6.js index 4220f3f90c280..9b032db4cd706 100644 --- a/tests/baselines/reference/computedPropertyNames9_ES6.js +++ b/tests/baselines/reference/computedPropertyNames9_ES6.js @@ -13,6 +13,7 @@ var v = { } //// [computedPropertyNames9_ES6.js] +"use strict"; function f(x) { } var v = { [f("")]: 0, diff --git a/tests/baselines/reference/computedPropertyNamesContextualType10_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNamesContextualType10_ES5(target=es2015).js index 9dc288d00a589..5ca8a497c48c3 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType10_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNamesContextualType10_ES5(target=es2015).js @@ -11,6 +11,7 @@ var o: I = { } //// [computedPropertyNamesContextualType10_ES5.js] +"use strict"; var o = { [+"foo"]: "", [+"bar"]: 0 diff --git a/tests/baselines/reference/computedPropertyNamesContextualType10_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNamesContextualType10_ES5(target=es5).js index 57ca3e3f0309a..37843d45d3908 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType10_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNamesContextualType10_ES5(target=es5).js @@ -11,6 +11,7 @@ var o: I = { } //// [computedPropertyNamesContextualType10_ES5.js] +"use strict"; var _a; var o = (_a = {}, _a[+"foo"] = "", diff --git a/tests/baselines/reference/computedPropertyNamesContextualType10_ES6.js b/tests/baselines/reference/computedPropertyNamesContextualType10_ES6.js index b44c01bd5b1c3..65fe7ceb7abdf 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType10_ES6.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType10_ES6.js @@ -11,6 +11,7 @@ var o: I = { } //// [computedPropertyNamesContextualType10_ES6.js] +"use strict"; var o = { [+"foo"]: "", [+"bar"]: 0 diff --git a/tests/baselines/reference/computedPropertyNamesContextualType1_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNamesContextualType1_ES5(target=es2015).js index 7bee1d8b0c882..17b2f3e8c7d5e 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType1_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNamesContextualType1_ES5(target=es2015).js @@ -12,6 +12,7 @@ var o: I = { } //// [computedPropertyNamesContextualType1_ES5.js] +"use strict"; var o = { ["" + 0](y) { return y.length; }, ["" + 1]: y => y.length diff --git a/tests/baselines/reference/computedPropertyNamesContextualType1_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNamesContextualType1_ES5(target=es5).js index f36011e95d525..b0545ad2ce8c5 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType1_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNamesContextualType1_ES5(target=es5).js @@ -12,6 +12,7 @@ var o: I = { } //// [computedPropertyNamesContextualType1_ES5.js] +"use strict"; var _a; var o = (_a = {}, _a["" + 0] = function (y) { return y.length; }, diff --git a/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.js b/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.js index ba85d58212f4a..4d28b5fc8a5d6 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.js @@ -12,6 +12,7 @@ var o: I = { } //// [computedPropertyNamesContextualType1_ES6.js] +"use strict"; var o = { ["" + 0](y) { return y.length; }, ["" + 1]: y => y.length diff --git a/tests/baselines/reference/computedPropertyNamesContextualType2_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNamesContextualType2_ES5(target=es2015).js index 1b3267ddc7bf4..1b1edf0738368 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType2_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNamesContextualType2_ES5(target=es2015).js @@ -12,6 +12,7 @@ var o: I = { } //// [computedPropertyNamesContextualType2_ES5.js] +"use strict"; var o = { [+"foo"](y) { return y.length; }, [+"bar"]: y => y.length diff --git a/tests/baselines/reference/computedPropertyNamesContextualType2_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNamesContextualType2_ES5(target=es5).js index 1eacc22117627..e5909e967c1b3 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType2_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNamesContextualType2_ES5(target=es5).js @@ -12,6 +12,7 @@ var o: I = { } //// [computedPropertyNamesContextualType2_ES5.js] +"use strict"; var _a; var o = (_a = {}, _a[+"foo"] = function (y) { return y.length; }, diff --git a/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.js b/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.js index 4745f73bbd0e3..065893e8453a3 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.js @@ -12,6 +12,7 @@ var o: I = { } //// [computedPropertyNamesContextualType2_ES6.js] +"use strict"; var o = { [+"foo"](y) { return y.length; }, [+"bar"]: y => y.length diff --git a/tests/baselines/reference/computedPropertyNamesContextualType3_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNamesContextualType3_ES5(target=es2015).js index f305c86190a2e..0b2b81a156c69 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType3_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNamesContextualType3_ES5(target=es2015).js @@ -11,6 +11,7 @@ var o: I = { } //// [computedPropertyNamesContextualType3_ES5.js] +"use strict"; var o = { [+"foo"](y) { return y.length; }, [+"bar"]: y => y.length diff --git a/tests/baselines/reference/computedPropertyNamesContextualType3_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNamesContextualType3_ES5(target=es5).js index 26670006a4305..7985838d7eecf 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType3_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNamesContextualType3_ES5(target=es5).js @@ -11,6 +11,7 @@ var o: I = { } //// [computedPropertyNamesContextualType3_ES5.js] +"use strict"; var _a; var o = (_a = {}, _a[+"foo"] = function (y) { return y.length; }, diff --git a/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.js b/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.js index 483d40fbde0c0..b2786905a49fe 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.js @@ -11,6 +11,7 @@ var o: I = { } //// [computedPropertyNamesContextualType3_ES6.js] +"use strict"; var o = { [+"foo"](y) { return y.length; }, [+"bar"]: y => y.length diff --git a/tests/baselines/reference/computedPropertyNamesContextualType4_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNamesContextualType4_ES5(target=es2015).js index c5abc8391bded..3162b9189786c 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType4_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNamesContextualType4_ES5(target=es2015).js @@ -12,6 +12,7 @@ var o: I = { } //// [computedPropertyNamesContextualType4_ES5.js] +"use strict"; var o = { ["" + "foo"]: "", ["" + "bar"]: 0 diff --git a/tests/baselines/reference/computedPropertyNamesContextualType4_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNamesContextualType4_ES5(target=es5).js index 0fe3a89bb91d5..426550758bfd2 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType4_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNamesContextualType4_ES5(target=es5).js @@ -12,6 +12,7 @@ var o: I = { } //// [computedPropertyNamesContextualType4_ES5.js] +"use strict"; var _a; var o = (_a = {}, _a["" + "foo"] = "", diff --git a/tests/baselines/reference/computedPropertyNamesContextualType4_ES6.js b/tests/baselines/reference/computedPropertyNamesContextualType4_ES6.js index 2ca6e16fe3717..ac9d2a1449ec0 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType4_ES6.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType4_ES6.js @@ -12,6 +12,7 @@ var o: I = { } //// [computedPropertyNamesContextualType4_ES6.js] +"use strict"; var o = { ["" + "foo"]: "", ["" + "bar"]: 0 diff --git a/tests/baselines/reference/computedPropertyNamesContextualType5_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNamesContextualType5_ES5(target=es2015).js index 5e2eab52a494b..48720b3254117 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType5_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNamesContextualType5_ES5(target=es2015).js @@ -12,6 +12,7 @@ var o: I = { } //// [computedPropertyNamesContextualType5_ES5.js] +"use strict"; var o = { [+"foo"]: "", [+"bar"]: 0 diff --git a/tests/baselines/reference/computedPropertyNamesContextualType5_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNamesContextualType5_ES5(target=es5).js index 416024d8eee74..852b1ff8874af 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType5_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNamesContextualType5_ES5(target=es5).js @@ -12,6 +12,7 @@ var o: I = { } //// [computedPropertyNamesContextualType5_ES5.js] +"use strict"; var _a; var o = (_a = {}, _a[+"foo"] = "", diff --git a/tests/baselines/reference/computedPropertyNamesContextualType5_ES6.js b/tests/baselines/reference/computedPropertyNamesContextualType5_ES6.js index 618dcbf5310b1..53729160d6ac8 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType5_ES6.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType5_ES6.js @@ -12,6 +12,7 @@ var o: I = { } //// [computedPropertyNamesContextualType5_ES6.js] +"use strict"; var o = { [+"foo"]: "", [+"bar"]: 0 diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5(target=es2015).js index a1c682b00cda4..befc0f035679e 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5(target=es2015).js @@ -16,6 +16,7 @@ foo({ }); //// [computedPropertyNamesContextualType6_ES5.js] +"use strict"; foo({ p: "", 0: () => { }, diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5(target=es5).js index ae2419fb82db9..07e76ebe20d75 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5(target=es5).js @@ -16,6 +16,7 @@ foo({ }); //// [computedPropertyNamesContextualType6_ES5.js] +"use strict"; var _a; foo((_a = { p: "", diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.js b/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.js index 23a355dff332d..2b298a472bed2 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.js @@ -16,6 +16,7 @@ foo({ }); //// [computedPropertyNamesContextualType6_ES6.js] +"use strict"; foo({ p: "", 0: () => { }, diff --git a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5(target=es2015).js index f52ce37881e60..f17053be62b0c 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5(target=es2015).js @@ -22,6 +22,7 @@ g({ p: "" }); //// [computedPropertyNamesContextualType7_ES5.js] +"use strict"; foo({ 0: () => { }, ["hi" + "bye"]: true, diff --git a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5(target=es5).js index ebcdfed3a9f7f..17bcfcc8abdf2 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5(target=es5).js @@ -22,6 +22,7 @@ g({ p: "" }); //// [computedPropertyNamesContextualType7_ES5.js] +"use strict"; var _a; foo((_a = { 0: function () { } diff --git a/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.js b/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.js index d0d8169292fd9..ab8393610ff5c 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.js @@ -22,6 +22,7 @@ g({ p: "" }); //// [computedPropertyNamesContextualType7_ES6.js] +"use strict"; foo({ 0: () => { }, ["hi" + "bye"]: true, diff --git a/tests/baselines/reference/computedPropertyNamesContextualType8_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNamesContextualType8_ES5(target=es2015).js index fa17494272570..702c0b8ad87ce 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType8_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNamesContextualType8_ES5(target=es2015).js @@ -12,6 +12,7 @@ var o: I = { } //// [computedPropertyNamesContextualType8_ES5.js] +"use strict"; var o = { ["" + "foo"]: "", ["" + "bar"]: 0 diff --git a/tests/baselines/reference/computedPropertyNamesContextualType8_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNamesContextualType8_ES5(target=es5).js index db93adadeda72..2a95befb3ab45 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType8_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNamesContextualType8_ES5(target=es5).js @@ -12,6 +12,7 @@ var o: I = { } //// [computedPropertyNamesContextualType8_ES5.js] +"use strict"; var _a; var o = (_a = {}, _a["" + "foo"] = "", diff --git a/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.js b/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.js index 39fdf124cd716..63eb489a62962 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.js @@ -12,6 +12,7 @@ var o: I = { } //// [computedPropertyNamesContextualType8_ES6.js] +"use strict"; var o = { ["" + "foo"]: "", ["" + "bar"]: 0 diff --git a/tests/baselines/reference/computedPropertyNamesContextualType9_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNamesContextualType9_ES5(target=es2015).js index a8800bb849295..052ab3f9fde09 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType9_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNamesContextualType9_ES5(target=es2015).js @@ -12,6 +12,7 @@ var o: I = { } //// [computedPropertyNamesContextualType9_ES5.js] +"use strict"; var o = { [+"foo"]: "", [+"bar"]: 0 diff --git a/tests/baselines/reference/computedPropertyNamesContextualType9_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNamesContextualType9_ES5(target=es5).js index 1acf0456c9c8b..9982351f56784 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType9_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNamesContextualType9_ES5(target=es5).js @@ -12,6 +12,7 @@ var o: I = { } //// [computedPropertyNamesContextualType9_ES5.js] +"use strict"; var _a; var o = (_a = {}, _a[+"foo"] = "", diff --git a/tests/baselines/reference/computedPropertyNamesContextualType9_ES6.js b/tests/baselines/reference/computedPropertyNamesContextualType9_ES6.js index 5c97b85194007..66a833535541b 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType9_ES6.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType9_ES6.js @@ -12,6 +12,7 @@ var o: I = { } //// [computedPropertyNamesContextualType9_ES6.js] +"use strict"; var o = { [+"foo"]: "", [+"bar"]: 0 diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5(target=es2015).js index 1e68dfc072995..8c1fcc2823c13 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5(target=es2015).js @@ -8,6 +8,7 @@ class C { } //// [computedPropertyNamesDeclarationEmit1_ES5.js] +"use strict"; class C { ["" + ""]() { } get ["" + ""]() { return 0; } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5(target=es5).js index 7b191d399503d..8ca9a7694d6df 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5(target=es5).js @@ -8,6 +8,7 @@ class C { } //// [computedPropertyNamesDeclarationEmit1_ES5.js] +"use strict"; var C = /** @class */ (function () { function C() { } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.js b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.js index 325ccb7b5ce4a..9c1b6ddbe9d92 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.js +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.js @@ -8,6 +8,7 @@ class C { } //// [computedPropertyNamesDeclarationEmit1_ES6.js] +"use strict"; class C { ["" + ""]() { } get ["" + ""]() { return 0; } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5(target=es2015).js index e4b4554dbc4cc..830dfa3b1fe2d 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5(target=es2015).js @@ -8,6 +8,7 @@ class C { } //// [computedPropertyNamesDeclarationEmit2_ES5.js] +"use strict"; class C { static ["" + ""]() { } static get ["" + ""]() { return 0; } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5(target=es5).js index 6bfa2b01e02dc..5864b07166692 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5(target=es5).js @@ -8,6 +8,7 @@ class C { } //// [computedPropertyNamesDeclarationEmit2_ES5.js] +"use strict"; var C = /** @class */ (function () { function C() { } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.js b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.js index 27c5f938e6584..eae137ac171c4 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.js +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.js @@ -8,6 +8,7 @@ class C { } //// [computedPropertyNamesDeclarationEmit2_ES6.js] +"use strict"; class C { static ["" + ""]() { } static get ["" + ""]() { return 0; } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES5(target=es2015).js index 856dd36b5d9da..3c750e9045b58 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES5(target=es2015).js @@ -6,6 +6,7 @@ interface I { } //// [computedPropertyNamesDeclarationEmit3_ES5.js] +"use strict"; //// [computedPropertyNamesDeclarationEmit3_ES5.d.ts] diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES5(target=es5).js index 856dd36b5d9da..3c750e9045b58 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES5(target=es5).js @@ -6,6 +6,7 @@ interface I { } //// [computedPropertyNamesDeclarationEmit3_ES5.js] +"use strict"; //// [computedPropertyNamesDeclarationEmit3_ES5.d.ts] diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES6.js b/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES6.js index 89d9717c4cbac..cbc270783c455 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES6.js +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES6.js @@ -6,6 +6,7 @@ interface I { } //// [computedPropertyNamesDeclarationEmit3_ES6.js] +"use strict"; //// [computedPropertyNamesDeclarationEmit3_ES6.d.ts] diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES5(target=es2015).js index d55197324498e..d1c5b0414f610 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES5(target=es2015).js @@ -6,6 +6,7 @@ var v: { } //// [computedPropertyNamesDeclarationEmit4_ES5.js] +"use strict"; var v; diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES5(target=es5).js index d55197324498e..d1c5b0414f610 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES5(target=es5).js @@ -6,6 +6,7 @@ var v: { } //// [computedPropertyNamesDeclarationEmit4_ES5.js] +"use strict"; var v; diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES6.js b/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES6.js index dad68e886d83c..9fbbdb7459d88 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES6.js +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES6.js @@ -6,6 +6,7 @@ var v: { } //// [computedPropertyNamesDeclarationEmit4_ES6.js] +"use strict"; var v; diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5(target=es2015).js index 5eaf8ede3475e..83f02707fff0d 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5(target=es2015).js @@ -9,6 +9,7 @@ var v = { } //// [computedPropertyNamesDeclarationEmit5_ES5.js] +"use strict"; var v = { ["" + ""]: 0, ["" + ""]() { }, diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5(target=es5).js index f377ed3bd476c..2fa252cd8c68a 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5(target=es5).js @@ -9,6 +9,7 @@ var v = { } //// [computedPropertyNamesDeclarationEmit5_ES5.js] +"use strict"; var _a; var v = (_a = {}, _a["" + ""] = 0, diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.js b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.js index 9c8910cd0ff08..43b7945df3cae 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.js +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.js @@ -9,6 +9,7 @@ var v = { } //// [computedPropertyNamesDeclarationEmit5_ES6.js] +"use strict"; var v = { ["" + ""]: 0, ["" + ""]() { }, diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES5(target=es2015).js index cba340d3951e5..5e82f3b6de728 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES5(target=es2015).js @@ -10,6 +10,7 @@ var v = { //// [computedPropertyNamesDeclarationEmit6_ES5.js] +"use strict"; var v = { [-1]: {}, [+1]: {}, diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES5(target=es2015).types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES5(target=es2015).types index 158248b3dee4a..a56efd0766489 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES5(target=es2015).types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES5(target=es2015).types @@ -40,8 +40,8 @@ var v = { [!1]: {} >[!1] : {} > : ^^ ->!1 : boolean -> : ^^^^^^^ +>!1 : false +> : ^^^^^ >1 : 1 > : ^ >{} : {} diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES5(target=es5).js index cbea770355a8e..43cf1f30bff31 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES5(target=es5).js @@ -10,6 +10,7 @@ var v = { //// [computedPropertyNamesDeclarationEmit6_ES5.js] +"use strict"; var _a; var v = (_a = {}, _a[-1] = {}, diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES5(target=es5).types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES5(target=es5).types index 158248b3dee4a..a56efd0766489 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES5(target=es5).types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES5(target=es5).types @@ -40,8 +40,8 @@ var v = { [!1]: {} >[!1] : {} > : ^^ ->!1 : boolean -> : ^^^^^^^ +>!1 : false +> : ^^^^^ >1 : 1 > : ^ >{} : {} diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES6.js b/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES6.js index 2dc73405607ff..aae179c4dd22c 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES6.js +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES6.js @@ -10,6 +10,7 @@ var v = { //// [computedPropertyNamesDeclarationEmit6_ES6.js] +"use strict"; var v = { [-1]: {}, [+1]: {}, diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES6.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES6.types index 2731d44818131..94429f17ce7b7 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit6_ES6.types @@ -40,8 +40,8 @@ var v = { [!1]: {} >[!1] : {} > : ^^ ->!1 : boolean -> : ^^^^^^^ +>!1 : false +> : ^^^^^ >1 : 1 > : ^ >{} : {} diff --git a/tests/baselines/reference/computedPropertyNamesOnOverloads_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNamesOnOverloads_ES5(target=es2015).js index 993cb11ae4bd6..e35ec25e91271 100644 --- a/tests/baselines/reference/computedPropertyNamesOnOverloads_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNamesOnOverloads_ES5(target=es2015).js @@ -10,6 +10,7 @@ class C { } //// [computedPropertyNamesOnOverloads_ES5.js] +"use strict"; var methodName = "method"; var accessorName = "accessor"; class C { diff --git a/tests/baselines/reference/computedPropertyNamesOnOverloads_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNamesOnOverloads_ES5(target=es5).js index e0f77f33b6a2f..93802f9a1942b 100644 --- a/tests/baselines/reference/computedPropertyNamesOnOverloads_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNamesOnOverloads_ES5(target=es5).js @@ -10,6 +10,7 @@ class C { } //// [computedPropertyNamesOnOverloads_ES5.js] +"use strict"; var methodName = "method"; var accessorName = "accessor"; var C = /** @class */ (function () { diff --git a/tests/baselines/reference/computedPropertyNamesOnOverloads_ES6.js b/tests/baselines/reference/computedPropertyNamesOnOverloads_ES6.js index 5017aff67babb..5489d60921588 100644 --- a/tests/baselines/reference/computedPropertyNamesOnOverloads_ES6.js +++ b/tests/baselines/reference/computedPropertyNamesOnOverloads_ES6.js @@ -10,6 +10,7 @@ class C { } //// [computedPropertyNamesOnOverloads_ES6.js] +"use strict"; var methodName = "method"; var accessorName = "accessor"; class C { diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5(target=es2015).js index cefb0f943b944..12e2714f61f3a 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5(target=es2015).js @@ -11,6 +11,7 @@ class C { } //// [computedPropertyNamesSourceMap1_ES5.js] +"use strict"; class C { ["hello"]() { debugger; diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5(target=es2015).js.map b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5(target=es2015).js.map index c7b54a5aa1155..5fb3879fe798c 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5(target=es2015).js.map +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5(target=es2015).js.map @@ -1,3 +1,3 @@ //// [computedPropertyNamesSourceMap1_ES5.js.map] -{"version":3,"file":"computedPropertyNamesSourceMap1_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap1_ES5.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC;IACH,CAAC,OAAO,CAAC;QACL,QAAQ,CAAC;IACb,CAAC;IACD,IAAI,CAAC,SAAS,CAAC;QACjB,OAAO,CAAC,CAAC;IACP,CAAC;CACJ"} -//// https://sokra.github.io/source-map-visualization#base64,Y2xhc3MgQyB7DQogICAgWyJoZWxsbyJdKCkgew0KICAgICAgICBkZWJ1Z2dlcjsNCiAgICB9DQogICAgZ2V0IFsiZ29vZGJ5ZSJdKCkgew0KICAgICAgICByZXR1cm4gMDsNCiAgICB9DQp9DQovLyMgc291cmNlTWFwcGluZ1VSTD1jb21wdXRlZFByb3BlcnR5TmFtZXNTb3VyY2VNYXAxX0VTNS5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcHV0ZWRQcm9wZXJ0eU5hbWVzU291cmNlTWFwMV9FUzUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJjb21wdXRlZFByb3BlcnR5TmFtZXNTb3VyY2VNYXAxX0VTNS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLENBQUM7SUFDSCxDQUFDLE9BQU8sQ0FBQztRQUNMLFFBQVEsQ0FBQztJQUNiLENBQUM7SUFDRCxJQUFJLENBQUMsU0FBUyxDQUFDO1FBQ2pCLE9BQU8sQ0FBQyxDQUFDO0lBQ1AsQ0FBQztDQUNKIn0=,Y2xhc3MgQyB7CiAgICBbImhlbGxvIl0oKSB7CiAgICAgICAgZGVidWdnZXI7CiAgICB9CiAgICBnZXQgWyJnb29kYnllIl0oKSB7CgkJcmV0dXJuIDA7CiAgICB9Cn0= +{"version":3,"file":"computedPropertyNamesSourceMap1_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap1_ES5.ts"],"names":[],"mappings":";AAAA,MAAM,CAAC;IACH,CAAC,OAAO,CAAC;QACL,QAAQ,CAAC;IACb,CAAC;IACD,IAAI,CAAC,SAAS,CAAC;QACjB,OAAO,CAAC,CAAC;IACP,CAAC;CACJ"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KY2xhc3MgQyB7DQogICAgWyJoZWxsbyJdKCkgew0KICAgICAgICBkZWJ1Z2dlcjsNCiAgICB9DQogICAgZ2V0IFsiZ29vZGJ5ZSJdKCkgew0KICAgICAgICByZXR1cm4gMDsNCiAgICB9DQp9DQovLyMgc291cmNlTWFwcGluZ1VSTD1jb21wdXRlZFByb3BlcnR5TmFtZXNTb3VyY2VNYXAxX0VTNS5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcHV0ZWRQcm9wZXJ0eU5hbWVzU291cmNlTWFwMV9FUzUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJjb21wdXRlZFByb3BlcnR5TmFtZXNTb3VyY2VNYXAxX0VTNS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsTUFBTSxDQUFDO0lBQ0gsQ0FBQyxPQUFPLENBQUM7UUFDTCxRQUFRLENBQUM7SUFDYixDQUFDO0lBQ0QsSUFBSSxDQUFDLFNBQVMsQ0FBQztRQUNqQixPQUFPLENBQUMsQ0FBQztJQUNQLENBQUM7Q0FDSiJ9,Y2xhc3MgQyB7CiAgICBbImhlbGxvIl0oKSB7CiAgICAgICAgZGVidWdnZXI7CiAgICB9CiAgICBnZXQgWyJnb29kYnllIl0oKSB7CgkJcmV0dXJuIDA7CiAgICB9Cn0= diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5(target=es2015).sourcemap.txt b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5(target=es2015).sourcemap.txt index 61b0281382d5b..21872a1bdbb94 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5(target=es2015).sourcemap.txt +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5(target=es2015).sourcemap.txt @@ -8,6 +8,7 @@ sources: computedPropertyNamesSourceMap1_ES5.ts emittedFile:computedPropertyNamesSourceMap1_ES5.js sourceFile:computedPropertyNamesSourceMap1_ES5.ts ------------------------------------------------------------------- +>>>"use strict"; >>>class C { 1 > 2 >^^^^^^ @@ -16,9 +17,9 @@ sourceFile:computedPropertyNamesSourceMap1_ES5.ts 1 > 2 >class 3 > C -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -3 >Emitted(1, 8) Source(1, 8) + SourceIndex(0) +1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 7) Source(1, 7) + SourceIndex(0) +3 >Emitted(2, 8) Source(1, 8) + SourceIndex(0) --- >>> ["hello"]() { 1->^^^^ @@ -31,10 +32,10 @@ sourceFile:computedPropertyNamesSourceMap1_ES5.ts 2 > [ 3 > "hello" 4 > ] -1->Emitted(2, 5) Source(2, 5) + SourceIndex(0) -2 >Emitted(2, 6) Source(2, 6) + SourceIndex(0) -3 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) -4 >Emitted(2, 14) Source(2, 14) + SourceIndex(0) +1->Emitted(3, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(3, 6) Source(2, 6) + SourceIndex(0) +3 >Emitted(3, 13) Source(2, 13) + SourceIndex(0) +4 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) --- >>> debugger; 1->^^^^^^^^ @@ -44,9 +45,9 @@ sourceFile:computedPropertyNamesSourceMap1_ES5.ts > 2 > debugger 3 > ; -1->Emitted(3, 9) Source(3, 9) + SourceIndex(0) -2 >Emitted(3, 17) Source(3, 17) + SourceIndex(0) -3 >Emitted(3, 18) Source(3, 18) + SourceIndex(0) +1->Emitted(4, 9) Source(3, 9) + SourceIndex(0) +2 >Emitted(4, 17) Source(3, 17) + SourceIndex(0) +3 >Emitted(4, 18) Source(3, 18) + SourceIndex(0) --- >>> } 1 >^^^^ @@ -55,8 +56,8 @@ sourceFile:computedPropertyNamesSourceMap1_ES5.ts 1 > > 2 > } -1 >Emitted(4, 5) Source(4, 5) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 6) + SourceIndex(0) +1 >Emitted(5, 5) Source(4, 5) + SourceIndex(0) +2 >Emitted(5, 6) Source(4, 6) + SourceIndex(0) --- >>> get ["goodbye"]() { 1->^^^^ @@ -70,11 +71,11 @@ sourceFile:computedPropertyNamesSourceMap1_ES5.ts 3 > [ 4 > "goodbye" 5 > ] -1->Emitted(5, 5) Source(5, 5) + SourceIndex(0) -2 >Emitted(5, 9) Source(5, 9) + SourceIndex(0) -3 >Emitted(5, 10) Source(5, 10) + SourceIndex(0) -4 >Emitted(5, 19) Source(5, 19) + SourceIndex(0) -5 >Emitted(5, 20) Source(5, 20) + SourceIndex(0) +1->Emitted(6, 5) Source(5, 5) + SourceIndex(0) +2 >Emitted(6, 9) Source(5, 9) + SourceIndex(0) +3 >Emitted(6, 10) Source(5, 10) + SourceIndex(0) +4 >Emitted(6, 19) Source(5, 19) + SourceIndex(0) +5 >Emitted(6, 20) Source(5, 20) + SourceIndex(0) --- >>> return 0; 1 >^^^^^^^^ @@ -86,10 +87,10 @@ sourceFile:computedPropertyNamesSourceMap1_ES5.ts 2 > return 3 > 0 4 > ; -1 >Emitted(6, 9) Source(6, 3) + SourceIndex(0) -2 >Emitted(6, 16) Source(6, 10) + SourceIndex(0) -3 >Emitted(6, 17) Source(6, 11) + SourceIndex(0) -4 >Emitted(6, 18) Source(6, 12) + SourceIndex(0) +1 >Emitted(7, 9) Source(6, 3) + SourceIndex(0) +2 >Emitted(7, 16) Source(6, 10) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 11) + SourceIndex(0) +4 >Emitted(7, 18) Source(6, 12) + SourceIndex(0) --- >>> } 1 >^^^^ @@ -97,14 +98,14 @@ sourceFile:computedPropertyNamesSourceMap1_ES5.ts 1 > > 2 > } -1 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) -2 >Emitted(7, 6) Source(7, 6) + SourceIndex(0) +1 >Emitted(8, 5) Source(7, 5) + SourceIndex(0) +2 >Emitted(8, 6) Source(7, 6) + SourceIndex(0) --- >>>} 1 >^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > >} -1 >Emitted(8, 2) Source(8, 2) + SourceIndex(0) +1 >Emitted(9, 2) Source(8, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=computedPropertyNamesSourceMap1_ES5.js.map \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5(target=es5).js index 828d009383a4b..b549c32e218df 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5(target=es5).js @@ -11,6 +11,7 @@ class C { } //// [computedPropertyNamesSourceMap1_ES5.js] +"use strict"; var C = /** @class */ (function () { function C() { } diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5(target=es5).js.map b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5(target=es5).js.map index 2a3dd476af1fa..92372815411e7 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5(target=es5).js.map +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5(target=es5).js.map @@ -1,3 +1,3 @@ //// [computedPropertyNamesSourceMap1_ES5.js.map] -{"version":3,"file":"computedPropertyNamesSourceMap1_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap1_ES5.ts"],"names":[],"mappings":"AAAA;IAAA;IAOA,CAAC;IANG,YAAC,OAAO,CAAC,GAAT;QACI,QAAQ,CAAC;IACb,CAAC;IACD,sBAAI,sBAAW;aAAf;YACF,OAAO,CAAC,CAAC;QACP,CAAC;;;OAAA;IACL,QAAC;AAAD,CAAC,AAPD,IAOC"} -//// https://sokra.github.io/source-map-visualization#base64,dmFyIEMgPSAvKiogQGNsYXNzICovIChmdW5jdGlvbiAoKSB7DQogICAgZnVuY3Rpb24gQygpIHsNCiAgICB9DQogICAgQy5wcm90b3R5cGVbImhlbGxvIl0gPSBmdW5jdGlvbiAoKSB7DQogICAgICAgIGRlYnVnZ2VyOw0KICAgIH07DQogICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KEMucHJvdG90eXBlLCAiZ29vZGJ5ZSIsIHsNCiAgICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7DQogICAgICAgICAgICByZXR1cm4gMDsNCiAgICAgICAgfSwNCiAgICAgICAgZW51bWVyYWJsZTogZmFsc2UsDQogICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZQ0KICAgIH0pOw0KICAgIHJldHVybiBDOw0KfSgpKTsNCi8vIyBzb3VyY2VNYXBwaW5nVVJMPWNvbXB1dGVkUHJvcGVydHlOYW1lc1NvdXJjZU1hcDFfRVM1LmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcHV0ZWRQcm9wZXJ0eU5hbWVzU291cmNlTWFwMV9FUzUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJjb21wdXRlZFByb3BlcnR5TmFtZXNTb3VyY2VNYXAxX0VTNS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtJQUFBO0lBT0EsQ0FBQztJQU5HLFlBQUMsT0FBTyxDQUFDLEdBQVQ7UUFDSSxRQUFRLENBQUM7SUFDYixDQUFDO0lBQ0Qsc0JBQUksc0JBQVc7YUFBZjtZQUNGLE9BQU8sQ0FBQyxDQUFDO1FBQ1AsQ0FBQzs7O09BQUE7SUFDTCxRQUFDO0FBQUQsQ0FBQyxBQVBELElBT0MifQ==,Y2xhc3MgQyB7CiAgICBbImhlbGxvIl0oKSB7CiAgICAgICAgZGVidWdnZXI7CiAgICB9CiAgICBnZXQgWyJnb29kYnllIl0oKSB7CgkJcmV0dXJuIDA7CiAgICB9Cn0= +{"version":3,"file":"computedPropertyNamesSourceMap1_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap1_ES5.ts"],"names":[],"mappings":";AAAA;IAAA;IAOA,CAAC;IANG,YAAC,OAAO,CAAC,GAAT;QACI,QAAQ,CAAC;IACb,CAAC;IACD,sBAAI,sBAAW;aAAf;YACF,OAAO,CAAC,CAAC;QACP,CAAC;;;OAAA;IACL,QAAC;AAAD,CAAC,AAPD,IAOC"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KdmFyIEMgPSAvKiogQGNsYXNzICovIChmdW5jdGlvbiAoKSB7DQogICAgZnVuY3Rpb24gQygpIHsNCiAgICB9DQogICAgQy5wcm90b3R5cGVbImhlbGxvIl0gPSBmdW5jdGlvbiAoKSB7DQogICAgICAgIGRlYnVnZ2VyOw0KICAgIH07DQogICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KEMucHJvdG90eXBlLCAiZ29vZGJ5ZSIsIHsNCiAgICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7DQogICAgICAgICAgICByZXR1cm4gMDsNCiAgICAgICAgfSwNCiAgICAgICAgZW51bWVyYWJsZTogZmFsc2UsDQogICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZQ0KICAgIH0pOw0KICAgIHJldHVybiBDOw0KfSgpKTsNCi8vIyBzb3VyY2VNYXBwaW5nVVJMPWNvbXB1dGVkUHJvcGVydHlOYW1lc1NvdXJjZU1hcDFfRVM1LmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcHV0ZWRQcm9wZXJ0eU5hbWVzU291cmNlTWFwMV9FUzUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJjb21wdXRlZFByb3BlcnR5TmFtZXNTb3VyY2VNYXAxX0VTNS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7SUFBQTtJQU9BLENBQUM7SUFORyxZQUFDLE9BQU8sQ0FBQyxHQUFUO1FBQ0ksUUFBUSxDQUFDO0lBQ2IsQ0FBQztJQUNELHNCQUFJLHNCQUFXO2FBQWY7WUFDRixPQUFPLENBQUMsQ0FBQztRQUNQLENBQUM7OztPQUFBO0lBQ0wsUUFBQztBQUFELENBQUMsQUFQRCxJQU9DIn0=,Y2xhc3MgQyB7CiAgICBbImhlbGxvIl0oKSB7CiAgICAgICAgZGVidWdnZXI7CiAgICB9CiAgICBnZXQgWyJnb29kYnllIl0oKSB7CgkJcmV0dXJuIDA7CiAgICB9Cn0= diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5(target=es5).sourcemap.txt b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5(target=es5).sourcemap.txt index 48f9352edaba9..ccb781f12a5ff 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5(target=es5).sourcemap.txt +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5(target=es5).sourcemap.txt @@ -8,17 +8,18 @@ sources: computedPropertyNamesSourceMap1_ES5.ts emittedFile:computedPropertyNamesSourceMap1_ES5.js sourceFile:computedPropertyNamesSourceMap1_ES5.ts ------------------------------------------------------------------- +>>>"use strict"; >>>var C = /** @class */ (function () { 1 > 2 >^^^^^^^^^^^^^^^^^^^-> 1 > -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) --- >>> function C() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(2, 5) Source(1, 1) + SourceIndex(0) +1->Emitted(3, 5) Source(1, 1) + SourceIndex(0) --- >>> } 1->^^^^ @@ -33,8 +34,8 @@ sourceFile:computedPropertyNamesSourceMap1_ES5.ts > } > 2 > } -1->Emitted(3, 5) Source(8, 1) + SourceIndex(0) -2 >Emitted(3, 6) Source(8, 2) + SourceIndex(0) +1->Emitted(4, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(4, 6) Source(8, 2) + SourceIndex(0) --- >>> C.prototype["hello"] = function () { 1->^^^^ @@ -47,11 +48,11 @@ sourceFile:computedPropertyNamesSourceMap1_ES5.ts 3 > "hello" 4 > ] 5 > -1->Emitted(4, 5) Source(2, 5) + SourceIndex(0) -2 >Emitted(4, 17) Source(2, 6) + SourceIndex(0) -3 >Emitted(4, 24) Source(2, 13) + SourceIndex(0) -4 >Emitted(4, 25) Source(2, 14) + SourceIndex(0) -5 >Emitted(4, 28) Source(2, 5) + SourceIndex(0) +1->Emitted(5, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(5, 17) Source(2, 6) + SourceIndex(0) +3 >Emitted(5, 24) Source(2, 13) + SourceIndex(0) +4 >Emitted(5, 25) Source(2, 14) + SourceIndex(0) +5 >Emitted(5, 28) Source(2, 5) + SourceIndex(0) --- >>> debugger; 1 >^^^^^^^^ @@ -61,9 +62,9 @@ sourceFile:computedPropertyNamesSourceMap1_ES5.ts > 2 > debugger 3 > ; -1 >Emitted(5, 9) Source(3, 9) + SourceIndex(0) -2 >Emitted(5, 17) Source(3, 17) + SourceIndex(0) -3 >Emitted(5, 18) Source(3, 18) + SourceIndex(0) +1 >Emitted(6, 9) Source(3, 9) + SourceIndex(0) +2 >Emitted(6, 17) Source(3, 17) + SourceIndex(0) +3 >Emitted(6, 18) Source(3, 18) + SourceIndex(0) --- >>> }; 1 >^^^^ @@ -72,8 +73,8 @@ sourceFile:computedPropertyNamesSourceMap1_ES5.ts 1 > > 2 > } -1 >Emitted(6, 5) Source(4, 5) + SourceIndex(0) -2 >Emitted(6, 6) Source(4, 6) + SourceIndex(0) +1 >Emitted(7, 5) Source(4, 5) + SourceIndex(0) +2 >Emitted(7, 6) Source(4, 6) + SourceIndex(0) --- >>> Object.defineProperty(C.prototype, "goodbye", { 1->^^^^ @@ -83,15 +84,15 @@ sourceFile:computedPropertyNamesSourceMap1_ES5.ts > 2 > get 3 > ["goodbye"] -1->Emitted(7, 5) Source(5, 5) + SourceIndex(0) -2 >Emitted(7, 27) Source(5, 9) + SourceIndex(0) -3 >Emitted(7, 49) Source(5, 20) + SourceIndex(0) +1->Emitted(8, 5) Source(5, 5) + SourceIndex(0) +2 >Emitted(8, 27) Source(5, 9) + SourceIndex(0) +3 >Emitted(8, 49) Source(5, 20) + SourceIndex(0) --- >>> get: function () { 1 >^^^^^^^^^^^^^ 2 > ^^^^^^^^^-> 1 > -1 >Emitted(8, 14) Source(5, 5) + SourceIndex(0) +1 >Emitted(9, 14) Source(5, 5) + SourceIndex(0) --- >>> return 0; 1->^^^^^^^^^^^^ @@ -103,10 +104,10 @@ sourceFile:computedPropertyNamesSourceMap1_ES5.ts 2 > return 3 > 0 4 > ; -1->Emitted(9, 13) Source(6, 3) + SourceIndex(0) -2 >Emitted(9, 20) Source(6, 10) + SourceIndex(0) -3 >Emitted(9, 21) Source(6, 11) + SourceIndex(0) -4 >Emitted(9, 22) Source(6, 12) + SourceIndex(0) +1->Emitted(10, 13) Source(6, 3) + SourceIndex(0) +2 >Emitted(10, 20) Source(6, 10) + SourceIndex(0) +3 >Emitted(10, 21) Source(6, 11) + SourceIndex(0) +4 >Emitted(10, 22) Source(6, 12) + SourceIndex(0) --- >>> }, 1 >^^^^^^^^ @@ -115,8 +116,8 @@ sourceFile:computedPropertyNamesSourceMap1_ES5.ts 1 > > 2 > } -1 >Emitted(10, 9) Source(7, 5) + SourceIndex(0) -2 >Emitted(10, 10) Source(7, 6) + SourceIndex(0) +1 >Emitted(11, 9) Source(7, 5) + SourceIndex(0) +2 >Emitted(11, 10) Source(7, 6) + SourceIndex(0) --- >>> enumerable: false, >>> configurable: true @@ -124,7 +125,7 @@ sourceFile:computedPropertyNamesSourceMap1_ES5.ts 1->^^^^^^^ 2 > ^^^^^^^-> 1-> -1->Emitted(13, 8) Source(7, 6) + SourceIndex(0) +1->Emitted(14, 8) Source(7, 6) + SourceIndex(0) --- >>> return C; 1->^^^^ @@ -132,8 +133,8 @@ sourceFile:computedPropertyNamesSourceMap1_ES5.ts 1-> > 2 > } -1->Emitted(14, 5) Source(8, 1) + SourceIndex(0) -2 >Emitted(14, 13) Source(8, 2) + SourceIndex(0) +1->Emitted(15, 5) Source(8, 1) + SourceIndex(0) +2 >Emitted(15, 13) Source(8, 2) + SourceIndex(0) --- >>>}()); 1 > @@ -152,9 +153,9 @@ sourceFile:computedPropertyNamesSourceMap1_ES5.ts > return 0; > } > } -1 >Emitted(15, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(15, 2) Source(8, 2) + SourceIndex(0) -3 >Emitted(15, 2) Source(1, 1) + SourceIndex(0) -4 >Emitted(15, 6) Source(8, 2) + SourceIndex(0) +1 >Emitted(16, 1) Source(8, 1) + SourceIndex(0) +2 >Emitted(16, 2) Source(8, 2) + SourceIndex(0) +3 >Emitted(16, 2) Source(1, 1) + SourceIndex(0) +4 >Emitted(16, 6) Source(8, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=computedPropertyNamesSourceMap1_ES5.js.map \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.js b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.js index 825d4ef54a390..7255eba4e0a4d 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.js +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.js @@ -11,6 +11,7 @@ class C { } //// [computedPropertyNamesSourceMap1_ES6.js] +"use strict"; class C { ["hello"]() { debugger; diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.js.map b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.js.map index 6ddcc3fc78a0f..d2d48073b48fb 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.js.map +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.js.map @@ -1,3 +1,3 @@ //// [computedPropertyNamesSourceMap1_ES6.js.map] -{"version":3,"file":"computedPropertyNamesSourceMap1_ES6.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap1_ES6.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC;IACH,CAAC,OAAO,CAAC;QACL,QAAQ,CAAC;IAChB,CAAC;IACD,IAAI,CAAC,SAAS,CAAC;QACd,OAAO,CAAC,CAAC;IACV,CAAC;CACD"} -//// https://sokra.github.io/source-map-visualization#base64,Y2xhc3MgQyB7DQogICAgWyJoZWxsbyJdKCkgew0KICAgICAgICBkZWJ1Z2dlcjsNCiAgICB9DQogICAgZ2V0IFsiZ29vZGJ5ZSJdKCkgew0KICAgICAgICByZXR1cm4gMDsNCiAgICB9DQp9DQovLyMgc291cmNlTWFwcGluZ1VSTD1jb21wdXRlZFByb3BlcnR5TmFtZXNTb3VyY2VNYXAxX0VTNi5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcHV0ZWRQcm9wZXJ0eU5hbWVzU291cmNlTWFwMV9FUzYuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJjb21wdXRlZFByb3BlcnR5TmFtZXNTb3VyY2VNYXAxX0VTNi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLENBQUM7SUFDSCxDQUFDLE9BQU8sQ0FBQztRQUNMLFFBQVEsQ0FBQztJQUNoQixDQUFDO0lBQ0QsSUFBSSxDQUFDLFNBQVMsQ0FBQztRQUNkLE9BQU8sQ0FBQyxDQUFDO0lBQ1YsQ0FBQztDQUNEIn0=,Y2xhc3MgQyB7CiAgICBbImhlbGxvIl0oKSB7CiAgICAgICAgZGVidWdnZXI7Cgl9CglnZXQgWyJnb29kYnllIl0oKSB7CgkJcmV0dXJuIDA7Cgl9Cn0= +{"version":3,"file":"computedPropertyNamesSourceMap1_ES6.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap1_ES6.ts"],"names":[],"mappings":";AAAA,MAAM,CAAC;IACH,CAAC,OAAO,CAAC;QACL,QAAQ,CAAC;IAChB,CAAC;IACD,IAAI,CAAC,SAAS,CAAC;QACd,OAAO,CAAC,CAAC;IACV,CAAC;CACD"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KY2xhc3MgQyB7DQogICAgWyJoZWxsbyJdKCkgew0KICAgICAgICBkZWJ1Z2dlcjsNCiAgICB9DQogICAgZ2V0IFsiZ29vZGJ5ZSJdKCkgew0KICAgICAgICByZXR1cm4gMDsNCiAgICB9DQp9DQovLyMgc291cmNlTWFwcGluZ1VSTD1jb21wdXRlZFByb3BlcnR5TmFtZXNTb3VyY2VNYXAxX0VTNi5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcHV0ZWRQcm9wZXJ0eU5hbWVzU291cmNlTWFwMV9FUzYuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJjb21wdXRlZFByb3BlcnR5TmFtZXNTb3VyY2VNYXAxX0VTNi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsTUFBTSxDQUFDO0lBQ0gsQ0FBQyxPQUFPLENBQUM7UUFDTCxRQUFRLENBQUM7SUFDaEIsQ0FBQztJQUNELElBQUksQ0FBQyxTQUFTLENBQUM7UUFDZCxPQUFPLENBQUMsQ0FBQztJQUNWLENBQUM7Q0FDRCJ9,Y2xhc3MgQyB7CiAgICBbImhlbGxvIl0oKSB7CiAgICAgICAgZGVidWdnZXI7Cgl9CglnZXQgWyJnb29kYnllIl0oKSB7CgkJcmV0dXJuIDA7Cgl9Cn0= diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.sourcemap.txt b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.sourcemap.txt index c14bc528581dc..265476f52b205 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.sourcemap.txt +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.sourcemap.txt @@ -8,6 +8,7 @@ sources: computedPropertyNamesSourceMap1_ES6.ts emittedFile:computedPropertyNamesSourceMap1_ES6.js sourceFile:computedPropertyNamesSourceMap1_ES6.ts ------------------------------------------------------------------- +>>>"use strict"; >>>class C { 1 > 2 >^^^^^^ @@ -16,9 +17,9 @@ sourceFile:computedPropertyNamesSourceMap1_ES6.ts 1 > 2 >class 3 > C -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -3 >Emitted(1, 8) Source(1, 8) + SourceIndex(0) +1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 7) Source(1, 7) + SourceIndex(0) +3 >Emitted(2, 8) Source(1, 8) + SourceIndex(0) --- >>> ["hello"]() { 1->^^^^ @@ -31,10 +32,10 @@ sourceFile:computedPropertyNamesSourceMap1_ES6.ts 2 > [ 3 > "hello" 4 > ] -1->Emitted(2, 5) Source(2, 5) + SourceIndex(0) -2 >Emitted(2, 6) Source(2, 6) + SourceIndex(0) -3 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) -4 >Emitted(2, 14) Source(2, 14) + SourceIndex(0) +1->Emitted(3, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(3, 6) Source(2, 6) + SourceIndex(0) +3 >Emitted(3, 13) Source(2, 13) + SourceIndex(0) +4 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) --- >>> debugger; 1->^^^^^^^^ @@ -44,9 +45,9 @@ sourceFile:computedPropertyNamesSourceMap1_ES6.ts > 2 > debugger 3 > ; -1->Emitted(3, 9) Source(3, 9) + SourceIndex(0) -2 >Emitted(3, 17) Source(3, 17) + SourceIndex(0) -3 >Emitted(3, 18) Source(3, 18) + SourceIndex(0) +1->Emitted(4, 9) Source(3, 9) + SourceIndex(0) +2 >Emitted(4, 17) Source(3, 17) + SourceIndex(0) +3 >Emitted(4, 18) Source(3, 18) + SourceIndex(0) --- >>> } 1 >^^^^ @@ -55,8 +56,8 @@ sourceFile:computedPropertyNamesSourceMap1_ES6.ts 1 > > 2 > } -1 >Emitted(4, 5) Source(4, 2) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 3) + SourceIndex(0) +1 >Emitted(5, 5) Source(4, 2) + SourceIndex(0) +2 >Emitted(5, 6) Source(4, 3) + SourceIndex(0) --- >>> get ["goodbye"]() { 1->^^^^ @@ -70,11 +71,11 @@ sourceFile:computedPropertyNamesSourceMap1_ES6.ts 3 > [ 4 > "goodbye" 5 > ] -1->Emitted(5, 5) Source(5, 2) + SourceIndex(0) -2 >Emitted(5, 9) Source(5, 6) + SourceIndex(0) -3 >Emitted(5, 10) Source(5, 7) + SourceIndex(0) -4 >Emitted(5, 19) Source(5, 16) + SourceIndex(0) -5 >Emitted(5, 20) Source(5, 17) + SourceIndex(0) +1->Emitted(6, 5) Source(5, 2) + SourceIndex(0) +2 >Emitted(6, 9) Source(5, 6) + SourceIndex(0) +3 >Emitted(6, 10) Source(5, 7) + SourceIndex(0) +4 >Emitted(6, 19) Source(5, 16) + SourceIndex(0) +5 >Emitted(6, 20) Source(5, 17) + SourceIndex(0) --- >>> return 0; 1 >^^^^^^^^ @@ -86,10 +87,10 @@ sourceFile:computedPropertyNamesSourceMap1_ES6.ts 2 > return 3 > 0 4 > ; -1 >Emitted(6, 9) Source(6, 3) + SourceIndex(0) -2 >Emitted(6, 16) Source(6, 10) + SourceIndex(0) -3 >Emitted(6, 17) Source(6, 11) + SourceIndex(0) -4 >Emitted(6, 18) Source(6, 12) + SourceIndex(0) +1 >Emitted(7, 9) Source(6, 3) + SourceIndex(0) +2 >Emitted(7, 16) Source(6, 10) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 11) + SourceIndex(0) +4 >Emitted(7, 18) Source(6, 12) + SourceIndex(0) --- >>> } 1 >^^^^ @@ -97,14 +98,14 @@ sourceFile:computedPropertyNamesSourceMap1_ES6.ts 1 > > 2 > } -1 >Emitted(7, 5) Source(7, 2) + SourceIndex(0) -2 >Emitted(7, 6) Source(7, 3) + SourceIndex(0) +1 >Emitted(8, 5) Source(7, 2) + SourceIndex(0) +2 >Emitted(8, 6) Source(7, 3) + SourceIndex(0) --- >>>} 1 >^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > >} -1 >Emitted(8, 2) Source(8, 2) + SourceIndex(0) +1 >Emitted(9, 2) Source(8, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=computedPropertyNamesSourceMap1_ES6.js.map \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5(target=es2015).js b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5(target=es2015).js index 2216e38e50466..04767eb79c284 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5(target=es2015).js +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5(target=es2015).js @@ -11,6 +11,7 @@ var v = { } //// [computedPropertyNamesSourceMap2_ES5.js] +"use strict"; var v = { ["hello"]() { debugger; diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5(target=es2015).js.map b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5(target=es2015).js.map index 5907869bd9e58..d07d2afae64e4 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5(target=es2015).js.map +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5(target=es2015).js.map @@ -1,3 +1,3 @@ //// [computedPropertyNamesSourceMap2_ES5.js.map] -{"version":3,"file":"computedPropertyNamesSourceMap2_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES5.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG;IACJ,CAAC,OAAO,CAAC;QACL,QAAQ,CAAC;IAChB,CAAC;IACE,IAAI,CAAC,SAAS,CAAC;QACjB,OAAO,CAAC,CAAC;IACV,CAAC;CACD,CAAA"} -//// https://sokra.github.io/source-map-visualization#base64,dmFyIHYgPSB7DQogICAgWyJoZWxsbyJdKCkgew0KICAgICAgICBkZWJ1Z2dlcjsNCiAgICB9LA0KICAgIGdldCBbImdvb2RieWUiXSgpIHsNCiAgICAgICAgcmV0dXJuIDA7DQogICAgfQ0KfTsNCi8vIyBzb3VyY2VNYXBwaW5nVVJMPWNvbXB1dGVkUHJvcGVydHlOYW1lc1NvdXJjZU1hcDJfRVM1LmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcHV0ZWRQcm9wZXJ0eU5hbWVzU291cmNlTWFwMl9FUzUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJjb21wdXRlZFByb3BlcnR5TmFtZXNTb3VyY2VNYXAyX0VTNS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxJQUFJLENBQUMsR0FBRztJQUNKLENBQUMsT0FBTyxDQUFDO1FBQ0wsUUFBUSxDQUFDO0lBQ2hCLENBQUM7SUFDRSxJQUFJLENBQUMsU0FBUyxDQUFDO1FBQ2pCLE9BQU8sQ0FBQyxDQUFDO0lBQ1YsQ0FBQztDQUNELENBQUEifQ==,dmFyIHYgPSB7CiAgICBbImhlbGxvIl0oKSB7CiAgICAgICAgZGVidWdnZXI7Cgl9LAogICAgZ2V0IFsiZ29vZGJ5ZSJdKCkgewoJCXJldHVybiAwOwoJfQp9 +{"version":3,"file":"computedPropertyNamesSourceMap2_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES5.ts"],"names":[],"mappings":";AAAA,IAAI,CAAC,GAAG;IACJ,CAAC,OAAO,CAAC;QACL,QAAQ,CAAC;IAChB,CAAC;IACE,IAAI,CAAC,SAAS,CAAC;QACjB,OAAO,CAAC,CAAC;IACV,CAAC;CACD,CAAA"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KdmFyIHYgPSB7DQogICAgWyJoZWxsbyJdKCkgew0KICAgICAgICBkZWJ1Z2dlcjsNCiAgICB9LA0KICAgIGdldCBbImdvb2RieWUiXSgpIHsNCiAgICAgICAgcmV0dXJuIDA7DQogICAgfQ0KfTsNCi8vIyBzb3VyY2VNYXBwaW5nVVJMPWNvbXB1dGVkUHJvcGVydHlOYW1lc1NvdXJjZU1hcDJfRVM1LmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcHV0ZWRQcm9wZXJ0eU5hbWVzU291cmNlTWFwMl9FUzUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJjb21wdXRlZFByb3BlcnR5TmFtZXNTb3VyY2VNYXAyX0VTNS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsSUFBSSxDQUFDLEdBQUc7SUFDSixDQUFDLE9BQU8sQ0FBQztRQUNMLFFBQVEsQ0FBQztJQUNoQixDQUFDO0lBQ0UsSUFBSSxDQUFDLFNBQVMsQ0FBQztRQUNqQixPQUFPLENBQUMsQ0FBQztJQUNWLENBQUM7Q0FDRCxDQUFBIn0=,dmFyIHYgPSB7CiAgICBbImhlbGxvIl0oKSB7CiAgICAgICAgZGVidWdnZXI7Cgl9LAogICAgZ2V0IFsiZ29vZGJ5ZSJdKCkgewoJCXJldHVybiAwOwoJfQp9 diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5(target=es2015).sourcemap.txt b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5(target=es2015).sourcemap.txt index f82ceefe60685..37b8313f11e46 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5(target=es2015).sourcemap.txt +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5(target=es2015).sourcemap.txt @@ -8,6 +8,7 @@ sources: computedPropertyNamesSourceMap2_ES5.ts emittedFile:computedPropertyNamesSourceMap2_ES5.js sourceFile:computedPropertyNamesSourceMap2_ES5.ts ------------------------------------------------------------------- +>>>"use strict"; >>>var v = { 1 > 2 >^^^^ @@ -18,10 +19,10 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts 2 >var 3 > v 4 > = -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) -4 >Emitted(1, 9) Source(1, 9) + SourceIndex(0) +1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(2, 6) Source(1, 6) + SourceIndex(0) +4 >Emitted(2, 9) Source(1, 9) + SourceIndex(0) --- >>> ["hello"]() { 1->^^^^ @@ -34,10 +35,10 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts 2 > [ 3 > "hello" 4 > ] -1->Emitted(2, 5) Source(2, 5) + SourceIndex(0) -2 >Emitted(2, 6) Source(2, 6) + SourceIndex(0) -3 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) -4 >Emitted(2, 14) Source(2, 14) + SourceIndex(0) +1->Emitted(3, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(3, 6) Source(2, 6) + SourceIndex(0) +3 >Emitted(3, 13) Source(2, 13) + SourceIndex(0) +4 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) --- >>> debugger; 1->^^^^^^^^ @@ -47,9 +48,9 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts > 2 > debugger 3 > ; -1->Emitted(3, 9) Source(3, 9) + SourceIndex(0) -2 >Emitted(3, 17) Source(3, 17) + SourceIndex(0) -3 >Emitted(3, 18) Source(3, 18) + SourceIndex(0) +1->Emitted(4, 9) Source(3, 9) + SourceIndex(0) +2 >Emitted(4, 17) Source(3, 17) + SourceIndex(0) +3 >Emitted(4, 18) Source(3, 18) + SourceIndex(0) --- >>> }, 1 >^^^^ @@ -58,8 +59,8 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts 1 > > 2 > } -1 >Emitted(4, 5) Source(4, 2) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 3) + SourceIndex(0) +1 >Emitted(5, 5) Source(4, 2) + SourceIndex(0) +2 >Emitted(5, 6) Source(4, 3) + SourceIndex(0) --- >>> get ["goodbye"]() { 1->^^^^ @@ -73,11 +74,11 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts 3 > [ 4 > "goodbye" 5 > ] -1->Emitted(5, 5) Source(5, 5) + SourceIndex(0) -2 >Emitted(5, 9) Source(5, 9) + SourceIndex(0) -3 >Emitted(5, 10) Source(5, 10) + SourceIndex(0) -4 >Emitted(5, 19) Source(5, 19) + SourceIndex(0) -5 >Emitted(5, 20) Source(5, 20) + SourceIndex(0) +1->Emitted(6, 5) Source(5, 5) + SourceIndex(0) +2 >Emitted(6, 9) Source(5, 9) + SourceIndex(0) +3 >Emitted(6, 10) Source(5, 10) + SourceIndex(0) +4 >Emitted(6, 19) Source(5, 19) + SourceIndex(0) +5 >Emitted(6, 20) Source(5, 20) + SourceIndex(0) --- >>> return 0; 1 >^^^^^^^^ @@ -89,10 +90,10 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts 2 > return 3 > 0 4 > ; -1 >Emitted(6, 9) Source(6, 3) + SourceIndex(0) -2 >Emitted(6, 16) Source(6, 10) + SourceIndex(0) -3 >Emitted(6, 17) Source(6, 11) + SourceIndex(0) -4 >Emitted(6, 18) Source(6, 12) + SourceIndex(0) +1 >Emitted(7, 9) Source(6, 3) + SourceIndex(0) +2 >Emitted(7, 16) Source(6, 10) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 11) + SourceIndex(0) +4 >Emitted(7, 18) Source(6, 12) + SourceIndex(0) --- >>> } 1 >^^^^ @@ -100,8 +101,8 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts 1 > > 2 > } -1 >Emitted(7, 5) Source(7, 2) + SourceIndex(0) -2 >Emitted(7, 6) Source(7, 3) + SourceIndex(0) +1 >Emitted(8, 5) Source(7, 2) + SourceIndex(0) +2 >Emitted(8, 6) Source(7, 3) + SourceIndex(0) --- >>>}; 1 >^ @@ -110,7 +111,7 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts 1 > >} 2 > -1 >Emitted(8, 2) Source(8, 2) + SourceIndex(0) -2 >Emitted(8, 3) Source(8, 2) + SourceIndex(0) +1 >Emitted(9, 2) Source(8, 2) + SourceIndex(0) +2 >Emitted(9, 3) Source(8, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=computedPropertyNamesSourceMap2_ES5.js.map \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5(target=es5).js b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5(target=es5).js index 17e87c67eca03..1b511fbfa4c00 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5(target=es5).js +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5(target=es5).js @@ -11,6 +11,7 @@ var v = { } //// [computedPropertyNamesSourceMap2_ES5.js] +"use strict"; var _a; var v = (_a = {}, _a["hello"] = function () { diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5(target=es5).js.map b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5(target=es5).js.map index 1f5268e844fe8..362805d3a8c88 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5(target=es5).js.map +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5(target=es5).js.map @@ -1,3 +1,3 @@ //// [computedPropertyNamesSourceMap2_ES5.js.map] -{"version":3,"file":"computedPropertyNamesSourceMap2_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES5.ts"],"names":[],"mappings":";AAAA,IAAI,CAAC;IACD,GAAC,OAAO,IAAR;QACI,QAAQ,CAAC;IAChB,CAAC;0BACM,aAAW;aAAf;YACF,OAAO,CAAC,CAAC;QACV,CAAC;;;;OACD,CAAA"} -//// https://sokra.github.io/source-map-visualization#base64,dmFyIF9hOw0KdmFyIHYgPSAoX2EgPSB7fSwNCiAgICBfYVsiaGVsbG8iXSA9IGZ1bmN0aW9uICgpIHsNCiAgICAgICAgZGVidWdnZXI7DQogICAgfSwNCiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoX2EsICJnb29kYnllIiwgew0KICAgICAgICBnZXQ6IGZ1bmN0aW9uICgpIHsNCiAgICAgICAgICAgIHJldHVybiAwOw0KICAgICAgICB9LA0KICAgICAgICBlbnVtZXJhYmxlOiBmYWxzZSwNCiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlDQogICAgfSksDQogICAgX2EpOw0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9Y29tcHV0ZWRQcm9wZXJ0eU5hbWVzU291cmNlTWFwMl9FUzUuanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcHV0ZWRQcm9wZXJ0eU5hbWVzU291cmNlTWFwMl9FUzUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJjb21wdXRlZFByb3BlcnR5TmFtZXNTb3VyY2VNYXAyX0VTNS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsSUFBSSxDQUFDO0lBQ0QsR0FBQyxPQUFPLElBQVI7UUFDSSxRQUFRLENBQUM7SUFDaEIsQ0FBQzswQkFDTSxhQUFXO2FBQWY7WUFDRixPQUFPLENBQUMsQ0FBQztRQUNWLENBQUM7Ozs7T0FDRCxDQUFBIn0=,dmFyIHYgPSB7CiAgICBbImhlbGxvIl0oKSB7CiAgICAgICAgZGVidWdnZXI7Cgl9LAogICAgZ2V0IFsiZ29vZGJ5ZSJdKCkgewoJCXJldHVybiAwOwoJfQp9 +{"version":3,"file":"computedPropertyNamesSourceMap2_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES5.ts"],"names":[],"mappings":";;AAAA,IAAI,CAAC;IACD,GAAC,OAAO,IAAR;QACI,QAAQ,CAAC;IAChB,CAAC;0BACM,aAAW;aAAf;YACF,OAAO,CAAC,CAAC;QACV,CAAC;;;;OACD,CAAA"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KdmFyIF9hOw0KdmFyIHYgPSAoX2EgPSB7fSwNCiAgICBfYVsiaGVsbG8iXSA9IGZ1bmN0aW9uICgpIHsNCiAgICAgICAgZGVidWdnZXI7DQogICAgfSwNCiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoX2EsICJnb29kYnllIiwgew0KICAgICAgICBnZXQ6IGZ1bmN0aW9uICgpIHsNCiAgICAgICAgICAgIHJldHVybiAwOw0KICAgICAgICB9LA0KICAgICAgICBlbnVtZXJhYmxlOiBmYWxzZSwNCiAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlDQogICAgfSksDQogICAgX2EpOw0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9Y29tcHV0ZWRQcm9wZXJ0eU5hbWVzU291cmNlTWFwMl9FUzUuanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcHV0ZWRQcm9wZXJ0eU5hbWVzU291cmNlTWFwMl9FUzUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJjb21wdXRlZFByb3BlcnR5TmFtZXNTb3VyY2VNYXAyX0VTNS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLElBQUksQ0FBQztJQUNELEdBQUMsT0FBTyxJQUFSO1FBQ0ksUUFBUSxDQUFDO0lBQ2hCLENBQUM7MEJBQ00sYUFBVzthQUFmO1lBQ0YsT0FBTyxDQUFDLENBQUM7UUFDVixDQUFDOzs7O09BQ0QsQ0FBQSJ9,dmFyIHYgPSB7CiAgICBbImhlbGxvIl0oKSB7CiAgICAgICAgZGVidWdnZXI7Cgl9LAogICAgZ2V0IFsiZ29vZGJ5ZSJdKCkgewoJCXJldHVybiAwOwoJfQp9 diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5(target=es5).sourcemap.txt b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5(target=es5).sourcemap.txt index acc372dd2b671..d89df76a5f691 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5(target=es5).sourcemap.txt +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5(target=es5).sourcemap.txt @@ -8,6 +8,7 @@ sources: computedPropertyNamesSourceMap2_ES5.ts emittedFile:computedPropertyNamesSourceMap2_ES5.js sourceFile:computedPropertyNamesSourceMap2_ES5.ts ------------------------------------------------------------------- +>>>"use strict"; >>>var _a; >>>var v = (_a = {}, 1 > @@ -17,9 +18,9 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts 1 > 2 >var 3 > v -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(2, 6) Source(1, 6) + SourceIndex(0) +1 >Emitted(3, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(3, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(3, 6) Source(1, 6) + SourceIndex(0) --- >>> _a["hello"] = function () { 1->^^^^ @@ -31,10 +32,10 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts 2 > [ 3 > "hello" 4 > -1->Emitted(3, 5) Source(2, 5) + SourceIndex(0) -2 >Emitted(3, 8) Source(2, 6) + SourceIndex(0) -3 >Emitted(3, 15) Source(2, 13) + SourceIndex(0) -4 >Emitted(3, 19) Source(2, 5) + SourceIndex(0) +1->Emitted(4, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(4, 8) Source(2, 6) + SourceIndex(0) +3 >Emitted(4, 15) Source(2, 13) + SourceIndex(0) +4 >Emitted(4, 19) Source(2, 5) + SourceIndex(0) --- >>> debugger; 1 >^^^^^^^^ @@ -44,9 +45,9 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts > 2 > debugger 3 > ; -1 >Emitted(4, 9) Source(3, 9) + SourceIndex(0) -2 >Emitted(4, 17) Source(3, 17) + SourceIndex(0) -3 >Emitted(4, 18) Source(3, 18) + SourceIndex(0) +1 >Emitted(5, 9) Source(3, 9) + SourceIndex(0) +2 >Emitted(5, 17) Source(3, 17) + SourceIndex(0) +3 >Emitted(5, 18) Source(3, 18) + SourceIndex(0) --- >>> }, 1 >^^^^ @@ -55,8 +56,8 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts 1 > > 2 > } -1 >Emitted(5, 5) Source(4, 2) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 3) + SourceIndex(0) +1 >Emitted(6, 5) Source(4, 2) + SourceIndex(0) +2 >Emitted(6, 6) Source(4, 3) + SourceIndex(0) --- >>> Object.defineProperty(_a, "goodbye", { 1->^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -64,14 +65,14 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts 1->, > get 2 > ["goodbye"] -1->Emitted(6, 27) Source(5, 9) + SourceIndex(0) -2 >Emitted(6, 40) Source(5, 20) + SourceIndex(0) +1->Emitted(7, 27) Source(5, 9) + SourceIndex(0) +2 >Emitted(7, 40) Source(5, 20) + SourceIndex(0) --- >>> get: function () { 1 >^^^^^^^^^^^^^ 2 > ^^^^^^^^^-> 1 > -1 >Emitted(7, 14) Source(5, 5) + SourceIndex(0) +1 >Emitted(8, 14) Source(5, 5) + SourceIndex(0) --- >>> return 0; 1->^^^^^^^^^^^^ @@ -83,10 +84,10 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts 2 > return 3 > 0 4 > ; -1->Emitted(8, 13) Source(6, 3) + SourceIndex(0) -2 >Emitted(8, 20) Source(6, 10) + SourceIndex(0) -3 >Emitted(8, 21) Source(6, 11) + SourceIndex(0) -4 >Emitted(8, 22) Source(6, 12) + SourceIndex(0) +1->Emitted(9, 13) Source(6, 3) + SourceIndex(0) +2 >Emitted(9, 20) Source(6, 10) + SourceIndex(0) +3 >Emitted(9, 21) Source(6, 11) + SourceIndex(0) +4 >Emitted(9, 22) Source(6, 12) + SourceIndex(0) --- >>> }, 1 >^^^^^^^^ @@ -95,8 +96,8 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts 1 > > 2 > } -1 >Emitted(9, 9) Source(7, 2) + SourceIndex(0) -2 >Emitted(9, 10) Source(7, 3) + SourceIndex(0) +1 >Emitted(10, 9) Source(7, 2) + SourceIndex(0) +2 >Emitted(10, 10) Source(7, 3) + SourceIndex(0) --- >>> enumerable: false, >>> configurable: true @@ -108,7 +109,7 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts 1-> >} 2 > -1->Emitted(13, 8) Source(8, 2) + SourceIndex(0) -2 >Emitted(13, 9) Source(8, 2) + SourceIndex(0) +1->Emitted(14, 8) Source(8, 2) + SourceIndex(0) +2 >Emitted(14, 9) Source(8, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=computedPropertyNamesSourceMap2_ES5.js.map \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.js b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.js index 52a3db29a81e5..ff95ed9381ede 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.js +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.js @@ -11,6 +11,7 @@ var v = { } //// [computedPropertyNamesSourceMap2_ES6.js] +"use strict"; var v = { ["hello"]() { debugger; diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.js.map b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.js.map index 862c36e1b5caa..9139e7ca72987 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.js.map +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.js.map @@ -1,3 +1,3 @@ //// [computedPropertyNamesSourceMap2_ES6.js.map] -{"version":3,"file":"computedPropertyNamesSourceMap2_ES6.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES6.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG;IACJ,CAAC,OAAO,CAAC;QACL,QAAQ,CAAC;IAChB,CAAC;IACD,IAAI,CAAC,SAAS,CAAC;QACd,OAAO,CAAC,CAAC;IACV,CAAC;CACD,CAAA"} -//// https://sokra.github.io/source-map-visualization#base64,dmFyIHYgPSB7DQogICAgWyJoZWxsbyJdKCkgew0KICAgICAgICBkZWJ1Z2dlcjsNCiAgICB9LA0KICAgIGdldCBbImdvb2RieWUiXSgpIHsNCiAgICAgICAgcmV0dXJuIDA7DQogICAgfQ0KfTsNCi8vIyBzb3VyY2VNYXBwaW5nVVJMPWNvbXB1dGVkUHJvcGVydHlOYW1lc1NvdXJjZU1hcDJfRVM2LmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcHV0ZWRQcm9wZXJ0eU5hbWVzU291cmNlTWFwMl9FUzYuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJjb21wdXRlZFByb3BlcnR5TmFtZXNTb3VyY2VNYXAyX0VTNi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxJQUFJLENBQUMsR0FBRztJQUNKLENBQUMsT0FBTyxDQUFDO1FBQ0wsUUFBUSxDQUFDO0lBQ2hCLENBQUM7SUFDRCxJQUFJLENBQUMsU0FBUyxDQUFDO1FBQ2QsT0FBTyxDQUFDLENBQUM7SUFDVixDQUFDO0NBQ0QsQ0FBQSJ9,dmFyIHYgPSB7CiAgICBbImhlbGxvIl0oKSB7CiAgICAgICAgZGVidWdnZXI7Cgl9LAoJZ2V0IFsiZ29vZGJ5ZSJdKCkgewoJCXJldHVybiAwOwoJfQp9 +{"version":3,"file":"computedPropertyNamesSourceMap2_ES6.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES6.ts"],"names":[],"mappings":";AAAA,IAAI,CAAC,GAAG;IACJ,CAAC,OAAO,CAAC;QACL,QAAQ,CAAC;IAChB,CAAC;IACD,IAAI,CAAC,SAAS,CAAC;QACd,OAAO,CAAC,CAAC;IACV,CAAC;CACD,CAAA"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KdmFyIHYgPSB7DQogICAgWyJoZWxsbyJdKCkgew0KICAgICAgICBkZWJ1Z2dlcjsNCiAgICB9LA0KICAgIGdldCBbImdvb2RieWUiXSgpIHsNCiAgICAgICAgcmV0dXJuIDA7DQogICAgfQ0KfTsNCi8vIyBzb3VyY2VNYXBwaW5nVVJMPWNvbXB1dGVkUHJvcGVydHlOYW1lc1NvdXJjZU1hcDJfRVM2LmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcHV0ZWRQcm9wZXJ0eU5hbWVzU291cmNlTWFwMl9FUzYuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJjb21wdXRlZFByb3BlcnR5TmFtZXNTb3VyY2VNYXAyX0VTNi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsSUFBSSxDQUFDLEdBQUc7SUFDSixDQUFDLE9BQU8sQ0FBQztRQUNMLFFBQVEsQ0FBQztJQUNoQixDQUFDO0lBQ0QsSUFBSSxDQUFDLFNBQVMsQ0FBQztRQUNkLE9BQU8sQ0FBQyxDQUFDO0lBQ1YsQ0FBQztDQUNELENBQUEifQ==,dmFyIHYgPSB7CiAgICBbImhlbGxvIl0oKSB7CiAgICAgICAgZGVidWdnZXI7Cgl9LAoJZ2V0IFsiZ29vZGJ5ZSJdKCkgewoJCXJldHVybiAwOwoJfQp9 diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.sourcemap.txt b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.sourcemap.txt index f16a328f6c1f1..cdf2034a85f33 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.sourcemap.txt +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.sourcemap.txt @@ -8,6 +8,7 @@ sources: computedPropertyNamesSourceMap2_ES6.ts emittedFile:computedPropertyNamesSourceMap2_ES6.js sourceFile:computedPropertyNamesSourceMap2_ES6.ts ------------------------------------------------------------------- +>>>"use strict"; >>>var v = { 1 > 2 >^^^^ @@ -18,10 +19,10 @@ sourceFile:computedPropertyNamesSourceMap2_ES6.ts 2 >var 3 > v 4 > = -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) -4 >Emitted(1, 9) Source(1, 9) + SourceIndex(0) +1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 5) Source(1, 5) + SourceIndex(0) +3 >Emitted(2, 6) Source(1, 6) + SourceIndex(0) +4 >Emitted(2, 9) Source(1, 9) + SourceIndex(0) --- >>> ["hello"]() { 1->^^^^ @@ -34,10 +35,10 @@ sourceFile:computedPropertyNamesSourceMap2_ES6.ts 2 > [ 3 > "hello" 4 > ] -1->Emitted(2, 5) Source(2, 5) + SourceIndex(0) -2 >Emitted(2, 6) Source(2, 6) + SourceIndex(0) -3 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) -4 >Emitted(2, 14) Source(2, 14) + SourceIndex(0) +1->Emitted(3, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(3, 6) Source(2, 6) + SourceIndex(0) +3 >Emitted(3, 13) Source(2, 13) + SourceIndex(0) +4 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) --- >>> debugger; 1->^^^^^^^^ @@ -47,9 +48,9 @@ sourceFile:computedPropertyNamesSourceMap2_ES6.ts > 2 > debugger 3 > ; -1->Emitted(3, 9) Source(3, 9) + SourceIndex(0) -2 >Emitted(3, 17) Source(3, 17) + SourceIndex(0) -3 >Emitted(3, 18) Source(3, 18) + SourceIndex(0) +1->Emitted(4, 9) Source(3, 9) + SourceIndex(0) +2 >Emitted(4, 17) Source(3, 17) + SourceIndex(0) +3 >Emitted(4, 18) Source(3, 18) + SourceIndex(0) --- >>> }, 1 >^^^^ @@ -58,8 +59,8 @@ sourceFile:computedPropertyNamesSourceMap2_ES6.ts 1 > > 2 > } -1 >Emitted(4, 5) Source(4, 2) + SourceIndex(0) -2 >Emitted(4, 6) Source(4, 3) + SourceIndex(0) +1 >Emitted(5, 5) Source(4, 2) + SourceIndex(0) +2 >Emitted(5, 6) Source(4, 3) + SourceIndex(0) --- >>> get ["goodbye"]() { 1->^^^^ @@ -73,11 +74,11 @@ sourceFile:computedPropertyNamesSourceMap2_ES6.ts 3 > [ 4 > "goodbye" 5 > ] -1->Emitted(5, 5) Source(5, 2) + SourceIndex(0) -2 >Emitted(5, 9) Source(5, 6) + SourceIndex(0) -3 >Emitted(5, 10) Source(5, 7) + SourceIndex(0) -4 >Emitted(5, 19) Source(5, 16) + SourceIndex(0) -5 >Emitted(5, 20) Source(5, 17) + SourceIndex(0) +1->Emitted(6, 5) Source(5, 2) + SourceIndex(0) +2 >Emitted(6, 9) Source(5, 6) + SourceIndex(0) +3 >Emitted(6, 10) Source(5, 7) + SourceIndex(0) +4 >Emitted(6, 19) Source(5, 16) + SourceIndex(0) +5 >Emitted(6, 20) Source(5, 17) + SourceIndex(0) --- >>> return 0; 1 >^^^^^^^^ @@ -89,10 +90,10 @@ sourceFile:computedPropertyNamesSourceMap2_ES6.ts 2 > return 3 > 0 4 > ; -1 >Emitted(6, 9) Source(6, 3) + SourceIndex(0) -2 >Emitted(6, 16) Source(6, 10) + SourceIndex(0) -3 >Emitted(6, 17) Source(6, 11) + SourceIndex(0) -4 >Emitted(6, 18) Source(6, 12) + SourceIndex(0) +1 >Emitted(7, 9) Source(6, 3) + SourceIndex(0) +2 >Emitted(7, 16) Source(6, 10) + SourceIndex(0) +3 >Emitted(7, 17) Source(6, 11) + SourceIndex(0) +4 >Emitted(7, 18) Source(6, 12) + SourceIndex(0) --- >>> } 1 >^^^^ @@ -100,8 +101,8 @@ sourceFile:computedPropertyNamesSourceMap2_ES6.ts 1 > > 2 > } -1 >Emitted(7, 5) Source(7, 2) + SourceIndex(0) -2 >Emitted(7, 6) Source(7, 3) + SourceIndex(0) +1 >Emitted(8, 5) Source(7, 2) + SourceIndex(0) +2 >Emitted(8, 6) Source(7, 3) + SourceIndex(0) --- >>>}; 1 >^ @@ -110,7 +111,7 @@ sourceFile:computedPropertyNamesSourceMap2_ES6.ts 1 > >} 2 > -1 >Emitted(8, 2) Source(8, 2) + SourceIndex(0) -2 >Emitted(8, 3) Source(8, 2) + SourceIndex(0) +1 >Emitted(9, 2) Source(8, 2) + SourceIndex(0) +2 >Emitted(9, 3) Source(8, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=computedPropertyNamesSourceMap2_ES6.js.map \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesWithStaticProperty.js b/tests/baselines/reference/computedPropertyNamesWithStaticProperty.js index 63068159d9039..9b168318299b8 100644 --- a/tests/baselines/reference/computedPropertyNamesWithStaticProperty.js +++ b/tests/baselines/reference/computedPropertyNamesWithStaticProperty.js @@ -25,6 +25,7 @@ class C1 { //// [computedPropertyNamesWithStaticProperty.js] +"use strict"; var _a; class C1 { get [C1.staticProp]() { diff --git a/tests/baselines/reference/computedTypesKeyofNoIndexSignatureType.js b/tests/baselines/reference/computedTypesKeyofNoIndexSignatureType.js index cd3a70a999e07..0bfa521a807df 100644 --- a/tests/baselines/reference/computedTypesKeyofNoIndexSignatureType.js +++ b/tests/baselines/reference/computedTypesKeyofNoIndexSignatureType.js @@ -23,3 +23,4 @@ type WithIndexKey = keyof WithIndex; // string | number <-- Expected: stri type WithoutIndexKey = keyof WithoutIndex; // number <-- Expected: "foo" | "bar" //// [computedTypesKeyofNoIndexSignatureType.js] +"use strict"; diff --git a/tests/baselines/reference/computerPropertiesInES5ShouldBeTransformed(target=es2015).js b/tests/baselines/reference/computerPropertiesInES5ShouldBeTransformed(target=es2015).js index c595aa7eab959..6f964ca86ea51 100644 --- a/tests/baselines/reference/computerPropertiesInES5ShouldBeTransformed(target=es2015).js +++ b/tests/baselines/reference/computerPropertiesInES5ShouldBeTransformed(target=es2015).js @@ -4,4 +4,5 @@ const b = ({ [`key`]: renamed }) => renamed; //// [computerPropertiesInES5ShouldBeTransformed.js] +"use strict"; const b = ({ [`key`]: renamed }) => renamed; diff --git a/tests/baselines/reference/computerPropertiesInES5ShouldBeTransformed(target=es5).js b/tests/baselines/reference/computerPropertiesInES5ShouldBeTransformed(target=es5).js index 5de7313f00b1b..5c9d680aa9dd5 100644 --- a/tests/baselines/reference/computerPropertiesInES5ShouldBeTransformed(target=es5).js +++ b/tests/baselines/reference/computerPropertiesInES5ShouldBeTransformed(target=es5).js @@ -4,6 +4,7 @@ const b = ({ [`key`]: renamed }) => renamed; //// [computerPropertiesInES5ShouldBeTransformed.js] +"use strict"; var b = function (_a) { var _b = "key", renamed = _a[_b]; return renamed; diff --git a/tests/baselines/reference/concatClassAndString.js b/tests/baselines/reference/concatClassAndString.js index 0c4dd1bf1df24..9920304ed78d1 100644 --- a/tests/baselines/reference/concatClassAndString.js +++ b/tests/baselines/reference/concatClassAndString.js @@ -8,6 +8,7 @@ f += ''; //// [concatClassAndString.js] +"use strict"; // Shouldn't compile (the long form f = f + ""; doesn't): class f { } diff --git a/tests/baselines/reference/concatError.errors.txt b/tests/baselines/reference/concatError.errors.txt new file mode 100644 index 0000000000000..5b64721a9e35b --- /dev/null +++ b/tests/baselines/reference/concatError.errors.txt @@ -0,0 +1,37 @@ +concatError.ts(10,6): error TS2454: Variable 'fa' is used before being assigned. + + +==== concatError.ts (1 errors) ==== + var n1: number[]; + /* + 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 = fa.concat([0]); + ~~ +!!! error TS2454: Variable 'fa' is used before being assigned. + fa = fa.concat(0); + + + + + + /* + + + + + declare class C { + public m(p1: C>): C; + //public p: T; + } + + var c: C; + var cc: C>; + + c = c.m(cc); + */ \ No newline at end of file diff --git a/tests/baselines/reference/concatError.js b/tests/baselines/reference/concatError.js index 45a21a0fd77b5..59122be07b80e 100644 --- a/tests/baselines/reference/concatError.js +++ b/tests/baselines/reference/concatError.js @@ -34,6 +34,7 @@ c = c.m(cc); */ //// [concatError.js] +"use strict"; var n1; /* interface Array { diff --git a/tests/baselines/reference/concatTuples.js b/tests/baselines/reference/concatTuples.js index 14b4782269446..6cf130edc9b76 100644 --- a/tests/baselines/reference/concatTuples.js +++ b/tests/baselines/reference/concatTuples.js @@ -6,5 +6,6 @@ ijs = ijs.concat([[3, 4], [5, 6]]); //// [concatTuples.js] +"use strict"; let ijs = [[1, 2]]; ijs = ijs.concat([[3, 4], [5, 6]]); diff --git a/tests/baselines/reference/conditionalAnyCheckTypePicksBothBranches.js b/tests/baselines/reference/conditionalAnyCheckTypePicksBothBranches.js index 63f3e58569866..d5a725fab7279 100644 --- a/tests/baselines/reference/conditionalAnyCheckTypePicksBothBranches.js +++ b/tests/baselines/reference/conditionalAnyCheckTypePicksBothBranches.js @@ -12,6 +12,7 @@ y = 1; y = 0; // error //// [conditionalAnyCheckTypePicksBothBranches.js] +"use strict"; let x; x = 1; x = 0; // not an error diff --git a/tests/baselines/reference/conditionalDoesntLeakUninstantiatedTypeParameter.js b/tests/baselines/reference/conditionalDoesntLeakUninstantiatedTypeParameter.js index dbd274bfcc45e..abdd5cc3b685b 100644 --- a/tests/baselines/reference/conditionalDoesntLeakUninstantiatedTypeParameter.js +++ b/tests/baselines/reference/conditionalDoesntLeakUninstantiatedTypeParameter.js @@ -11,5 +11,6 @@ const z: TestSynthetic = '3'; // Type '"3""' is not assignable to type 'T'. (sho //// [conditionalDoesntLeakUninstantiatedTypeParameter.js] +"use strict"; const y = 3; // Type '3' is not assignable to type 'T'. (shouldn't error) const z = '3'; // Type '"3""' is not assignable to type 'T'. (should not mention T) diff --git a/tests/baselines/reference/conditionalEqualityOnLiteralObjects.js b/tests/baselines/reference/conditionalEqualityOnLiteralObjects.js index a0da234aaf76f..142d766d7764b 100644 --- a/tests/baselines/reference/conditionalEqualityOnLiteralObjects.js +++ b/tests/baselines/reference/conditionalEqualityOnLiteralObjects.js @@ -58,6 +58,7 @@ if ([1] != b) { //// [conditionalEqualityOnLiteralObjects.js] +"use strict"; const a = { a: 1 }; const b = [1]; if ({ a: 1 } === { a: 1 }) { diff --git a/tests/baselines/reference/conditionalExpression1.js b/tests/baselines/reference/conditionalExpression1.js index 1a55dd0372edd..88723ce6df89a 100644 --- a/tests/baselines/reference/conditionalExpression1.js +++ b/tests/baselines/reference/conditionalExpression1.js @@ -4,4 +4,5 @@ var x: boolean = (true ? 1 : ""); // should be an error //// [conditionalExpression1.js] +"use strict"; var x = (true ? 1 : ""); // should be an error diff --git a/tests/baselines/reference/conditionalExpressionNewLine1.js b/tests/baselines/reference/conditionalExpressionNewLine1.js index d042dd4cbca69..fbb058cf6bbe6 100644 --- a/tests/baselines/reference/conditionalExpressionNewLine1.js +++ b/tests/baselines/reference/conditionalExpressionNewLine1.js @@ -4,4 +4,5 @@ var v = a ? b : c; //// [conditionalExpressionNewLine1.js] +"use strict"; var v = a ? b : c; diff --git a/tests/baselines/reference/conditionalExpressionNewLine10.js b/tests/baselines/reference/conditionalExpressionNewLine10.js index a433164b082ef..72b56e9b240a7 100644 --- a/tests/baselines/reference/conditionalExpressionNewLine10.js +++ b/tests/baselines/reference/conditionalExpressionNewLine10.js @@ -10,6 +10,7 @@ var v = a : g; //// [conditionalExpressionNewLine10.js] +"use strict"; var v = a ? b ? d diff --git a/tests/baselines/reference/conditionalExpressionNewLine2.js b/tests/baselines/reference/conditionalExpressionNewLine2.js index 3ccacaa68e514..471f919759f85 100644 --- a/tests/baselines/reference/conditionalExpressionNewLine2.js +++ b/tests/baselines/reference/conditionalExpressionNewLine2.js @@ -5,5 +5,6 @@ var v = a ? b : c; //// [conditionalExpressionNewLine2.js] +"use strict"; var v = a ? b : c; diff --git a/tests/baselines/reference/conditionalExpressionNewLine3.js b/tests/baselines/reference/conditionalExpressionNewLine3.js index 36b125a612851..a958e1528f7af 100644 --- a/tests/baselines/reference/conditionalExpressionNewLine3.js +++ b/tests/baselines/reference/conditionalExpressionNewLine3.js @@ -5,5 +5,6 @@ var v = a ? b : c; //// [conditionalExpressionNewLine3.js] +"use strict"; var v = a ? b : c; diff --git a/tests/baselines/reference/conditionalExpressionNewLine4.js b/tests/baselines/reference/conditionalExpressionNewLine4.js index ce81225b5ae0a..ab29ef232e6ef 100644 --- a/tests/baselines/reference/conditionalExpressionNewLine4.js +++ b/tests/baselines/reference/conditionalExpressionNewLine4.js @@ -5,5 +5,6 @@ var v = a ? b : c; //// [conditionalExpressionNewLine4.js] +"use strict"; var v = a ? b : c; diff --git a/tests/baselines/reference/conditionalExpressionNewLine5.js b/tests/baselines/reference/conditionalExpressionNewLine5.js index 833a2f3ea9b8a..e7870e518e704 100644 --- a/tests/baselines/reference/conditionalExpressionNewLine5.js +++ b/tests/baselines/reference/conditionalExpressionNewLine5.js @@ -5,5 +5,6 @@ var v = a ? b : c; //// [conditionalExpressionNewLine5.js] +"use strict"; var v = a ? b : c; diff --git a/tests/baselines/reference/conditionalExpressionNewLine6.js b/tests/baselines/reference/conditionalExpressionNewLine6.js index c451af15fefcc..a93c10511cceb 100644 --- a/tests/baselines/reference/conditionalExpressionNewLine6.js +++ b/tests/baselines/reference/conditionalExpressionNewLine6.js @@ -6,6 +6,7 @@ var v = a : c; //// [conditionalExpressionNewLine6.js] +"use strict"; var v = a ? b : c; diff --git a/tests/baselines/reference/conditionalExpressionNewLine7.js b/tests/baselines/reference/conditionalExpressionNewLine7.js index b84f5466ac730..d5878e47f40ed 100644 --- a/tests/baselines/reference/conditionalExpressionNewLine7.js +++ b/tests/baselines/reference/conditionalExpressionNewLine7.js @@ -6,6 +6,7 @@ var v = a ? c; //// [conditionalExpressionNewLine7.js] +"use strict"; var v = a ? b : c; diff --git a/tests/baselines/reference/conditionalExpressionNewLine8.js b/tests/baselines/reference/conditionalExpressionNewLine8.js index 97ee2efcf912f..6e2bf7dfe1abd 100644 --- a/tests/baselines/reference/conditionalExpressionNewLine8.js +++ b/tests/baselines/reference/conditionalExpressionNewLine8.js @@ -6,6 +6,7 @@ var v = a : c ? f : g; //// [conditionalExpressionNewLine8.js] +"use strict"; var v = a ? b ? d : e : c ? f : g; diff --git a/tests/baselines/reference/conditionalExpressionNewLine9.js b/tests/baselines/reference/conditionalExpressionNewLine9.js index 36d120bc50bcd..81049b3593115 100644 --- a/tests/baselines/reference/conditionalExpressionNewLine9.js +++ b/tests/baselines/reference/conditionalExpressionNewLine9.js @@ -8,6 +8,7 @@ var v = a ? f : g; //// [conditionalExpressionNewLine9.js] +"use strict"; var v = a ? b ? d : e diff --git a/tests/baselines/reference/conditionalExpressions2.js b/tests/baselines/reference/conditionalExpressions2.js index 6bc156d2d2958..4613366f2c46c 100644 --- a/tests/baselines/reference/conditionalExpressions2.js +++ b/tests/baselines/reference/conditionalExpressions2.js @@ -12,6 +12,7 @@ var h = [{h:5}, null]; function i() { if (true) { return { x: 5 }; } else { return null; } } //// [conditionalExpressions2.js] +"use strict"; var a = false ? 1 : null; var b = false ? undefined : 0; var c = false ? 1 : 0; diff --git a/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.errors.txt b/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.errors.txt new file mode 100644 index 0000000000000..2f7a225dd93d8 --- /dev/null +++ b/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.errors.txt @@ -0,0 +1,248 @@ +conditionalOperatorConditionIsBooleanType.ts(17,1): error TS2454: Variable 'condBoolean' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(18,1): error TS2454: Variable 'condBoolean' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(18,15): error TS2454: Variable 'exprBoolean1' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(18,30): error TS2454: Variable 'exprBoolean2' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(19,1): error TS2454: Variable 'condBoolean' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(19,15): error TS2454: Variable 'exprNumber1' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(19,29): error TS2454: Variable 'exprNumber2' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(20,1): error TS2454: Variable 'condBoolean' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(20,15): error TS2454: Variable 'exprString1' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(20,29): error TS2454: Variable 'exprString2' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(21,1): error TS2454: Variable 'condBoolean' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(21,15): error TS2454: Variable 'exprIsObject1' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(21,31): error TS2454: Variable 'exprIsObject2' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(22,1): error TS2454: Variable 'condBoolean' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(22,15): error TS2454: Variable 'exprString1' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(22,29): error TS2454: Variable 'exprBoolean1' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(26,24): error TS2454: Variable 'exprBoolean2' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(27,8): error TS2454: Variable 'exprNumber1' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(28,23): error TS2454: Variable 'exprString2' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(29,8): error TS2454: Variable 'exprIsObject1' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(30,8): error TS2454: Variable 'exprString1' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(34,28): error TS2454: Variable 'exprBoolean1' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(34,43): error TS2454: Variable 'exprBoolean2' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(35,9): error TS2454: Variable 'exprNumber1' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(35,23): error TS2454: Variable 'exprNumber2' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(36,22): error TS2454: Variable 'exprString1' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(36,36): error TS2454: Variable 'exprString2' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(37,17): error TS2454: Variable 'exprIsObject1' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(38,22): error TS2454: Variable 'exprString1' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(38,36): error TS2454: Variable 'exprBoolean1' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(41,20): error TS2454: Variable 'condBoolean' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(42,24): error TS2454: Variable 'condBoolean' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(42,38): error TS2454: Variable 'exprBoolean1' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(42,53): error TS2454: Variable 'exprBoolean2' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(43,23): error TS2454: Variable 'condBoolean' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(43,37): error TS2454: Variable 'exprNumber1' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(43,51): error TS2454: Variable 'exprNumber2' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(44,23): error TS2454: Variable 'condBoolean' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(44,37): error TS2454: Variable 'exprString1' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(44,51): error TS2454: Variable 'exprString2' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(45,23): error TS2454: Variable 'condBoolean' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(45,37): error TS2454: Variable 'exprIsObject1' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(45,53): error TS2454: Variable 'exprIsObject2' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(46,32): error TS2454: Variable 'condBoolean' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(46,46): error TS2454: Variable 'exprString1' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(46,60): error TS2454: Variable 'exprBoolean1' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(49,47): error TS2454: Variable 'exprBoolean2' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(50,30): error TS2454: Variable 'exprNumber1' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(51,45): error TS2454: Variable 'exprString2' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(52,30): error TS2454: Variable 'exprIsObject1' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(53,39): error TS2454: Variable 'exprString1' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(54,54): error TS2454: Variable 'exprBoolean1' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(57,51): error TS2454: Variable 'exprBoolean1' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(57,66): error TS2454: Variable 'exprBoolean2' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(58,31): error TS2454: Variable 'exprNumber1' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(58,45): error TS2454: Variable 'exprNumber2' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(59,44): error TS2454: Variable 'exprString1' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(59,58): error TS2454: Variable 'exprString2' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(60,39): error TS2454: Variable 'exprIsObject1' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(61,60): error TS2454: Variable 'exprString1' is used before being assigned. +conditionalOperatorConditionIsBooleanType.ts(61,74): error TS2454: Variable 'exprBoolean1' is used before being assigned. + + +==== conditionalOperatorConditionIsBooleanType.ts (61 errors) ==== + //Cond ? Expr1 : Expr2, Cond is of boolean type, Expr1 and Expr2 have the same type + var condBoolean: boolean; + + var exprAny1: any; + var exprBoolean1: boolean; + var exprNumber1: number; + var exprString1: string; + var exprIsObject1: Object; + + var exprAny2: any; + var exprBoolean2: boolean; + var exprNumber2: number; + var exprString2: string; + var exprIsObject2: Object; + + //Cond is a boolean type variable + condBoolean ? exprAny1 : exprAny2; + ~~~~~~~~~~~ +!!! error TS2454: Variable 'condBoolean' is used before being assigned. + condBoolean ? exprBoolean1 : exprBoolean2; + ~~~~~~~~~~~ +!!! error TS2454: Variable 'condBoolean' is used before being assigned. + ~~~~~~~~~~~~ +!!! error TS2454: Variable 'exprBoolean1' is used before being assigned. + ~~~~~~~~~~~~ +!!! error TS2454: Variable 'exprBoolean2' is used before being assigned. + condBoolean ? exprNumber1 : exprNumber2; + ~~~~~~~~~~~ +!!! error TS2454: Variable 'condBoolean' is used before being assigned. + ~~~~~~~~~~~ +!!! error TS2454: Variable 'exprNumber1' is used before being assigned. + ~~~~~~~~~~~ +!!! error TS2454: Variable 'exprNumber2' is used before being assigned. + condBoolean ? exprString1 : exprString2; + ~~~~~~~~~~~ +!!! error TS2454: Variable 'condBoolean' is used before being assigned. + ~~~~~~~~~~~ +!!! error TS2454: Variable 'exprString1' is used before being assigned. + ~~~~~~~~~~~ +!!! error TS2454: Variable 'exprString2' is used before being assigned. + condBoolean ? exprIsObject1 : exprIsObject2; + ~~~~~~~~~~~ +!!! error TS2454: Variable 'condBoolean' is used before being assigned. + ~~~~~~~~~~~~~ +!!! error TS2454: Variable 'exprIsObject1' is used before being assigned. + ~~~~~~~~~~~~~ +!!! error TS2454: Variable 'exprIsObject2' is used before being assigned. + condBoolean ? exprString1 : exprBoolean1; // union + ~~~~~~~~~~~ +!!! error TS2454: Variable 'condBoolean' is used before being assigned. + ~~~~~~~~~~~ +!!! error TS2454: Variable 'exprString1' is used before being assigned. + ~~~~~~~~~~~~ +!!! error TS2454: Variable 'exprBoolean1' is used before being assigned. + + //Cond is a boolean type literal + true ? exprAny1 : exprAny2; + false ? exprBoolean1 : exprBoolean2; + ~~~~~~~~~~~~ +!!! error TS2454: Variable 'exprBoolean2' is used before being assigned. + true ? exprNumber1 : exprNumber2; + ~~~~~~~~~~~ +!!! error TS2454: Variable 'exprNumber1' is used before being assigned. + false ? exprString1 : exprString2; + ~~~~~~~~~~~ +!!! error TS2454: Variable 'exprString2' is used before being assigned. + true ? exprIsObject1 : exprIsObject2; + ~~~~~~~~~~~~~ +!!! error TS2454: Variable 'exprIsObject1' is used before being assigned. + true ? exprString1 : exprBoolean1; // union + ~~~~~~~~~~~ +!!! error TS2454: Variable 'exprString1' is used before being assigned. + + //Cond is a boolean type expression + !true ? exprAny1 : exprAny2; + typeof "123" == "string" ? exprBoolean1 : exprBoolean2; + ~~~~~~~~~~~~ +!!! error TS2454: Variable 'exprBoolean1' is used before being assigned. + ~~~~~~~~~~~~ +!!! error TS2454: Variable 'exprBoolean2' is used before being assigned. + 2 > 1 ? exprNumber1 : exprNumber2; + ~~~~~~~~~~~ +!!! error TS2454: Variable 'exprNumber1' is used before being assigned. + ~~~~~~~~~~~ +!!! error TS2454: Variable 'exprNumber2' is used before being assigned. + null === undefined ? exprString1 : exprString2; + ~~~~~~~~~~~ +!!! error TS2454: Variable 'exprString1' is used before being assigned. + ~~~~~~~~~~~ +!!! error TS2454: Variable 'exprString2' is used before being assigned. + true || false ? exprIsObject1 : exprIsObject2; + ~~~~~~~~~~~~~ +!!! error TS2454: Variable 'exprIsObject1' is used before being assigned. + null === undefined ? exprString1 : exprBoolean1; // union + ~~~~~~~~~~~ +!!! error TS2454: Variable 'exprString1' is used before being assigned. + ~~~~~~~~~~~~ +!!! error TS2454: Variable 'exprBoolean1' is used before being assigned. + + //Results shoud be same as Expr1 and Expr2 + var resultIsAny1 = condBoolean ? exprAny1 : exprAny2; + ~~~~~~~~~~~ +!!! error TS2454: Variable 'condBoolean' is used before being assigned. + var resultIsBoolean1 = condBoolean ? exprBoolean1 : exprBoolean2; + ~~~~~~~~~~~ +!!! error TS2454: Variable 'condBoolean' is used before being assigned. + ~~~~~~~~~~~~ +!!! error TS2454: Variable 'exprBoolean1' is used before being assigned. + ~~~~~~~~~~~~ +!!! error TS2454: Variable 'exprBoolean2' is used before being assigned. + var resultIsNumber1 = condBoolean ? exprNumber1 : exprNumber2; + ~~~~~~~~~~~ +!!! error TS2454: Variable 'condBoolean' is used before being assigned. + ~~~~~~~~~~~ +!!! error TS2454: Variable 'exprNumber1' is used before being assigned. + ~~~~~~~~~~~ +!!! error TS2454: Variable 'exprNumber2' is used before being assigned. + var resultIsString1 = condBoolean ? exprString1 : exprString2; + ~~~~~~~~~~~ +!!! error TS2454: Variable 'condBoolean' is used before being assigned. + ~~~~~~~~~~~ +!!! error TS2454: Variable 'exprString1' is used before being assigned. + ~~~~~~~~~~~ +!!! error TS2454: Variable 'exprString2' is used before being assigned. + var resultIsObject1 = condBoolean ? exprIsObject1 : exprIsObject2; + ~~~~~~~~~~~ +!!! error TS2454: Variable 'condBoolean' is used before being assigned. + ~~~~~~~~~~~~~ +!!! error TS2454: Variable 'exprIsObject1' is used before being assigned. + ~~~~~~~~~~~~~ +!!! error TS2454: Variable 'exprIsObject2' is used before being assigned. + var resultIsStringOrBoolean1 = condBoolean ? exprString1 : exprBoolean1; // union + ~~~~~~~~~~~ +!!! error TS2454: Variable 'condBoolean' is used before being assigned. + ~~~~~~~~~~~ +!!! error TS2454: Variable 'exprString1' is used before being assigned. + ~~~~~~~~~~~~ +!!! error TS2454: Variable 'exprBoolean1' is used before being assigned. + + var resultIsAny2 = true ? exprAny1 : exprAny2; + var resultIsBoolean2 = false ? exprBoolean1 : exprBoolean2; + ~~~~~~~~~~~~ +!!! error TS2454: Variable 'exprBoolean2' is used before being assigned. + var resultIsNumber2 = true ? exprNumber1 : exprNumber2; + ~~~~~~~~~~~ +!!! error TS2454: Variable 'exprNumber1' is used before being assigned. + var resultIsString2 = false ? exprString1 : exprString2; + ~~~~~~~~~~~ +!!! error TS2454: Variable 'exprString2' is used before being assigned. + var resultIsObject2 = true ? exprIsObject1 : exprIsObject2; + ~~~~~~~~~~~~~ +!!! error TS2454: Variable 'exprIsObject1' is used before being assigned. + var resultIsStringOrBoolean2 = true ? exprString1 : exprBoolean1; // union + ~~~~~~~~~~~ +!!! error TS2454: Variable 'exprString1' is used before being assigned. + var resultIsStringOrBoolean3 = false ? exprString1 : exprBoolean1; // union + ~~~~~~~~~~~~ +!!! error TS2454: Variable 'exprBoolean1' is used before being assigned. + + var resultIsAny3 = !true ? exprAny1 : exprAny2; + var resultIsBoolean3 = typeof "123" == "string" ? exprBoolean1 : exprBoolean2; + ~~~~~~~~~~~~ +!!! error TS2454: Variable 'exprBoolean1' is used before being assigned. + ~~~~~~~~~~~~ +!!! error TS2454: Variable 'exprBoolean2' is used before being assigned. + var resultIsNumber3 = 2 > 1 ? exprNumber1 : exprNumber2; + ~~~~~~~~~~~ +!!! error TS2454: Variable 'exprNumber1' is used before being assigned. + ~~~~~~~~~~~ +!!! error TS2454: Variable 'exprNumber2' is used before being assigned. + var resultIsString3 = null === undefined ? exprString1 : exprString2; + ~~~~~~~~~~~ +!!! error TS2454: Variable 'exprString1' is used before being assigned. + ~~~~~~~~~~~ +!!! error TS2454: Variable 'exprString2' is used before being assigned. + var resultIsObject3 = true || false ? exprIsObject1 : exprIsObject2; + ~~~~~~~~~~~~~ +!!! error TS2454: Variable 'exprIsObject1' is used before being assigned. + var resultIsStringOrBoolean4 = typeof "123" === "string" ? exprString1 : exprBoolean1; // union + ~~~~~~~~~~~ +!!! error TS2454: Variable 'exprString1' is used before being assigned. + ~~~~~~~~~~~~ +!!! error TS2454: Variable 'exprBoolean1' is used before being assigned. + \ No newline at end of file diff --git a/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.js b/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.js index 88c135aa412f3..a1dde6622ef1a 100644 --- a/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.js +++ b/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.js @@ -65,6 +65,7 @@ var resultIsStringOrBoolean4 = typeof "123" === "string" ? exprString1 : exprBoo //// [conditionalOperatorConditionIsBooleanType.js] +"use strict"; //Cond ? Expr1 : Expr2, Cond is of boolean type, Expr1 and Expr2 have the same type var condBoolean; var exprAny1; diff --git a/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.types b/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.types index 627e36adfe15a..87303a5f548ed 100644 --- a/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.types +++ b/tests/baselines/reference/conditionalOperatorConditionIsBooleanType.types @@ -8,6 +8,7 @@ var condBoolean: boolean; var exprAny1: any; >exprAny1 : any +> : ^^^ var exprBoolean1: boolean; >exprBoolean1 : boolean @@ -27,6 +28,7 @@ var exprIsObject1: Object; var exprAny2: any; >exprAny2 : any +> : ^^^ var exprBoolean2: boolean; >exprBoolean2 : boolean @@ -47,10 +49,13 @@ var exprIsObject2: Object; //Cond is a boolean type variable condBoolean ? exprAny1 : exprAny2; >condBoolean ? exprAny1 : exprAny2 : any +> : ^^^ >condBoolean : boolean > : ^^^^^^^ >exprAny1 : any +> : ^^^ >exprAny2 : any +> : ^^^ condBoolean ? exprBoolean1 : exprBoolean2; >condBoolean ? exprBoolean1 : exprBoolean2 : boolean @@ -105,10 +110,13 @@ condBoolean ? exprString1 : exprBoolean1; // union //Cond is a boolean type literal true ? exprAny1 : exprAny2; >true ? exprAny1 : exprAny2 : any +> : ^^^ >true : true > : ^^^^ >exprAny1 : any +> : ^^^ >exprAny2 : any +> : ^^^ false ? exprBoolean1 : exprBoolean2; >false ? exprBoolean1 : exprBoolean2 : boolean @@ -163,12 +171,15 @@ true ? exprString1 : exprBoolean1; // union //Cond is a boolean type expression !true ? exprAny1 : exprAny2; >!true ? exprAny1 : exprAny2 : any ->!true : boolean -> : ^^^^^^^ +> : ^^^ +>!true : false +> : ^^^^^ >true : true > : ^^^^ >exprAny1 : any +> : ^^^ >exprAny2 : any +> : ^^^ typeof "123" == "string" ? exprBoolean1 : exprBoolean2; >typeof "123" == "string" ? exprBoolean1 : exprBoolean2 : boolean @@ -215,8 +226,8 @@ null === undefined ? exprString1 : exprString2; true || false ? exprIsObject1 : exprIsObject2; >true || false ? exprIsObject1 : exprIsObject2 : Object > : ^^^^^^ ->true || false : boolean -> : ^^^^^^^ +>true || false : true +> : ^^^^ >true : true > : ^^^^ >false : false @@ -241,11 +252,15 @@ null === undefined ? exprString1 : exprBoolean1; // union //Results shoud be same as Expr1 and Expr2 var resultIsAny1 = condBoolean ? exprAny1 : exprAny2; >resultIsAny1 : any +> : ^^^ >condBoolean ? exprAny1 : exprAny2 : any +> : ^^^ >condBoolean : boolean > : ^^^^^^^ >exprAny1 : any +> : ^^^ >exprAny2 : any +> : ^^^ var resultIsBoolean1 = condBoolean ? exprBoolean1 : exprBoolean2; >resultIsBoolean1 : boolean @@ -309,11 +324,15 @@ var resultIsStringOrBoolean1 = condBoolean ? exprString1 : exprBoolean1; // unio var resultIsAny2 = true ? exprAny1 : exprAny2; >resultIsAny2 : any +> : ^^^ >true ? exprAny1 : exprAny2 : any +> : ^^^ >true : true > : ^^^^ >exprAny1 : any +> : ^^^ >exprAny2 : any +> : ^^^ var resultIsBoolean2 = false ? exprBoolean1 : exprBoolean2; >resultIsBoolean2 : boolean @@ -389,13 +408,17 @@ var resultIsStringOrBoolean3 = false ? exprString1 : exprBoolean1; // union var resultIsAny3 = !true ? exprAny1 : exprAny2; >resultIsAny3 : any +> : ^^^ >!true ? exprAny1 : exprAny2 : any ->!true : boolean -> : ^^^^^^^ +> : ^^^ +>!true : false +> : ^^^^^ >true : true > : ^^^^ >exprAny1 : any +> : ^^^ >exprAny2 : any +> : ^^^ var resultIsBoolean3 = typeof "123" == "string" ? exprBoolean1 : exprBoolean2; >resultIsBoolean3 : boolean @@ -450,8 +473,8 @@ var resultIsObject3 = true || false ? exprIsObject1 : exprIsObject2; > : ^^^^^^ >true || false ? exprIsObject1 : exprIsObject2 : Object > : ^^^^^^ ->true || false : boolean -> : ^^^^^^^ +>true || false : true +> : ^^^^ >true : true > : ^^^^ >false : false diff --git a/tests/baselines/reference/conditionalOperatorConditionIsNumberType.js b/tests/baselines/reference/conditionalOperatorConditionIsNumberType.js index 49d2a4d2b3975..98c23b6455594 100644 --- a/tests/baselines/reference/conditionalOperatorConditionIsNumberType.js +++ b/tests/baselines/reference/conditionalOperatorConditionIsNumberType.js @@ -66,6 +66,7 @@ var resultIsObject3 = foo() / array[1] ? exprIsObject1 : exprIsObject2; var resultIsStringOrBoolean3 = foo() / array[1] ? exprString1 : exprBoolean1; // Union //// [conditionalOperatorConditionIsNumberType.js] +"use strict"; //Cond is a number type variable condNumber ? exprAny1 : exprAny2; condNumber ? exprBoolean1 : exprBoolean2; diff --git a/tests/baselines/reference/conditionalOperatorConditionIsObjectType.js b/tests/baselines/reference/conditionalOperatorConditionIsObjectType.js index a51cb26d4cb8e..d2fbcf0e4670b 100644 --- a/tests/baselines/reference/conditionalOperatorConditionIsObjectType.js +++ b/tests/baselines/reference/conditionalOperatorConditionIsObjectType.js @@ -67,6 +67,7 @@ var resultIsStringOrBoolean3 = C.doIt() ? exprString1 : exprBoolean1; // union //// [conditionalOperatorConditionIsObjectType.js] +"use strict"; function foo() { } ; class C { diff --git a/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.js b/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.js index 767338af18bd2..d87680008c064 100644 --- a/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.js +++ b/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.js @@ -66,6 +66,7 @@ var resultIsObject3 = x.doSomeThing() ? exprIsObject1 : exprIsObject2; var resultIsStringOrBoolean5 = x.doSomeThing() ? exprString1 : exprBoolean1; // union //// [conditionalOperatorConditoinIsAnyType.js] +"use strict"; //Cond is an any type variable condAny ? exprAny1 : exprAny2; condAny ? exprBoolean1 : exprBoolean2; diff --git a/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.types b/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.types index 29030999e606a..27a20a9c84807 100644 --- a/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.types +++ b/tests/baselines/reference/conditionalOperatorConditoinIsAnyType.types @@ -141,8 +141,8 @@ undefined ? exprNumber1 : exprNumber2; [null, undefined] ? exprString1 : exprString2; >[null, undefined] ? exprString1 : exprString2 : string > : ^^^^^^ ->[null, undefined] : null[] -> : ^^^^^^ +>[null, undefined] : (null | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^ >undefined : undefined > : ^^^^^^^^^ >exprString1 : string @@ -153,8 +153,8 @@ undefined ? exprNumber1 : exprNumber2; [null, undefined] ? exprIsObject1 : exprIsObject2; >[null, undefined] ? exprIsObject1 : exprIsObject2 : Object > : ^^^^^^ ->[null, undefined] : null[] -> : ^^^^^^ +>[null, undefined] : (null | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^ >undefined : undefined > : ^^^^^^^^^ >exprIsObject1 : Object @@ -373,8 +373,8 @@ var resultIsString2 = [null, undefined] ? exprString1 : exprString2; > : ^^^^^^ >[null, undefined] ? exprString1 : exprString2 : string > : ^^^^^^ ->[null, undefined] : null[] -> : ^^^^^^ +>[null, undefined] : (null | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^ >undefined : undefined > : ^^^^^^^^^ >exprString1 : string @@ -387,8 +387,8 @@ var resultIsObject2 = [null, undefined] ? exprIsObject1 : exprIsObject2; > : ^^^^^^ >[null, undefined] ? exprIsObject1 : exprIsObject2 : Object > : ^^^^^^ ->[null, undefined] : null[] -> : ^^^^^^ +>[null, undefined] : (null | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^ >undefined : undefined > : ^^^^^^^^^ >exprIsObject1 : Object @@ -423,8 +423,8 @@ var resultIsStringOrBoolean4 = [null, undefined] ? exprString1 : exprBoolean1; / > : ^^^^^^^^^^^^^^^^ >[null, undefined] ? exprString1 : exprBoolean1 : string | boolean > : ^^^^^^^^^^^^^^^^ ->[null, undefined] : null[] -> : ^^^^^^ +>[null, undefined] : (null | undefined)[] +> : ^^^^^^^^^^^^^^^^^^^^ >undefined : undefined > : ^^^^^^^^^ >exprString1 : string diff --git a/tests/baselines/reference/conditionalOperatorConditoinIsStringType.errors.txt b/tests/baselines/reference/conditionalOperatorConditoinIsStringType.errors.txt index a57557d34395b..5af5b518ef73d 100644 --- a/tests/baselines/reference/conditionalOperatorConditoinIsStringType.errors.txt +++ b/tests/baselines/reference/conditionalOperatorConditoinIsStringType.errors.txt @@ -4,15 +4,18 @@ conditionalOperatorConditoinIsStringType.ts(27,1): error TS2872: This kind of ex conditionalOperatorConditoinIsStringType.ts(28,1): error TS2872: This kind of expression is always truthy. conditionalOperatorConditoinIsStringType.ts(29,1): error TS2872: This kind of expression is always truthy. conditionalOperatorConditoinIsStringType.ts(30,1): error TS2872: This kind of expression is always truthy. +conditionalOperatorConditoinIsStringType.ts(37,1): error TS2774: This condition will always return true since this function is always defined. Did you mean to call it instead? conditionalOperatorConditoinIsStringType.ts(51,20): error TS2873: This kind of expression is always falsy. conditionalOperatorConditoinIsStringType.ts(52,24): error TS2872: This kind of expression is always truthy. conditionalOperatorConditoinIsStringType.ts(53,23): error TS2872: This kind of expression is always truthy. conditionalOperatorConditoinIsStringType.ts(54,23): error TS2872: This kind of expression is always truthy. conditionalOperatorConditoinIsStringType.ts(55,23): error TS2872: This kind of expression is always truthy. conditionalOperatorConditoinIsStringType.ts(56,32): error TS2872: This kind of expression is always truthy. +conditionalOperatorConditoinIsStringType.ts(59,24): error TS2774: This condition will always return true since this function is always defined. Did you mean to call it instead? +conditionalOperatorConditoinIsStringType.ts(64,32): error TS2774: This condition will always return true since this function is always defined. Did you mean to call it instead? -==== conditionalOperatorConditoinIsStringType.ts (12 errors) ==== +==== conditionalOperatorConditoinIsStringType.ts (15 errors) ==== //Cond ? Expr1 : Expr2, Cond is of string type, Expr1 and Expr2 have the same type declare var condString: string; @@ -62,6 +65,8 @@ conditionalOperatorConditoinIsStringType.ts(56,32): error TS2872: This kind of e typeof condString ? exprAny1 : exprAny2; condString.toUpperCase ? exprBoolean1 : exprBoolean2; + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2774: This condition will always return true since this function is always defined. Did you mean to call it instead? condString + "string" ? exprNumber1 : exprNumber2; foo() ? exprString1 : exprString2; array[1] ? exprIsObject1 : exprIsObject2; @@ -96,8 +101,12 @@ conditionalOperatorConditoinIsStringType.ts(56,32): error TS2872: This kind of e var resultIsAny3 = typeof condString ? exprAny1 : exprAny2; var resultIsBoolean3 = condString.toUpperCase ? exprBoolean1 : exprBoolean2; + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2774: This condition will always return true since this function is always defined. Did you mean to call it instead? var resultIsNumber3 = condString + "string" ? exprNumber1 : exprNumber2; var resultIsString3 = foo() ? exprString1 : exprString2; var resultIsObject3 = array[1] ? exprIsObject1 : exprIsObject2; var resultIsStringOrBoolean3 = typeof condString ? exprString1 : exprBoolean1; // union - var resultIsStringOrBoolean4 = condString.toUpperCase ? exprString1 : exprBoolean1; // union \ No newline at end of file + var resultIsStringOrBoolean4 = condString.toUpperCase ? exprString1 : exprBoolean1; // union + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2774: This condition will always return true since this function is always defined. Did you mean to call it instead? \ No newline at end of file diff --git a/tests/baselines/reference/conditionalOperatorConditoinIsStringType.js b/tests/baselines/reference/conditionalOperatorConditoinIsStringType.js index 6d4c04abf537d..d4faf9c46b5a3 100644 --- a/tests/baselines/reference/conditionalOperatorConditoinIsStringType.js +++ b/tests/baselines/reference/conditionalOperatorConditoinIsStringType.js @@ -67,6 +67,7 @@ var resultIsStringOrBoolean3 = typeof condString ? exprString1 : exprBoolean1; / var resultIsStringOrBoolean4 = condString.toUpperCase ? exprString1 : exprBoolean1; // union //// [conditionalOperatorConditoinIsStringType.js] +"use strict"; //Cond is a string type variable condString ? exprAny1 : exprAny2; condString ? exprBoolean1 : exprBoolean2; diff --git a/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.errors.txt b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.errors.txt new file mode 100644 index 0000000000000..1509385b0f60d --- /dev/null +++ b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.errors.txt @@ -0,0 +1,83 @@ +conditionalOperatorWithIdenticalBCT.ts(2,27): error TS2564: Property 'propertyX1' has no initializer and is not definitely assigned in the constructor. +conditionalOperatorWithIdenticalBCT.ts(2,47): error TS2564: Property 'propertyX2' has no initializer and is not definitely assigned in the constructor. +conditionalOperatorWithIdenticalBCT.ts(3,21): error TS2564: Property 'propertyA' has no initializer and is not definitely assigned in the constructor. +conditionalOperatorWithIdenticalBCT.ts(4,21): error TS2564: Property 'propertyB' has no initializer and is not definitely assigned in the constructor. +conditionalOperatorWithIdenticalBCT.ts(12,8): error TS2454: Variable 'x' is used before being assigned. +conditionalOperatorWithIdenticalBCT.ts(13,22): error TS2454: Variable 'x' is used before being assigned. +conditionalOperatorWithIdenticalBCT.ts(22,28): error TS2454: Variable 'x' is used before being assigned. +conditionalOperatorWithIdenticalBCT.ts(27,8): error TS2454: Variable 'a' is used before being assigned. +conditionalOperatorWithIdenticalBCT.ts(28,22): error TS2454: Variable 'a' is used before being assigned. +conditionalOperatorWithIdenticalBCT.ts(37,28): error TS2454: Variable 'x' is used before being assigned. +conditionalOperatorWithIdenticalBCT.ts(42,28): error TS2454: Variable 'a' is used before being assigned. + + +==== conditionalOperatorWithIdenticalBCT.ts (11 errors) ==== + //Cond ? Expr1 : Expr2, Expr1 and Expr2 have identical best common type + class X { propertyX: any; propertyX1: number; propertyX2: string }; + ~~~~~~~~~~ +!!! error TS2564: Property 'propertyX1' has no initializer and is not definitely assigned in the constructor. + ~~~~~~~~~~ +!!! error TS2564: Property 'propertyX2' has no initializer and is not definitely assigned in the constructor. + class A extends X { propertyA: number }; + ~~~~~~~~~ +!!! error TS2564: Property 'propertyA' has no initializer and is not definitely assigned in the constructor. + class B extends X { propertyB: string }; + ~~~~~~~~~ +!!! error TS2564: Property 'propertyB' has no initializer and is not definitely assigned in the constructor. + + var x: X; + var a: A; + var b: B; + + //Cond ? Expr1 : Expr2, Expr1 is supertype + //Be Not contextually typed + true ? x : a; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + var result1 = true ? x : a; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + + //Expr1 and Expr2 are literals + true ? {} : 1; + true ? { a: 1 } : { a: 2, b: 'string' }; + var result2 = true ? {} : 1; + var result3 = true ? { a: 1 } : { a: 2, b: 'string' }; + + //Contextually typed + var resultIsX1: X = true ? x : a; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + var result4: (t: A) => any = true ? (m) => m.propertyX : (n) => n.propertyA; + + //Cond ? Expr1 : Expr2, Expr2 is supertype + //Be Not contextually typed + true ? a : x; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var result5 = true ? a : x; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + + //Expr1 and Expr2 are literals + true ? 1 : {}; + true ? { a: 2, b: 'string' } : { a: 1 }; + var result6 = true ? 1 : {}; + var result7 = true ? { a: 2, b: 'string' } : { a: 1 }; + + //Contextually typed + var resultIsX2: X = true ? x : a; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + var result8: (t: A) => any = true ? (m) => m.propertyA : (n) => n.propertyX; + + //Result = Cond ? Expr1 : Expr2, Result is supertype + //Contextually typed + var resultIsX3: X = true ? a : b; + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + var result10: (t: X) => any = true ? (m) => m.propertyX1 : (n) => n.propertyX2; + + //Expr1 and Expr2 are literals + var result11: any = true ? 1 : 'string'; + \ No newline at end of file diff --git a/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js index 15cca3c02761c..79e13cb8cbe05 100644 --- a/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js +++ b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js @@ -50,6 +50,7 @@ var result11: any = true ? 1 : 'string'; //// [conditionalOperatorWithIdenticalBCT.js] +"use strict"; //Cond ? Expr1 : Expr2, Expr1 and Expr2 have identical best common type class X { } diff --git a/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.types b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.types index 90ff05a5b8a6f..905ddc98c53f0 100644 --- a/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.types +++ b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.types @@ -6,6 +6,7 @@ class X { propertyX: any; propertyX1: number; propertyX2: string }; >X : X > : ^ >propertyX : any +> : ^^^ >propertyX1 : number > : ^^^^^^ >propertyX2 : string @@ -159,6 +160,7 @@ var result4: (t: A) => any = true ? (m) => m.propertyX : (n) => n.propertyA; >m : A > : ^ >m.propertyX : any +> : ^^^ >m : A > : ^ >propertyX : any @@ -304,6 +306,7 @@ var result8: (t: A) => any = true ? (m) => m.propertyA : (n) => n.propertyX; >n : A > : ^ >n.propertyX : any +> : ^^^ >n : A > : ^ >propertyX : any @@ -356,6 +359,7 @@ var result10: (t: X) => any = true ? (m) => m.propertyX1 : (n) => n.propertyX2; //Expr1 and Expr2 are literals var result11: any = true ? 1 : 'string'; >result11 : any +> : ^^^ >true ? 1 : 'string' : "string" | 1 > : ^^^^^^^^^^^^ >true : true diff --git a/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.errors.txt b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.errors.txt index 2aa9526ecc629..481ff5abfce54 100644 --- a/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.errors.txt +++ b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.errors.txt @@ -1,3 +1,7 @@ +conditionalOperatorWithoutIdenticalBCT.ts(2,27): error TS2564: Property 'propertyX1' has no initializer and is not definitely assigned in the constructor. +conditionalOperatorWithoutIdenticalBCT.ts(2,47): error TS2564: Property 'propertyX2' has no initializer and is not definitely assigned in the constructor. +conditionalOperatorWithoutIdenticalBCT.ts(3,21): error TS2564: Property 'propertyA' has no initializer and is not definitely assigned in the constructor. +conditionalOperatorWithoutIdenticalBCT.ts(4,21): error TS2564: Property 'propertyB' has no initializer and is not definitely assigned in the constructor. conditionalOperatorWithoutIdenticalBCT.ts(15,5): error TS2322: Type 'A | B' is not assignable to type 'A'. Property 'propertyA' is missing in type 'B' but required in type 'A'. conditionalOperatorWithoutIdenticalBCT.ts(16,5): error TS2322: Type 'A | B' is not assignable to type 'B'. @@ -13,11 +17,19 @@ conditionalOperatorWithoutIdenticalBCT.ts(21,5): error TS2322: Type '((m: X) => Type 'number' is not assignable to type 'boolean'. -==== conditionalOperatorWithoutIdenticalBCT.ts (5 errors) ==== +==== conditionalOperatorWithoutIdenticalBCT.ts (9 errors) ==== //Cond ? Expr1 : Expr2, Expr1 and Expr2 have no identical best common type class X { propertyX: any; propertyX1: number; propertyX2: string }; + ~~~~~~~~~~ +!!! error TS2564: Property 'propertyX1' has no initializer and is not definitely assigned in the constructor. + ~~~~~~~~~~ +!!! error TS2564: Property 'propertyX2' has no initializer and is not definitely assigned in the constructor. class A extends X { propertyA: number }; + ~~~~~~~~~ +!!! error TS2564: Property 'propertyA' has no initializer and is not definitely assigned in the constructor. class B extends X { propertyB: string }; + ~~~~~~~~~ +!!! error TS2564: Property 'propertyB' has no initializer and is not definitely assigned in the constructor. declare var x: X; declare var a: A; diff --git a/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js index 1deef6f1908ef..b5ce7eae99bd2 100644 --- a/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js +++ b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js @@ -26,6 +26,7 @@ var result61: (t: X) => number| string = true ? (m) => m.propertyX1 : (n) => n.p //// [conditionalOperatorWithoutIdenticalBCT.js] +"use strict"; //Cond ? Expr1 : Expr2, Expr1 and Expr2 have no identical best common type class X { } diff --git a/tests/baselines/reference/conditionalTypeAnyUnion.js b/tests/baselines/reference/conditionalTypeAnyUnion.js index 6afd67dd25a72..5a3faea2638fe 100644 --- a/tests/baselines/reference/conditionalTypeAnyUnion.js +++ b/tests/baselines/reference/conditionalTypeAnyUnion.js @@ -10,4 +10,5 @@ type WithSpec = T type R = WithSpec // should not error //// [conditionalTypeAnyUnion.js] +"use strict"; // repro from #52568 diff --git a/tests/baselines/reference/conditionalTypeBasedContextualTypeReturnTypeWidening.js b/tests/baselines/reference/conditionalTypeBasedContextualTypeReturnTypeWidening.js index a92821dc6814b..9ba5ce39c73d0 100644 --- a/tests/baselines/reference/conditionalTypeBasedContextualTypeReturnTypeWidening.js +++ b/tests/baselines/reference/conditionalTypeBasedContextualTypeReturnTypeWidening.js @@ -15,6 +15,7 @@ const func4 = useState2(() => () => 0); //// [conditionalTypeBasedContextualTypeReturnTypeWidening.js] +"use strict"; const func1 = useState1(() => () => 0); const func2 = useState2(() => () => 0); const func3 = useState1(() => () => 0); diff --git a/tests/baselines/reference/conditionalTypeClassMembers.js b/tests/baselines/reference/conditionalTypeClassMembers.js index 42c96ad8d53f2..4413fa0adc367 100644 --- a/tests/baselines/reference/conditionalTypeClassMembers.js +++ b/tests/baselines/reference/conditionalTypeClassMembers.js @@ -13,3 +13,4 @@ declare class MySet { type DS = TRec extends MyRecord ? MySet : TRec[]; //// [conditionalTypeClassMembers.js] +"use strict"; diff --git a/tests/baselines/reference/conditionalTypeDiscriminatingLargeUnionRegularTypeFetchingSpeedReasonable.types b/tests/baselines/reference/conditionalTypeDiscriminatingLargeUnionRegularTypeFetchingSpeedReasonable.types index fb3f341bac093..c8986f7e3c2ec 100644 --- a/tests/baselines/reference/conditionalTypeDiscriminatingLargeUnionRegularTypeFetchingSpeedReasonable.types +++ b/tests/baselines/reference/conditionalTypeDiscriminatingLargeUnionRegularTypeFetchingSpeedReasonable.types @@ -20034,7 +20034,7 @@ export function makeThing( children: ChildrenOf>[] = [], >children : ChildrenOf>[] > : ^^^^^^^^^^^^^^^^^^^^^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ ) { } diff --git a/tests/baselines/reference/conditionalTypeDoesntSpinForever.errors.txt b/tests/baselines/reference/conditionalTypeDoesntSpinForever.errors.txt index 364068974aa3a..cd3cb40b2038a 100644 --- a/tests/baselines/reference/conditionalTypeDoesntSpinForever.errors.txt +++ b/tests/baselines/reference/conditionalTypeDoesntSpinForever.errors.txt @@ -1,14 +1,25 @@ conditionalTypeDoesntSpinForever.ts(23,15): error TS2322: Type 'SO_FAR' is not assignable to type 'object'. +conditionalTypeDoesntSpinForever.ts(24,20): error TS2322: Type 'undefined' is not assignable to type 'TYPE'. + 'TYPE' could be instantiated with an arbitrary type which could be unrelated to 'undefined'. conditionalTypeDoesntSpinForever.ts(36,19): error TS2322: Type 'SO_FAR' is not assignable to type 'object'. conditionalTypeDoesntSpinForever.ts(53,21): error TS2322: Type 'SO_FAR' is not assignable to type 'object'. conditionalTypeDoesntSpinForever.ts(53,45): error TS2322: Type 'SO_FAR' is not assignable to type 'object'. +conditionalTypeDoesntSpinForever.ts(54,26): error TS2322: Type 'undefined' is not assignable to type 'TYPE'. + 'TYPE' could be instantiated with an arbitrary type which could be unrelated to 'undefined'. conditionalTypeDoesntSpinForever.ts(65,17): error TS2322: Type 'SO_FAR' is not assignable to type 'object'. +conditionalTypeDoesntSpinForever.ts(66,22): error TS2322: Type 'undefined' is not assignable to type 'TYPE'. + 'TYPE' could be instantiated with an arbitrary type which could be unrelated to 'undefined'. conditionalTypeDoesntSpinForever.ts(78,38): error TS2322: Type 'SO_FAR' is not assignable to type 'object'. conditionalTypeDoesntSpinForever.ts(94,21): error TS2322: Type 'SO_FAR' is not assignable to type 'object'. +conditionalTypeDoesntSpinForever.ts(96,41): error TS2769: No overload matches this call. + Overload 1 of 2, '(o: {}): string[]', gave the following error. + Argument of type 'SO_FAR' is not assignable to parameter of type '{}'. + Overload 2 of 2, '(o: object): string[]', gave the following error. + Argument of type 'SO_FAR' is not assignable to parameter of type 'object'. conditionalTypeDoesntSpinForever.ts(97,71): error TS2322: Type 'SO_FAR' is not assignable to type 'object'. -==== conditionalTypeDoesntSpinForever.ts (8 errors) ==== +==== conditionalTypeDoesntSpinForever.ts (12 errors) ==== // A *self-contained* demonstration of the problem follows... // Test this by running `tsc --target es6` on the command-line, rather than through another build tool such as Gulp, Webpack, etc. @@ -36,6 +47,9 @@ conditionalTypeDoesntSpinForever.ts(97,71): error TS2322: Type 'SO_FAR' is not a !!! error TS2322: Type 'SO_FAR' is not assignable to type 'object'. !!! related TS2208 conditionalTypeDoesntSpinForever.ts:22:38: This type parameter might need an `extends object` constraint. name: (instance: TYPE = undefined) => + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'undefined' is not assignable to type 'TYPE'. +!!! error TS2322: 'TYPE' could be instantiated with an arbitrary type which could be unrelated to 'undefined'. buildPubSubRecordType(Object.assign({}, soFar, {name: instance as TYPE}) as SO_FAR & {name: TYPE}) as BuildPubSubRecordType } ); @@ -75,6 +89,9 @@ conditionalTypeDoesntSpinForever.ts(97,71): error TS2322: Type 'SO_FAR' is not a !!! error TS2322: Type 'SO_FAR' is not assignable to type 'object'. !!! related TS2208 conditionalTypeDoesntSpinForever.ts:52:44: This type parameter might need an `extends object` constraint. identifier: (instance: TYPE = undefined) => + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'undefined' is not assignable to type 'TYPE'. +!!! error TS2322: 'TYPE' could be instantiated with an arbitrary type which could be unrelated to 'undefined'. buildPubSubRecordType(Object.assign({}, soFar, {identifier: instance as TYPE}) as SO_FAR & {identifier: TYPE}) as BuildPubSubRecordType } ); @@ -90,6 +107,9 @@ conditionalTypeDoesntSpinForever.ts(97,71): error TS2322: Type 'SO_FAR' is not a !!! error TS2322: Type 'SO_FAR' is not assignable to type 'object'. !!! related TS2208 conditionalTypeDoesntSpinForever.ts:64:40: This type parameter might need an `extends object` constraint. record: (instance: TYPE = undefined) => + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'undefined' is not assignable to type 'TYPE'. +!!! error TS2322: 'TYPE' could be instantiated with an arbitrary type which could be unrelated to 'undefined'. buildPubSubRecordType(Object.assign({}, soFar, {record: instance as TYPE}) as SO_FAR & {record: TYPE}) as BuildPubSubRecordType } ); @@ -126,6 +146,14 @@ conditionalTypeDoesntSpinForever.ts(97,71): error TS2322: Type 'SO_FAR' is not a !!! related TS2208 conditionalTypeDoesntSpinForever.ts:93:22: This type parameter might need an `extends object` constraint. type: soFar, fields: () => new Set(Object.keys(soFar) as (keyof SO_FAR)[]), + ~~~~~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 2, '(o: {}): string[]', gave the following error. +!!! error TS2769: Argument of type 'SO_FAR' is not assignable to parameter of type '{}'. +!!! error TS2769: Overload 2 of 2, '(o: object): string[]', gave the following error. +!!! error TS2769: Argument of type 'SO_FAR' is not assignable to parameter of type 'object'. +!!! related TS2208 conditionalTypeDoesntSpinForever.ts:93:22: This type parameter might need an `extends {}` constraint. +!!! related TS2208 conditionalTypeDoesntSpinForever.ts:93:22: This type parameter might need an `extends object` constraint. hasField: (fieldName: string | number | symbol) => fieldName in soFar ~~~~~ !!! error TS2322: Type 'SO_FAR' is not assignable to type 'object'. diff --git a/tests/baselines/reference/conditionalTypeDoesntSpinForever.types b/tests/baselines/reference/conditionalTypeDoesntSpinForever.types index 0e223e2e7f985..4ded8487fb29a 100644 --- a/tests/baselines/reference/conditionalTypeDoesntSpinForever.types +++ b/tests/baselines/reference/conditionalTypeDoesntSpinForever.types @@ -58,8 +58,8 @@ export enum PubSubRecordIsStoredInRedisAsA { name: (t?: TYPE) => BuildPubSubRecordType >name : (t?: TYPE) => BuildPubSubRecordType > : ^ ^^ ^^^ ^^^^^ ->t : TYPE -> : ^^^^ +>t : TYPE | undefined +> : ^^^^^^^^^^^^^^^^ >name : TYPE > : ^^^^ } @@ -284,8 +284,8 @@ export enum PubSubRecordIsStoredInRedisAsA { identifier: >(t?: TYPE) => BuildPubSubRecordType >identifier : >(t?: TYPE) => BuildPubSubRecordType > : ^ ^^^^^^^^^ ^^ ^^^ ^^^^^ ->t : TYPE -> : ^^^^ +>t : TYPE | undefined +> : ^^^^^^^^^^^^^^^^ >identifier : TYPE > : ^^^^ @@ -386,8 +386,8 @@ export enum PubSubRecordIsStoredInRedisAsA { record: (t?: TYPE) => BuildPubSubRecordType >record : (t?: TYPE) => BuildPubSubRecordType > : ^ ^^ ^^^ ^^^^^ ->t : TYPE -> : ^^^^ +>t : TYPE | undefined +> : ^^^^^^^^^^^^^^^^ >record : TYPE > : ^^^^ } diff --git a/tests/baselines/reference/conditionalTypeGenericInSignatureTypeParameterConstraint.js b/tests/baselines/reference/conditionalTypeGenericInSignatureTypeParameterConstraint.js index 4865629639d98..f4e0dc9bd46c0 100644 --- a/tests/baselines/reference/conditionalTypeGenericInSignatureTypeParameterConstraint.js +++ b/tests/baselines/reference/conditionalTypeGenericInSignatureTypeParameterConstraint.js @@ -7,3 +7,4 @@ type H_inline1 = (() => o) extends (() => infer o) ? o : never; type Result = H_inline1; // should be `string` //// [conditionalTypeGenericInSignatureTypeParameterConstraint.js] +"use strict"; diff --git a/tests/baselines/reference/conditionalTypeSimplification.js b/tests/baselines/reference/conditionalTypeSimplification.js index 611917d26825e..48b048f01a436 100644 --- a/tests/baselines/reference/conditionalTypeSimplification.js +++ b/tests/baselines/reference/conditionalTypeSimplification.js @@ -14,4 +14,5 @@ interface AnySchemaType, V> extends AbstractS //// [conditionalTypeSimplification.js] +"use strict"; // Repro from #30794 diff --git a/tests/baselines/reference/conditionalTypeSubclassExtendsTypeParam.js b/tests/baselines/reference/conditionalTypeSubclassExtendsTypeParam.js index 3b6a13b72ccf7..db19ac6997f43 100644 --- a/tests/baselines/reference/conditionalTypeSubclassExtendsTypeParam.js +++ b/tests/baselines/reference/conditionalTypeSubclassExtendsTypeParam.js @@ -9,3 +9,4 @@ declare class Field { } //// [conditionalTypeSubclassExtendsTypeParam.js] +"use strict"; diff --git a/tests/baselines/reference/conditionalTypeVarianceBigArrayConstraintsPerformance.js b/tests/baselines/reference/conditionalTypeVarianceBigArrayConstraintsPerformance.js index 24c6d879b8fc5..a5a6cf11eaaf4 100644 --- a/tests/baselines/reference/conditionalTypeVarianceBigArrayConstraintsPerformance.js +++ b/tests/baselines/reference/conditionalTypeVarianceBigArrayConstraintsPerformance.js @@ -13,6 +13,7 @@ function F(p1: Stuff, p2: Stuff) { } //// [conditionalTypeVarianceBigArrayConstraintsPerformance.js] +"use strict"; /// function F(p1, p2) { p1 = p2; // Error diff --git a/tests/baselines/reference/conditionalTypeVarianceBigArrayConstraintsPerformance.types b/tests/baselines/reference/conditionalTypeVarianceBigArrayConstraintsPerformance.types index d1cc488621671..14763c4f33339 100644 --- a/tests/baselines/reference/conditionalTypeVarianceBigArrayConstraintsPerformance.types +++ b/tests/baselines/reference/conditionalTypeVarianceBigArrayConstraintsPerformance.types @@ -2,8 +2,8 @@ === Performance Stats === Assignability cache: 1,000 -Type Count: 5,000 -Instantiation count: 50,000 +Type Count: 10,000 +Instantiation count: 100,000 Symbol count: 50,000 === conditionalTypeVarianceBigArrayConstraintsPerformance.ts === diff --git a/tests/baselines/reference/conditionalTypesASI.js b/tests/baselines/reference/conditionalTypesASI.js index cc958056c2275..a9cbb6d9cba65 100644 --- a/tests/baselines/reference/conditionalTypesASI.js +++ b/tests/baselines/reference/conditionalTypesASI.js @@ -10,6 +10,7 @@ interface JSONSchema4 { //// [conditionalTypesASI.js] +"use strict"; // Repro from #21637 diff --git a/tests/baselines/reference/conditionalTypesASI.types b/tests/baselines/reference/conditionalTypesASI.types index 6bdc4c767e594..4869c4a2e659d 100644 --- a/tests/baselines/reference/conditionalTypesASI.types +++ b/tests/baselines/reference/conditionalTypesASI.types @@ -5,11 +5,11 @@ interface JSONSchema4 { a?: number ->a : number -> : ^^^^^^ +>a : number | undefined +> : ^^^^^^^^^^^^^^^^^^ extends?: string | string[] ->extends : string | string[] -> : ^^^^^^^^^^^^^^^^^ +>extends : string | string[] | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ } diff --git a/tests/baselines/reference/conditionalTypesExcessProperties.js b/tests/baselines/reference/conditionalTypesExcessProperties.js index 3442e27746364..cdec52b3e8b4d 100644 --- a/tests/baselines/reference/conditionalTypesExcessProperties.js +++ b/tests/baselines/reference/conditionalTypesExcessProperties.js @@ -14,6 +14,7 @@ function testFunc2
(a: A, sa: Something) { //// [conditionalTypesExcessProperties.js] +"use strict"; function testFunc2(a, sa) { sa = { test: 'hi', arg: a }; // not excess (but currently still not assignable) sa = { test: 'bye', arg: a, arr: a }; // excess diff --git a/tests/baselines/reference/conditionallyDuplicateOverloadsCausedByOverloadResolution.errors.txt b/tests/baselines/reference/conditionallyDuplicateOverloadsCausedByOverloadResolution.errors.txt new file mode 100644 index 0000000000000..41a47ee34504d --- /dev/null +++ b/tests/baselines/reference/conditionallyDuplicateOverloadsCausedByOverloadResolution.errors.txt @@ -0,0 +1,26 @@ +conditionallyDuplicateOverloadsCausedByOverloadResolution.ts(19,12): error TS2454: Variable 'bar' is used before being assigned. + + +==== conditionallyDuplicateOverloadsCausedByOverloadResolution.ts (1 errors) ==== + declare function foo(func: (x: string, y: string) => any): boolean; + declare function foo(func: (x: string, y: number) => any): string; + + var out = foo((x, y) => { + function bar(a: typeof x): void; + function bar(b: typeof y): void; + function bar() { } + return bar; + }); + + declare function foo2(func: (x: string, y: string) => any): boolean; + declare function foo2(func: (x: string, y: number) => any): string; + + var out2 = foo2((x, y) => { + var bar: { + (a: typeof x): void; + (b: typeof y): void; + }; + return bar; + ~~~ +!!! error TS2454: Variable 'bar' is used before being assigned. + }); \ No newline at end of file diff --git a/tests/baselines/reference/conditionallyDuplicateOverloadsCausedByOverloadResolution.js b/tests/baselines/reference/conditionallyDuplicateOverloadsCausedByOverloadResolution.js index 03f9519e02187..0e187f201433c 100644 --- a/tests/baselines/reference/conditionallyDuplicateOverloadsCausedByOverloadResolution.js +++ b/tests/baselines/reference/conditionallyDuplicateOverloadsCausedByOverloadResolution.js @@ -23,6 +23,7 @@ var out2 = foo2((x, y) => { }); //// [conditionallyDuplicateOverloadsCausedByOverloadResolution.js] +"use strict"; var out = foo((x, y) => { function bar() { } return bar; diff --git a/tests/baselines/reference/config/showConfig/Show TSConfig with compileOnSave and more/tsconfig.json b/tests/baselines/reference/config/showConfig/Show TSConfig with compileOnSave and more/tsconfig.json index 5ce76adf7bce8..3ab18d351796f 100644 --- a/tests/baselines/reference/config/showConfig/Show TSConfig with compileOnSave and more/tsconfig.json +++ b/tests/baselines/reference/config/showConfig/Show TSConfig with compileOnSave and more/tsconfig.json @@ -4,16 +4,7 @@ "target": "es5", "module": "commonjs", "strict": true, - "useDefineForClassFields": false, - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "strictBindCallApply": true, - "strictPropertyInitialization": true, - "strictBuiltinIteratorReturn": true, - "alwaysStrict": true, - "useUnknownInCatchVariables": true + "useDefineForClassFields": false }, "references": [ { diff --git a/tests/baselines/reference/config/showConfig/Shows tsconfig for single option/strict/tsconfig.json b/tests/baselines/reference/config/showConfig/Shows tsconfig for single option/strict/tsconfig.json index cb5f15904a123..8dc142972f830 100644 --- a/tests/baselines/reference/config/showConfig/Shows tsconfig for single option/strict/tsconfig.json +++ b/tests/baselines/reference/config/showConfig/Shows tsconfig for single option/strict/tsconfig.json @@ -1,14 +1,5 @@ { "compilerOptions": { - "strict": true, - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "strictBindCallApply": true, - "strictPropertyInitialization": true, - "strictBuiltinIteratorReturn": true, - "alwaysStrict": true, - "useUnknownInCatchVariables": true + "strict": true } } diff --git a/tests/baselines/reference/configFileExtendsAsList.js b/tests/baselines/reference/configFileExtendsAsList.js index 6e0fc799cff5e..1ae264b6a238e 100644 --- a/tests/baselines/reference/configFileExtendsAsList.js +++ b/tests/baselines/reference/configFileExtendsAsList.js @@ -20,6 +20,7 @@ let y: string; y.toLowerCase(); // strictNullChecks error //// [index.js] +"use strict"; function f(x) { } // noImplicitAny error let y; y.toLowerCase(); // strictNullChecks error diff --git a/tests/baselines/reference/conflictMarkerDiff3Trivia1.js b/tests/baselines/reference/conflictMarkerDiff3Trivia1.js index 6d90c281e6cd1..1bf2a2e2624c1 100644 --- a/tests/baselines/reference/conflictMarkerDiff3Trivia1.js +++ b/tests/baselines/reference/conflictMarkerDiff3Trivia1.js @@ -12,6 +12,7 @@ class C { } //// [conflictMarkerDiff3Trivia1.js] +"use strict"; class C { constructor() { this.v = 1; diff --git a/tests/baselines/reference/conflictMarkerDiff3Trivia2.js b/tests/baselines/reference/conflictMarkerDiff3Trivia2.js index 59ef207cffe76..a9bd52aadce0a 100644 --- a/tests/baselines/reference/conflictMarkerDiff3Trivia2.js +++ b/tests/baselines/reference/conflictMarkerDiff3Trivia2.js @@ -19,6 +19,7 @@ class C { //// [conflictMarkerDiff3Trivia2.js] +"use strict"; class C { foo() { a(); diff --git a/tests/baselines/reference/conflictMarkerTrivia1.js b/tests/baselines/reference/conflictMarkerTrivia1.js index 130d06cc9e0b3..15409f0b83114 100644 --- a/tests/baselines/reference/conflictMarkerTrivia1.js +++ b/tests/baselines/reference/conflictMarkerTrivia1.js @@ -10,6 +10,7 @@ class C { } //// [conflictMarkerTrivia1.js] +"use strict"; class C { constructor() { this.v = 1; diff --git a/tests/baselines/reference/conflictMarkerTrivia2.js b/tests/baselines/reference/conflictMarkerTrivia2.js index d950977dcf34a..b7a89a3bcec12 100644 --- a/tests/baselines/reference/conflictMarkerTrivia2.js +++ b/tests/baselines/reference/conflictMarkerTrivia2.js @@ -16,6 +16,7 @@ class C { //// [conflictMarkerTrivia2.js] +"use strict"; class C { foo() { a(); diff --git a/tests/baselines/reference/conflictMarkerTrivia3.errors.txt b/tests/baselines/reference/conflictMarkerTrivia3.errors.txt index 3c21247e51870..5efc5cf0cc871 100644 --- a/tests/baselines/reference/conflictMarkerTrivia3.errors.txt +++ b/tests/baselines/reference/conflictMarkerTrivia3.errors.txt @@ -1,11 +1,14 @@ +conflictMarkerTrivia3.tsx(1,11): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. conflictMarkerTrivia3.tsx(1,11): error TS17004: Cannot use JSX unless the '--jsx' flag is provided. conflictMarkerTrivia3.tsx(1,16): error TS1005: ' ~~~~~ +!!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. + ~~~~~ !!! error TS17004: Cannot use JSX unless the '--jsx' flag is provided. <<<<<<< HEAD diff --git a/tests/baselines/reference/conflictMarkerTrivia3.js b/tests/baselines/reference/conflictMarkerTrivia3.js index 21b2360068b3f..19573b9e175ff 100644 --- a/tests/baselines/reference/conflictMarkerTrivia3.js +++ b/tests/baselines/reference/conflictMarkerTrivia3.js @@ -5,4 +5,5 @@ const x =
<<<<<<< HEAD //// [conflictMarkerTrivia3.js] +"use strict"; const x =
; diff --git a/tests/baselines/reference/conflictMarkerTrivia4.js b/tests/baselines/reference/conflictMarkerTrivia4.js index 2fd4f0d7fee05..c41a447cbf20f 100644 --- a/tests/baselines/reference/conflictMarkerTrivia4.js +++ b/tests/baselines/reference/conflictMarkerTrivia4.js @@ -5,4 +5,5 @@ const x =
<<<<<<< HEAD //// [conflictMarkerTrivia4.js] +"use strict"; const x = ; diff --git a/tests/baselines/reference/conflictingMemberTypesInBases.js b/tests/baselines/reference/conflictingMemberTypesInBases.js index 48ab40b0cfb16..35be5be2eca24 100644 --- a/tests/baselines/reference/conflictingMemberTypesInBases.js +++ b/tests/baselines/reference/conflictingMemberTypesInBases.js @@ -17,3 +17,4 @@ interface E extends D { } // No duplicate error here //// [conflictingMemberTypesInBases.js] +"use strict"; diff --git a/tests/baselines/reference/conflictingTypeAnnotatedVar.js b/tests/baselines/reference/conflictingTypeAnnotatedVar.js index bc850c4a6e749..51ae736ae8ea5 100644 --- a/tests/baselines/reference/conflictingTypeAnnotatedVar.js +++ b/tests/baselines/reference/conflictingTypeAnnotatedVar.js @@ -6,6 +6,7 @@ function foo(): number { } function foo(): number { } //// [conflictingTypeAnnotatedVar.js] +"use strict"; var foo; function foo() { } function foo() { } diff --git a/tests/baselines/reference/conflictingTypeParameterSymbolTransfer.errors.txt b/tests/baselines/reference/conflictingTypeParameterSymbolTransfer.errors.txt index 7670b32c9f384..81b08660e357c 100644 --- a/tests/baselines/reference/conflictingTypeParameterSymbolTransfer.errors.txt +++ b/tests/baselines/reference/conflictingTypeParameterSymbolTransfer.errors.txt @@ -1,7 +1,8 @@ conflictingTypeParameterSymbolTransfer.ts(13,16): error TS2304: Cannot find name 'U'. +conflictingTypeParameterSymbolTransfer.ts(29,5): error TS2564: Property 'data' has no initializer and is not definitely assigned in the constructor. -==== conflictingTypeParameterSymbolTransfer.ts (1 errors) ==== +==== conflictingTypeParameterSymbolTransfer.ts (2 errors) ==== // @strict // Via #56620 @@ -33,6 +34,8 @@ conflictingTypeParameterSymbolTransfer.ts(13,16): error TS2304: Cannot find name class BaseClass { } class Item extends BaseClass { data: data; + ~~~~ +!!! error TS2564: Property 'data' has no initializer and is not definitely assigned in the constructor. getData() { // should OK return this.data; diff --git a/tests/baselines/reference/consistentAliasVsNonAliasRecordBehavior.js b/tests/baselines/reference/consistentAliasVsNonAliasRecordBehavior.js index 9e3fd4f2740d4..5c2b88f87ba36 100644 --- a/tests/baselines/reference/consistentAliasVsNonAliasRecordBehavior.js +++ b/tests/baselines/reference/consistentAliasVsNonAliasRecordBehavior.js @@ -43,6 +43,7 @@ function mixed4(x: Record<'a', T>, y: Record2) { //// [consistentAliasVsNonAliasRecordBehavior.js] +"use strict"; // TODO: FIXME: All the below cases labeled `no error` _should be an error_, and are only prevented from so being // by incorrect variance-based relationships // Ref: https://github.com/Microsoft/TypeScript/issues/29698 diff --git a/tests/baselines/reference/constDeclarationShadowedByVarDeclaration.js b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration.js index 0ae7ad40d34da..c20f7b7ea7f2a 100644 --- a/tests/baselines/reference/constDeclarationShadowedByVarDeclaration.js +++ b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration.js @@ -25,6 +25,7 @@ var y = 0; } //// [constDeclarationShadowedByVarDeclaration.js] +"use strict"; // Error as declaration of var would cause a write to the const value var x = 0; { diff --git a/tests/baselines/reference/constDeclarationShadowedByVarDeclaration2.js b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration2.js index 24833cd388613..810f47758400c 100644 --- a/tests/baselines/reference/constDeclarationShadowedByVarDeclaration2.js +++ b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration2.js @@ -10,6 +10,7 @@ function outer() { } //// [constDeclarationShadowedByVarDeclaration2.js] +"use strict"; // No errors, const declaration is not shadowed function outer() { const x = 0; diff --git a/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.js b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.js index dc898ebd86f54..0641c6a7be53b 100644 --- a/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.js +++ b/tests/baselines/reference/constDeclarationShadowedByVarDeclaration3.js @@ -12,6 +12,7 @@ class Rule { } //// [constDeclarationShadowedByVarDeclaration3.js] +"use strict"; // Ensure only checking for const declarations shadowed by vars class Rule { constructor(name) { diff --git a/tests/baselines/reference/constDeclarations-access.js b/tests/baselines/reference/constDeclarations-access.js index dd5624bcf4c8a..be8dbeec38de6 100644 --- a/tests/baselines/reference/constDeclarations-access.js +++ b/tests/baselines/reference/constDeclarations-access.js @@ -7,6 +7,8 @@ const x = 0 x++; //// [file1.js] +"use strict"; const x = 0; //// [file2.js] +"use strict"; x++; diff --git a/tests/baselines/reference/constDeclarations-access2.js b/tests/baselines/reference/constDeclarations-access2.js index 173398b3601ca..bb139c1c6528f 100644 --- a/tests/baselines/reference/constDeclarations-access2.js +++ b/tests/baselines/reference/constDeclarations-access2.js @@ -42,6 +42,7 @@ x.toString(); //// [constDeclarations-access2.js] +"use strict"; const x = 0; // Errors x = 1; diff --git a/tests/baselines/reference/constDeclarations-access3.js b/tests/baselines/reference/constDeclarations-access3.js index a6f967bb8cd06..2072785fad8c8 100644 --- a/tests/baselines/reference/constDeclarations-access3.js +++ b/tests/baselines/reference/constDeclarations-access3.js @@ -46,6 +46,7 @@ M.x.toString(); //// [constDeclarations-access3.js] +"use strict"; var M; (function (M) { M.x = 0; diff --git a/tests/baselines/reference/constDeclarations-access4.js b/tests/baselines/reference/constDeclarations-access4.js index 1cfd9e19262c1..d6414a8cb7c6e 100644 --- a/tests/baselines/reference/constDeclarations-access4.js +++ b/tests/baselines/reference/constDeclarations-access4.js @@ -46,6 +46,7 @@ M.x.toString(); //// [constDeclarations-access4.js] +"use strict"; // Errors M.x = 1; M.x += 2; diff --git a/tests/baselines/reference/constDeclarations-ambient-errors.js b/tests/baselines/reference/constDeclarations-ambient-errors.js index a1ded5492565b..220913caa9814 100644 --- a/tests/baselines/reference/constDeclarations-ambient-errors.js +++ b/tests/baselines/reference/constDeclarations-ambient-errors.js @@ -12,3 +12,4 @@ declare namespace M { } //// [constDeclarations-ambient-errors.js] +"use strict"; diff --git a/tests/baselines/reference/constDeclarations-ambient.js b/tests/baselines/reference/constDeclarations-ambient.js index 92b46de553337..db93a7a09d1f3 100644 --- a/tests/baselines/reference/constDeclarations-ambient.js +++ b/tests/baselines/reference/constDeclarations-ambient.js @@ -12,3 +12,4 @@ declare namespace M { } //// [constDeclarations-ambient.js] +"use strict"; diff --git a/tests/baselines/reference/constDeclarations-errors.js b/tests/baselines/reference/constDeclarations-errors.js index 2ee1bbec2b90e..425366ad0c897 100644 --- a/tests/baselines/reference/constDeclarations-errors.js +++ b/tests/baselines/reference/constDeclarations-errors.js @@ -18,6 +18,7 @@ for(const c9; c9 < 1;) { } for(const c10 = 0, c11; c10 < 1;) { } //// [constDeclarations-errors.js] +"use strict"; // error, missing intialicer const c1; const c2; diff --git a/tests/baselines/reference/constDeclarations-es5(target=es2015).js b/tests/baselines/reference/constDeclarations-es5(target=es2015).js index a6d2705865672..6883cd80b4e7f 100644 --- a/tests/baselines/reference/constDeclarations-es5(target=es2015).js +++ b/tests/baselines/reference/constDeclarations-es5(target=es2015).js @@ -7,6 +7,7 @@ const z9 = 0, z10 :string = "", z11 = null; //// [constDeclarations-es5.js] +"use strict"; const z7 = false; const z8 = 23; const z9 = 0, z10 = "", z11 = null; diff --git a/tests/baselines/reference/constDeclarations-es5(target=es5).js b/tests/baselines/reference/constDeclarations-es5(target=es5).js index 755f47517b9dd..e8b10ff87685b 100644 --- a/tests/baselines/reference/constDeclarations-es5(target=es5).js +++ b/tests/baselines/reference/constDeclarations-es5(target=es5).js @@ -7,6 +7,7 @@ const z9 = 0, z10 :string = "", z11 = null; //// [constDeclarations-es5.js] +"use strict"; var z7 = false; var z8 = 23; var z9 = 0, z10 = "", z11 = null; diff --git a/tests/baselines/reference/constDeclarations-invalidContexts.errors.txt b/tests/baselines/reference/constDeclarations-invalidContexts.errors.txt index 7134a60544137..953604c1da149 100644 --- a/tests/baselines/reference/constDeclarations-invalidContexts.errors.txt +++ b/tests/baselines/reference/constDeclarations-invalidContexts.errors.txt @@ -2,14 +2,17 @@ constDeclarations-invalidContexts.ts(3,5): error TS1156: 'const' declarations ca constDeclarations-invalidContexts.ts(5,5): error TS1156: 'const' declarations can only be declared inside a block. constDeclarations-invalidContexts.ts(8,5): error TS1156: 'const' declarations can only be declared inside a block. constDeclarations-invalidContexts.ts(11,5): error TS1156: 'const' declarations can only be declared inside a block. +constDeclarations-invalidContexts.ts(15,1): error TS1101: 'with' statements are not allowed in strict mode. constDeclarations-invalidContexts.ts(15,1): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. constDeclarations-invalidContexts.ts(19,5): error TS1156: 'const' declarations can only be declared inside a block. constDeclarations-invalidContexts.ts(22,5): error TS1156: 'const' declarations can only be declared inside a block. +constDeclarations-invalidContexts.ts(25,5): error TS1344: 'A label is not allowed here. constDeclarations-invalidContexts.ts(25,12): error TS1156: 'const' declarations can only be declared inside a block. +constDeclarations-invalidContexts.ts(28,21): error TS1344: 'A label is not allowed here. constDeclarations-invalidContexts.ts(28,29): error TS1156: 'const' declarations can only be declared inside a block. -==== constDeclarations-invalidContexts.ts (9 errors) ==== +==== constDeclarations-invalidContexts.ts (12 errors) ==== // Errors, const must be defined inside a block if (true) const c1 = 0; @@ -33,6 +36,8 @@ constDeclarations-invalidContexts.ts(28,29): error TS1156: 'const' declarations var obj; with (obj) + ~~~~ +!!! error TS1101: 'with' statements are not allowed in strict mode. ~~~~~~~~~~ !!! error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. const c5 = 0; // No Error will be reported here since we turn off all type checking @@ -49,11 +54,15 @@ constDeclarations-invalidContexts.ts(28,29): error TS1156: 'const' declarations if (true) label: const c8 = 0; + ~~~~~ +!!! error TS1344: 'A label is not allowed here. ~~~~~~~~~~~~~ !!! error TS1156: 'const' declarations can only be declared inside a block. while (false) label2: label3: label4: const c9 = 0; + ~~~~~~ +!!! error TS1344: 'A label is not allowed here. ~~~~~~~~~~~~~ !!! error TS1156: 'const' declarations can only be declared inside a block. diff --git a/tests/baselines/reference/constDeclarations-invalidContexts.js b/tests/baselines/reference/constDeclarations-invalidContexts.js index 89f0d6d18cc27..8510795993652 100644 --- a/tests/baselines/reference/constDeclarations-invalidContexts.js +++ b/tests/baselines/reference/constDeclarations-invalidContexts.js @@ -35,6 +35,7 @@ while (false) //// [constDeclarations-invalidContexts.js] +"use strict"; // Errors, const must be defined inside a block if (true) const c1 = 0; diff --git a/tests/baselines/reference/constDeclarations-scopes.errors.txt b/tests/baselines/reference/constDeclarations-scopes.errors.txt index a715ebc860a44..8b260da649e04 100644 --- a/tests/baselines/reference/constDeclarations-scopes.errors.txt +++ b/tests/baselines/reference/constDeclarations-scopes.errors.txt @@ -1,7 +1,10 @@ +constDeclarations-scopes.ts(27,1): error TS1101: 'with' statements are not allowed in strict mode. constDeclarations-scopes.ts(27,1): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. +constDeclarations-scopes.ts(43,5): error TS1344: 'A label is not allowed here. +constDeclarations-scopes.ts(48,21): error TS1344: 'A label is not allowed here. -==== constDeclarations-scopes.ts (1 errors) ==== +==== constDeclarations-scopes.ts (4 errors) ==== // global const c = "string"; @@ -29,6 +32,8 @@ constDeclarations-scopes.ts(27,1): error TS2410: The 'with' statement is not sup var obj; with (obj) { + ~~~~ +!!! error TS1101: 'with' statements are not allowed in strict mode. ~~~~~~~~~~ !!! error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. const c = 0; @@ -47,11 +52,15 @@ constDeclarations-scopes.ts(27,1): error TS2410: The 'with' statement is not sup if (true) { label: const c = 0; + ~~~~~ +!!! error TS1344: 'A label is not allowed here. n = c; } while (false) { label2: label3: label4: const c = 0; + ~~~~~~ +!!! error TS1344: 'A label is not allowed here. n = c; } diff --git a/tests/baselines/reference/constDeclarations-scopes.js b/tests/baselines/reference/constDeclarations-scopes.js index b7fbe9021102f..0bf8f857d7772 100644 --- a/tests/baselines/reference/constDeclarations-scopes.js +++ b/tests/baselines/reference/constDeclarations-scopes.js @@ -149,6 +149,7 @@ var o = { } //// [constDeclarations-scopes.js] +"use strict"; // global const c = "string"; var n; diff --git a/tests/baselines/reference/constDeclarations-scopes2.js b/tests/baselines/reference/constDeclarations-scopes2.js index bb026f76290f9..5ecbbb061b8ff 100644 --- a/tests/baselines/reference/constDeclarations-scopes2.js +++ b/tests/baselines/reference/constDeclarations-scopes2.js @@ -17,6 +17,7 @@ for (const c = 0; c < 10; n = c ) { //// [constDeclarations-scopes2.js] +"use strict"; // global const c = "string"; var n; diff --git a/tests/baselines/reference/constDeclarations-useBeforeDefinition.js b/tests/baselines/reference/constDeclarations-useBeforeDefinition.js index e5b5656f4c126..624d4999bd14b 100644 --- a/tests/baselines/reference/constDeclarations-useBeforeDefinition.js +++ b/tests/baselines/reference/constDeclarations-useBeforeDefinition.js @@ -14,6 +14,7 @@ var v1; //// [constDeclarations-useBeforeDefinition.js] +"use strict"; { c1; const c1 = 0; diff --git a/tests/baselines/reference/constDeclarations-useBeforeDefinition2.js b/tests/baselines/reference/constDeclarations-useBeforeDefinition2.js index f75ec813d65f2..6d6488085677b 100644 --- a/tests/baselines/reference/constDeclarations-useBeforeDefinition2.js +++ b/tests/baselines/reference/constDeclarations-useBeforeDefinition2.js @@ -8,5 +8,6 @@ const c = 0; //// [out.js] +"use strict"; c; const c = 0; diff --git a/tests/baselines/reference/constDeclarations-validContexts.errors.txt b/tests/baselines/reference/constDeclarations-validContexts.errors.txt index ea2262681bf38..24f9a4a91235a 100644 --- a/tests/baselines/reference/constDeclarations-validContexts.errors.txt +++ b/tests/baselines/reference/constDeclarations-validContexts.errors.txt @@ -1,7 +1,11 @@ +constDeclarations-validContexts.ts(18,1): error TS1101: 'with' statements are not allowed in strict mode. constDeclarations-validContexts.ts(18,1): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. +constDeclarations-validContexts.ts(31,5): error TS1344: 'A label is not allowed here. +constDeclarations-validContexts.ts(35,21): error TS1344: 'A label is not allowed here. +constDeclarations-validContexts.ts(64,9): error TS1344: 'A label is not allowed here. -==== constDeclarations-validContexts.ts (1 errors) ==== +==== constDeclarations-validContexts.ts (5 errors) ==== // Control flow statements with blocks if (true) { const c1 = 0; @@ -20,6 +24,8 @@ constDeclarations-validContexts.ts(18,1): error TS2410: The 'with' statement is var obj; with (obj) { + ~~~~ +!!! error TS1101: 'with' statements are not allowed in strict mode. ~~~~~~~~~~ !!! error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. const c5 = 0; @@ -35,10 +41,14 @@ constDeclarations-validContexts.ts(18,1): error TS2410: The 'with' statement is if (true) { label: const c8 = 0; + ~~~~~ +!!! error TS1344: 'A label is not allowed here. } while (false) { label2: label3: label4: const c9 = 0; + ~~~~~~ +!!! error TS1344: 'A label is not allowed here. } // Try/catch/finally @@ -68,6 +78,8 @@ constDeclarations-validContexts.ts(18,1): error TS2410: The 'with' statement is { const c16 = 0 label17: const c17 = 0; + ~~~~~~~ +!!! error TS1344: 'A label is not allowed here. } } diff --git a/tests/baselines/reference/constDeclarations-validContexts.js b/tests/baselines/reference/constDeclarations-validContexts.js index 138e4828780c8..c2a6bb9b3cae0 100644 --- a/tests/baselines/reference/constDeclarations-validContexts.js +++ b/tests/baselines/reference/constDeclarations-validContexts.js @@ -124,6 +124,7 @@ var o = { } //// [constDeclarations-validContexts.js] +"use strict"; // Control flow statements with blocks if (true) { const c1 = 0; diff --git a/tests/baselines/reference/constDeclarations.js b/tests/baselines/reference/constDeclarations.js index 1f75520e56e4e..f1f4481fadefc 100644 --- a/tests/baselines/reference/constDeclarations.js +++ b/tests/baselines/reference/constDeclarations.js @@ -13,6 +13,7 @@ for(const c4 = 0; c4 < 9; ) { break; } for(const c5 = 0, c6 = 0; c5 < c6; ) { break; } //// [constDeclarations.js] +"use strict"; // No error const c1 = false; const c2 = 23; diff --git a/tests/baselines/reference/constDeclarations2.js b/tests/baselines/reference/constDeclarations2.js index f95a4755c655a..6f245f4a3b84a 100644 --- a/tests/baselines/reference/constDeclarations2.js +++ b/tests/baselines/reference/constDeclarations2.js @@ -10,6 +10,7 @@ namespace M { //// [constDeclarations2.js] +"use strict"; // No error var M; (function (M) { diff --git a/tests/baselines/reference/constEnum1.js b/tests/baselines/reference/constEnum1.js index 6ba59535def67..e75bdd763a9f4 100644 --- a/tests/baselines/reference/constEnum1.js +++ b/tests/baselines/reference/constEnum1.js @@ -17,6 +17,7 @@ const enum E { } //// [constEnum1.js] +"use strict"; // An enum declaration that specifies a const modifier is a constant enum declaration. // In a constant enum declaration, all members must have constant values and // it is an error for a member declaration to specify an expression that isn't classified as a constant enum expression. diff --git a/tests/baselines/reference/constEnum2.js b/tests/baselines/reference/constEnum2.js index 9cfe7bf79aed4..cd8c29d1c2fc1 100644 --- a/tests/baselines/reference/constEnum2.js +++ b/tests/baselines/reference/constEnum2.js @@ -16,6 +16,7 @@ const enum D { } //// [constEnum2.js] +"use strict"; // An enum declaration that specifies a const modifier is a constant enum declaration. // In a constant enum declaration, all members must have constant values and // it is an error for a member declaration to specify an expression that isn't classified as a constant enum expression. diff --git a/tests/baselines/reference/constEnum3.js b/tests/baselines/reference/constEnum3.js index edebf31507c66..68ec355cc3055 100644 --- a/tests/baselines/reference/constEnum3.js +++ b/tests/baselines/reference/constEnum3.js @@ -14,6 +14,7 @@ f2('bar') //// [constEnum3.js] +"use strict"; function f1(f) { } function f2(f) { } f1(0 /* TestType.foo */); diff --git a/tests/baselines/reference/constEnum4.js b/tests/baselines/reference/constEnum4.js index 9cb33751f3605..ca2d27ed0fd4c 100644 --- a/tests/baselines/reference/constEnum4.js +++ b/tests/baselines/reference/constEnum4.js @@ -10,6 +10,7 @@ else //// [constEnum4.js] +"use strict"; if (1) ; else if (2) diff --git a/tests/baselines/reference/constEnumBadPropertyNames.js b/tests/baselines/reference/constEnumBadPropertyNames.js index 50191e7ca2670..fa511254cc547 100644 --- a/tests/baselines/reference/constEnumBadPropertyNames.js +++ b/tests/baselines/reference/constEnumBadPropertyNames.js @@ -5,4 +5,5 @@ const enum E { A } var x = E["B"] //// [constEnumBadPropertyNames.js] +"use strict"; var x = E["B"]; diff --git a/tests/baselines/reference/constEnumDeclarations.js b/tests/baselines/reference/constEnumDeclarations.js index 09f07ce0315d8..4e71462600ea5 100644 --- a/tests/baselines/reference/constEnumDeclarations.js +++ b/tests/baselines/reference/constEnumDeclarations.js @@ -14,6 +14,7 @@ const enum E2 { } //// [constEnumDeclarations.js] +"use strict"; //// [constEnumDeclarations.d.ts] diff --git a/tests/baselines/reference/constEnumErrors.js b/tests/baselines/reference/constEnumErrors.js index 7a0fe892e27fd..880860fecc602 100644 --- a/tests/baselines/reference/constEnumErrors.js +++ b/tests/baselines/reference/constEnumErrors.js @@ -47,6 +47,7 @@ const enum NaNOrInfinity { } //// [constEnumErrors.js] +"use strict"; var E; (function (E) { var x = 1; diff --git a/tests/baselines/reference/constEnumOnlyModuleMerging.js b/tests/baselines/reference/constEnumOnlyModuleMerging.js index 4bcd24bf59e70..22c160607e205 100644 --- a/tests/baselines/reference/constEnumOnlyModuleMerging.js +++ b/tests/baselines/reference/constEnumOnlyModuleMerging.js @@ -16,6 +16,7 @@ namespace B { } //// [constEnumOnlyModuleMerging.js] +"use strict"; var Outer; (function (Outer) { Outer.x = 1; diff --git a/tests/baselines/reference/constEnumPropertyAccess1.js b/tests/baselines/reference/constEnumPropertyAccess1.js index a4f27035f15d2..6beeb5f4c7dd5 100644 --- a/tests/baselines/reference/constEnumPropertyAccess1.js +++ b/tests/baselines/reference/constEnumPropertyAccess1.js @@ -33,6 +33,7 @@ class C { //// [constEnumPropertyAccess1.js] +"use strict"; // constant enum declarations are completely erased in the emitted JavaScript code. // it is an error to reference a constant enum object in any other context // than a property access that selects one of the enum's members diff --git a/tests/baselines/reference/constEnumPropertyAccess2.js b/tests/baselines/reference/constEnumPropertyAccess2.js index 27d97b1f13c15..5e646e0653a8f 100644 --- a/tests/baselines/reference/constEnumPropertyAccess2.js +++ b/tests/baselines/reference/constEnumPropertyAccess2.js @@ -22,6 +22,7 @@ G.B = 3; //// [constEnumPropertyAccess2.js] +"use strict"; // constant enum declarations are completely erased in the emitted JavaScript code. // it is an error to reference a constant enum object in any other context // than a property access that selects one of the enum's members diff --git a/tests/baselines/reference/constEnumPropertyAccess3.js b/tests/baselines/reference/constEnumPropertyAccess3.js index b7f184d281e5f..dcd15882b1028 100644 --- a/tests/baselines/reference/constEnumPropertyAccess3.js +++ b/tests/baselines/reference/constEnumPropertyAccess3.js @@ -22,6 +22,7 @@ E["E"].toString(); //// [constEnumPropertyAccess3.js] +"use strict"; (-2 /* E.A */).toString(); (-1 /* E.B */).toString(); (-3 /* E.C */).toString(); diff --git a/tests/baselines/reference/constEnumSyntheticNodesComments.js b/tests/baselines/reference/constEnumSyntheticNodesComments.js index 3993842b6bb80..786e5c859f3bf 100644 --- a/tests/baselines/reference/constEnumSyntheticNodesComments.js +++ b/tests/baselines/reference/constEnumSyntheticNodesComments.js @@ -21,6 +21,7 @@ function verify(a: En) { } //// [constEnumSyntheticNodesComments.js] +"use strict"; function assert(x) { return x; } diff --git a/tests/baselines/reference/constEnumToStringNoComments.js b/tests/baselines/reference/constEnumToStringNoComments.js index 7a3d8e0db0eea..d4c67f66245fc 100644 --- a/tests/baselines/reference/constEnumToStringNoComments.js +++ b/tests/baselines/reference/constEnumToStringNoComments.js @@ -25,6 +25,7 @@ let c1 = Foo["C"].toString(); //// [constEnumToStringNoComments.js] +"use strict"; let x0 = 100..toString(); let x1 = 100..toString(); let y0 = 0.5.toString(); diff --git a/tests/baselines/reference/constEnumToStringWithComments.js b/tests/baselines/reference/constEnumToStringWithComments.js index 0cfe20659f8f7..7ea4d8cc34973 100644 --- a/tests/baselines/reference/constEnumToStringWithComments.js +++ b/tests/baselines/reference/constEnumToStringWithComments.js @@ -25,6 +25,7 @@ let c1 = Foo["C"].toString(); //// [constEnumToStringWithComments.js] +"use strict"; let x0 = 100 /* Foo.X */.toString(); let x1 = 100 /* Foo["X"] */.toString(); let y0 = 0.5 /* Foo.Y */.toString(); diff --git a/tests/baselines/reference/constEnums.errors.txt b/tests/baselines/reference/constEnums.errors.txt new file mode 100644 index 0000000000000..2334311cad334 --- /dev/null +++ b/tests/baselines/reference/constEnums.errors.txt @@ -0,0 +1,184 @@ +constEnums.ts(158,27): error TS2366: Function lacks ending return statement and return type does not include 'undefined'. + + +==== constEnums.ts (1 errors) ==== + const enum Enum1 { + A0 = 100, + } + + const enum Enum1 { + // correct cases + A, + B, + C = 10, + D = A | B, + E = A | 1, + F = 1 | A, + G = (1 & 1), + H = ~(A | B), + I = A >>> 1, + J = 1 & A, + K = ~(1 | 5), + L = ~D, + M = E << B, + N = E << 1, + O = E >> B, + P = E >> 1, + PQ = E ** 2, + Q = -D, + R = C & 5, + S = 5 & C, + T = C | D, + U = C | 1, + V = 10 | D, + W = Enum1.V, + + // correct cases: reference to the enum member from different enum declaration + W1 = A0, + W2 = Enum1.A0, + W3 = Enum1["A0"], + W4 = Enum1["W"], + W5 = Enum1[`V`], + } + + const enum Comments { + "//", + "/*", + "*/", + "///", + "#", + "", + } + + namespace A { + export namespace B { + export namespace C { + export const enum E { + V1 = 1, + V2 = A.B.C.E.V1 | 100 + } + } + } + } + + namespace A { + export namespace B { + export namespace C { + export const enum E { + V3 = A.B.C.E["V2"] & 200, + V4 = A.B.C.E[`V1`] << 1, + } + } + } + } + + namespace A1 { + export namespace B { + export namespace C { + export const enum E { + V1 = 10, + V2 = 110, + } + } + } + } + + namespace A2 { + export namespace B { + export namespace C { + export const enum E { + V1 = 10, + V2 = 110, + } + } + // module C will be classified as value + export namespace C { + var x = 1 + } + } + } + + import I = A.B.C.E; + import I1 = A1.B; + import I2 = A2.B; + + function foo0(e: I): void { + if (e === I.V1) { + } + else if (e === I.V2) { + } + } + + function foo1(e: I1.C.E): void { + if (e === I1.C.E.V1) { + } + else if (e === I1.C.E.V2) { + } + } + + function foo2(e: I2.C.E): void { + if (e === I2.C.E.V1) { + } + else if (e === I2.C.E.V2) { + } + } + + + function foo(x: Enum1) { + switch (x) { + case Enum1.A: + case Enum1.B: + case Enum1.C: + case Enum1.D: + case Enum1.E: + case Enum1.F: + case Enum1.G: + case Enum1.H: + case Enum1.I: + case Enum1.J: + case Enum1.K: + case Enum1.L: + case Enum1.M: + case Enum1.N: + case Enum1.O: + case Enum1.P: + case Enum1.PQ: + case Enum1.Q: + case Enum1.R: + case Enum1.S: + case Enum1["T"]: + case Enum1[`U`]: + case Enum1.V: + case Enum1.W: + case Enum1.W1: + case Enum1.W2: + case Enum1.W3: + case Enum1.W4: + break; + } + } + + function bar(e: A.B.C.E): number { + ~~~~~~ +!!! error TS2366: Function lacks ending return statement and return type does not include 'undefined'. + switch (e) { + case A.B.C.E.V1: return 1; + case A.B.C.E.V2: return 1; + case A.B.C.E.V3: return 1; + } + } + + function baz(c: Comments) { + switch (c) { + case Comments["//"]: + case Comments["/*"]: + case Comments["*/"]: + case Comments["///"]: + case Comments["#"]: + case Comments[""]: + break; + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/constEnums.js b/tests/baselines/reference/constEnums.js index ba03bac51cfad..04ca74a7ad139 100644 --- a/tests/baselines/reference/constEnums.js +++ b/tests/baselines/reference/constEnums.js @@ -181,6 +181,7 @@ function baz(c: Comments) { //// [constEnums.js] +"use strict"; var A2; (function (A2) { let B; diff --git a/tests/baselines/reference/constInClassExpression.js b/tests/baselines/reference/constInClassExpression.js index a86f02ef41c60..eec100df7fea0 100644 --- a/tests/baselines/reference/constInClassExpression.js +++ b/tests/baselines/reference/constInClassExpression.js @@ -7,6 +7,7 @@ let C = class { //// [constInClassExpression.js] +"use strict"; let C = class { constructor() { this.a = 4; diff --git a/tests/baselines/reference/constIndexedAccess.errors.txt b/tests/baselines/reference/constIndexedAccess.errors.txt new file mode 100644 index 0000000000000..ec74aacb666e3 --- /dev/null +++ b/tests/baselines/reference/constIndexedAccess.errors.txt @@ -0,0 +1,56 @@ +constIndexedAccess.ts(13,9): error TS2454: Variable 'test' is used before being assigned. +constIndexedAccess.ts(14,9): error TS2454: Variable 'test' is used before being assigned. +constIndexedAccess.ts(16,10): error TS2454: Variable 'test' is used before being assigned. +constIndexedAccess.ts(17,10): error TS2454: Variable 'test' is used before being assigned. +constIndexedAccess.ts(19,10): error TS2454: Variable 'test' is used before being assigned. +constIndexedAccess.ts(20,10): error TS2454: Variable 'test' is used before being assigned. +constIndexedAccess.ts(27,10): error TS2454: Variable 'test' is used before being assigned. +constIndexedAccess.ts(28,10): error TS2454: Variable 'test' is used before being assigned. + + +==== constIndexedAccess.ts (8 errors) ==== + const enum numbers { + zero, + one + } + + interface indexAccess { + 0: string; + 1: number; + } + + let test: indexAccess; + + let s = test[0]; + ~~~~ +!!! error TS2454: Variable 'test' is used before being assigned. + let n = test[1]; + ~~~~ +!!! error TS2454: Variable 'test' is used before being assigned. + + let s1 = test[numbers.zero]; + ~~~~ +!!! error TS2454: Variable 'test' is used before being assigned. + let n1 = test[numbers.one]; + ~~~~ +!!! error TS2454: Variable 'test' is used before being assigned. + + let s2 = test[numbers["zero"]]; + ~~~~ +!!! error TS2454: Variable 'test' is used before being assigned. + let n2 = test[numbers["one"]]; + ~~~~ +!!! error TS2454: Variable 'test' is used before being assigned. + + enum numbersNotConst { + zero, + one + } + + let s3 = test[numbersNotConst.zero]; + ~~~~ +!!! error TS2454: Variable 'test' is used before being assigned. + let n3 = test[numbersNotConst.one]; + ~~~~ +!!! error TS2454: Variable 'test' is used before being assigned. + \ No newline at end of file diff --git a/tests/baselines/reference/constIndexedAccess.js b/tests/baselines/reference/constIndexedAccess.js index d8a02df3c314a..b4276a5ba484d 100644 --- a/tests/baselines/reference/constIndexedAccess.js +++ b/tests/baselines/reference/constIndexedAccess.js @@ -32,6 +32,7 @@ let n3 = test[numbersNotConst.one]; //// [constIndexedAccess.js] +"use strict"; let test; let s = test[0]; let n = test[1]; diff --git a/tests/baselines/reference/constLocalsInFunctionExpressions.js b/tests/baselines/reference/constLocalsInFunctionExpressions.js index b1e4ffe8e04e1..d210dcd4e2a49 100644 --- a/tests/baselines/reference/constLocalsInFunctionExpressions.js +++ b/tests/baselines/reference/constLocalsInFunctionExpressions.js @@ -41,6 +41,7 @@ function f5() { } //// [constLocalsInFunctionExpressions.js] +"use strict"; function f1() { const x = getStringOrNumber(); if (typeof x === "string") { diff --git a/tests/baselines/reference/constWithNonNull.js b/tests/baselines/reference/constWithNonNull.js index 6cf38ad519cf1..51c3584d0cdd9 100644 --- a/tests/baselines/reference/constWithNonNull.js +++ b/tests/baselines/reference/constWithNonNull.js @@ -8,5 +8,6 @@ x!++; //// [constWithNonNull.js] +"use strict"; // Fixes #21848 x++; diff --git a/tests/baselines/reference/constWithNonNull.types b/tests/baselines/reference/constWithNonNull.types index 74712c8f56cb2..fd0a094628d1e 100644 --- a/tests/baselines/reference/constWithNonNull.types +++ b/tests/baselines/reference/constWithNonNull.types @@ -4,8 +4,8 @@ // Fixes #21848 declare const x: number | undefined; ->x : number -> : ^^^^^^ +>x : number | undefined +> : ^^^^^^^^^^^^^^^^^^ x!++; >x!++ : number diff --git a/tests/baselines/reference/constantEnumAssert.js b/tests/baselines/reference/constantEnumAssert.js index ce06e50ac0fdf..8f7150b8afdf3 100644 --- a/tests/baselines/reference/constantEnumAssert.js +++ b/tests/baselines/reference/constantEnumAssert.js @@ -53,6 +53,7 @@ const foo12 = { a: E5.a as const } //// [constantEnumAssert.js] +"use strict"; var E1; (function (E1) { E1[E1["a"] = 0] = "a"; diff --git a/tests/baselines/reference/constantOverloadFunction.errors.txt b/tests/baselines/reference/constantOverloadFunction.errors.txt new file mode 100644 index 0000000000000..b45cb7c66050f --- /dev/null +++ b/tests/baselines/reference/constantOverloadFunction.errors.txt @@ -0,0 +1,19 @@ +constantOverloadFunction.ts(11,5): error TS2322: Type 'null' is not assignable to type 'Base'. + + +==== constantOverloadFunction.ts (1 errors) ==== + class Base { foo() { } } + class Derived1 extends Base { bar() { } } + class Derived2 extends Base { baz() { } } + class Derived3 extends Base { biz() { } } + + function foo(tagName: 'canvas'): Derived1; + function foo(tagName: 'div'): Derived2; + function foo(tagName: 'span'): Derived3; + function foo(tagName: string): Base; + function foo(tagName: any): Base { + return null; + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'Base'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/constantOverloadFunction.js b/tests/baselines/reference/constantOverloadFunction.js index 278398b8aafcd..78a20cf180344 100644 --- a/tests/baselines/reference/constantOverloadFunction.js +++ b/tests/baselines/reference/constantOverloadFunction.js @@ -16,6 +16,7 @@ function foo(tagName: any): Base { //// [constantOverloadFunction.js] +"use strict"; class Base { foo() { } } diff --git a/tests/baselines/reference/constantOverloadFunction.types b/tests/baselines/reference/constantOverloadFunction.types index 4a7b2d87e01c3..1d1203d35c8f2 100644 --- a/tests/baselines/reference/constantOverloadFunction.types +++ b/tests/baselines/reference/constantOverloadFunction.types @@ -59,6 +59,7 @@ function foo(tagName: any): Base { >foo : { (tagName: "canvas"): Derived1; (tagName: "div"): Derived2; (tagName: "span"): Derived3; (tagName: string): Base; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >tagName : any +> : ^^^ return null; } diff --git a/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.errors.txt b/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.errors.txt new file mode 100644 index 0000000000000..06b029bc8d8c3 --- /dev/null +++ b/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.errors.txt @@ -0,0 +1,20 @@ +constantOverloadFunctionNoSubtypeError.ts(12,5): error TS2322: Type 'null' is not assignable to type 'Base'. + + +==== constantOverloadFunctionNoSubtypeError.ts (1 errors) ==== + class Base { foo() { } } + class Derived1 extends Base { bar() { } } + class Derived2 extends Base { baz() { } } + class Derived3 extends Base { biz() { } } + + function foo(tagName: 'canvas'): Derived3; + function foo(tagName: 'div'): Derived2; + function foo(tagName: 'span'): Derived1; + function foo(tagName: number): Base; + function foo(tagName: any): Base { + + return null; + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'Base'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js b/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js index 499c118588243..dcdfd949b945d 100644 --- a/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js +++ b/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js @@ -17,6 +17,7 @@ function foo(tagName: any): Base { //// [constantOverloadFunctionNoSubtypeError.js] +"use strict"; class Base { foo() { } } diff --git a/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.types b/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.types index c22ff4030d88c..4a75e1592e407 100644 --- a/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.types +++ b/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.types @@ -59,6 +59,7 @@ function foo(tagName: any): Base { >foo : { (tagName: "canvas"): Derived3; (tagName: "div"): Derived2; (tagName: "span"): Derived1; (tagName: number): Base; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >tagName : any +> : ^^^ return null; } diff --git a/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js b/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js index f48728bb56d54..a62f538ddc43e 100644 --- a/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js +++ b/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js @@ -22,6 +22,7 @@ class Container { } //// [constraintCheckInGenericBaseTypeReference.js] +"use strict"; // No errors class Constraint { method() { } diff --git a/tests/baselines/reference/constraintErrors1.js b/tests/baselines/reference/constraintErrors1.js index d981cee962b16..a24f3a77f8f01 100644 --- a/tests/baselines/reference/constraintErrors1.js +++ b/tests/baselines/reference/constraintErrors1.js @@ -4,4 +4,5 @@ function foo5(test: T) { } //// [constraintErrors1.js] +"use strict"; function foo5(test) { } diff --git a/tests/baselines/reference/constraintPropagationThroughReturnTypes.js b/tests/baselines/reference/constraintPropagationThroughReturnTypes.js index e600169dfaa8b..e4c1ccdc0e5a5 100644 --- a/tests/baselines/reference/constraintPropagationThroughReturnTypes.js +++ b/tests/baselines/reference/constraintPropagationThroughReturnTypes.js @@ -12,6 +12,7 @@ function f(x: S) { //// [constraintPropagationThroughReturnTypes.js] +"use strict"; function g(x) { return x; } diff --git a/tests/baselines/reference/constraintReferencingTypeParameterFromSameTypeParameterList.js b/tests/baselines/reference/constraintReferencingTypeParameterFromSameTypeParameterList.js index e918a9ea7299d..7326098f65e36 100644 --- a/tests/baselines/reference/constraintReferencingTypeParameterFromSameTypeParameterList.js +++ b/tests/baselines/reference/constraintReferencingTypeParameterFromSameTypeParameterList.js @@ -27,6 +27,7 @@ function foo(v: V) => void>() { //// [constraintReferencingTypeParameterFromSameTypeParameterList.js] +"use strict"; // used to be valid, now an error to do this function f() { } diff --git a/tests/baselines/reference/constraintSatisfactionWithAny.errors.txt b/tests/baselines/reference/constraintSatisfactionWithAny.errors.txt new file mode 100644 index 0000000000000..407c4bf16f13a --- /dev/null +++ b/tests/baselines/reference/constraintSatisfactionWithAny.errors.txt @@ -0,0 +1,106 @@ +constraintSatisfactionWithAny.ts(3,43): error TS2322: Type 'null' is not assignable to type 'T'. + 'T' could be instantiated with an arbitrary type which could be unrelated to 'null'. +constraintSatisfactionWithAny.ts(4,51): error TS2322: Type 'null' is not assignable to type 'T'. + 'T' could be instantiated with an arbitrary type which could be unrelated to 'null'. +constraintSatisfactionWithAny.ts(6,55): error TS2322: Type 'null' is not assignable to type 'T'. + 'T' could be instantiated with an arbitrary type which could be unrelated to 'null'. +constraintSatisfactionWithAny.ts(8,5): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'String'. +constraintSatisfactionWithAny.ts(9,6): error TS2345: Argument of type 'undefined' is not assignable to parameter of type '{ x: number; }'. +constraintSatisfactionWithAny.ts(11,6): error TS2345: Argument of type 'undefined' is not assignable to parameter of type '(x: T) => void'. +constraintSatisfactionWithAny.ts(14,10): error TS2454: Variable 'b' is used before being assigned. +constraintSatisfactionWithAny.ts(15,11): error TS2454: Variable 'b' is used before being assigned. +constraintSatisfactionWithAny.ts(17,11): error TS2454: Variable 'b' is used before being assigned. +constraintSatisfactionWithAny.ts(27,16): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'String'. +constraintSatisfactionWithAny.ts(28,21): error TS2454: Variable 'b' is used before being assigned. +constraintSatisfactionWithAny.ts(34,17): error TS2345: Argument of type 'undefined' is not assignable to parameter of type '{ x: number; }'. +constraintSatisfactionWithAny.ts(35,22): error TS2454: Variable 'b' is used before being assigned. +constraintSatisfactionWithAny.ts(48,17): error TS2345: Argument of type 'undefined' is not assignable to parameter of type '(x: T) => T'. +constraintSatisfactionWithAny.ts(49,22): error TS2454: Variable 'b' is used before being assigned. + + +==== constraintSatisfactionWithAny.ts (15 errors) ==== + // any is not a valid type argument unless there is no constraint, or the constraint is any + + function foo(x: T): T { return null; } + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'T'. +!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'null'. + function foo2(x: T): T { return null; } + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'T'. +!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'null'. + //function foo3(x: T): T { return null; } + function foo4(x: T) => void>(x: T): T { return null; } + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'T'. +!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'null'. + var a; + foo(a); + ~ +!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'String'. + foo2(a); + ~ +!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type '{ x: number; }'. + //foo3(a); + foo4(a); + ~ +!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type '(x: T) => void'. + + var b: number; + foo(b); + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + foo2(b); + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + //foo3(b); + foo4(b); + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + + //function foo5(x: T, y: U): T { return null; } + //foo5(a, a); + //foo5(b, b); + + class C { + constructor(public x: T) { } + } + + var c1 = new C(a); + ~ +!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'String'. + var c2 = new C(b); + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + + class C2 { + constructor(public x: T) { } + } + + var c3 = new C2(a); + ~ +!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type '{ x: number; }'. + var c4 = new C2(b); + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + + //class C3 { + // constructor(public x: T) { } + //} + + //var c5 = new C3(a); + //var c6 = new C3(b); + + class C4(x:T) => T> { + constructor(public x: T) { } + } + + var c7 = new C4(a); + ~ +!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type '(x: T) => T'. + var c8 = new C4(b); + ~ +!!! error TS2454: Variable 'b' is used before being assigned. + + + \ No newline at end of file diff --git a/tests/baselines/reference/constraintSatisfactionWithAny.js b/tests/baselines/reference/constraintSatisfactionWithAny.js index 89ce17448a845..cce97bc882942 100644 --- a/tests/baselines/reference/constraintSatisfactionWithAny.js +++ b/tests/baselines/reference/constraintSatisfactionWithAny.js @@ -55,6 +55,7 @@ var c8 = new C4(b); //// [constraintSatisfactionWithAny.js] +"use strict"; // any is not a valid type argument unless there is no constraint, or the constraint is any function foo(x) { return null; } function foo2(x) { return null; } diff --git a/tests/baselines/reference/constraintSatisfactionWithAny.types b/tests/baselines/reference/constraintSatisfactionWithAny.types index 20c51d8b19499..c389bee20175d 100644 --- a/tests/baselines/reference/constraintSatisfactionWithAny.types +++ b/tests/baselines/reference/constraintSatisfactionWithAny.types @@ -28,25 +28,32 @@ function foo4(x: T) => void>(x: T): T { return null; } var a; >a : any +> : ^^^ foo(a); ->foo(a) : any +>foo(a) : String +> : ^^^^^^ >foo : (x: T) => T > : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ ->a : any +>a : undefined +> : ^^^^^^^^^ foo2(a); ->foo2(a) : any +>foo2(a) : { x: number; } +> : ^^^^^ ^^^ >foo2 : (x: T) => T > : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ ->a : any +>a : undefined +> : ^^^^^^^^^ //foo3(a); foo4(a); ->foo4(a) : any +>foo4(a) : (x: T) => void +> : ^ ^^ ^^ ^^^^^ >foo4 : (x: T_1) => void>(x: T) => T > : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ ->a : any +>a : undefined +> : ^^^^^^^^^ var b: number; >b : number @@ -54,6 +61,7 @@ var b: number; foo(b); >foo(b) : any +> : ^^^ >foo : (x: T) => T > : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ >b : number @@ -61,6 +69,7 @@ foo(b); foo2(b); >foo2(b) : any +> : ^^^ >foo2 : (x: T) => T > : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ >b : number @@ -69,6 +78,7 @@ foo2(b); //foo3(b); foo4(b); >foo4(b) : any +> : ^^^ >foo4 : (x: T_1) => void>(x: T) => T > : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ >b : number @@ -88,13 +98,14 @@ class C { } var c1 = new C(a); ->c1 : C -> : ^^^^^^ ->new C(a) : C -> : ^^^^^^ +>c1 : C +> : ^^^^^^^^^ +>new C(a) : C +> : ^^^^^^^^^ >C : typeof C > : ^^^^^^^^ ->a : any +>a : undefined +> : ^^^^^^^^^ var c2 = new C(b); >c2 : C @@ -118,13 +129,14 @@ class C2 { } var c3 = new C2(a); ->c3 : C2 -> : ^^^^^^^ ->new C2(a) : C2 -> : ^^^^^^^ +>c3 : C2<{ x: number; }> +> : ^^^^^^^^ ^^^^ +>new C2(a) : C2<{ x: number; }> +> : ^^^^^^^^ ^^^^ >C2 : typeof C2 > : ^^^^^^^^^ ->a : any +>a : undefined +> : ^^^^^^^^^ var c4 = new C2(b); >c4 : C2 @@ -155,13 +167,14 @@ class C4(x:T) => T> { } var c7 = new C4(a); ->c7 : C4 -> : ^^^^^^^ ->new C4(a) : C4 -> : ^^^^^^^ +>c7 : C4<((x: T) => T)> +> : ^^^^^ ^^ ^^ ^^^^^ ^^ +>new C4(a) : C4<((x: T) => T)> +> : ^^^^^ ^^ ^^ ^^^^^ ^^ >C4 : typeof C4 > : ^^^^^^^^^ ->a : any +>a : undefined +> : ^^^^^^^^^ var c8 = new C4(b); >c8 : C4 diff --git a/tests/baselines/reference/constraintSatisfactionWithAny2.js b/tests/baselines/reference/constraintSatisfactionWithAny2.js index c357bb6003d62..258ccc681bc97 100644 --- a/tests/baselines/reference/constraintSatisfactionWithAny2.js +++ b/tests/baselines/reference/constraintSatisfactionWithAny2.js @@ -11,6 +11,7 @@ foo(a); foo(a); //// [constraintSatisfactionWithAny2.js] +"use strict"; // errors expected for type parameter cannot be referenced in the constraints of the same list // any is not a valid type argument unless there is no constraint, or the constraint is any var a; diff --git a/tests/baselines/reference/constraintSatisfactionWithEmptyObject.js b/tests/baselines/reference/constraintSatisfactionWithEmptyObject.js index 28ec36f6ca641..8a2fa5a40fef5 100644 --- a/tests/baselines/reference/constraintSatisfactionWithEmptyObject.js +++ b/tests/baselines/reference/constraintSatisfactionWithEmptyObject.js @@ -40,6 +40,7 @@ var i2: I2<{}>; //// [constraintSatisfactionWithEmptyObject.js] +"use strict"; // valid uses of a basic object constraint, no errors expected // Object constraint function foo(x) { } diff --git a/tests/baselines/reference/constraints0.js b/tests/baselines/reference/constraints0.js index be31d52823fd3..c14914af7a5a5 100644 --- a/tests/baselines/reference/constraints0.js +++ b/tests/baselines/reference/constraints0.js @@ -19,4 +19,5 @@ declare var v2: C; // should not work var y = v1.x.a; // 'a' should be of type 'number' //// [constraints0.js] +"use strict"; var y = v1.x.a; // 'a' should be of type 'number' diff --git a/tests/baselines/reference/constraintsThatReferenceOtherContstraints1.errors.txt b/tests/baselines/reference/constraintsThatReferenceOtherContstraints1.errors.txt new file mode 100644 index 0000000000000..268ea206e5132 --- /dev/null +++ b/tests/baselines/reference/constraintsThatReferenceOtherContstraints1.errors.txt @@ -0,0 +1,15 @@ +constraintsThatReferenceOtherContstraints1.ts(5,5): error TS2564: Property 'data' has no initializer and is not definitely assigned in the constructor. + + +==== constraintsThatReferenceOtherContstraints1.ts (1 errors) ==== + interface Object { } + + class Foo { } + class Bar { + data: Foo; // Error 1 Type 'Object' does not satisfy the constraint 'T' for type parameter 'U extends T'. + ~~~~ +!!! error TS2564: Property 'data' has no initializer and is not definitely assigned in the constructor. + } + + var x: Foo< { a: string }, { a: string; b: number }>; // Error 2 Type '{ a: string; b: number; }' does not satisfy the constraint 'T' for type + \ No newline at end of file diff --git a/tests/baselines/reference/constraintsThatReferenceOtherContstraints1.js b/tests/baselines/reference/constraintsThatReferenceOtherContstraints1.js index ff60e0b08a7c3..483085872ba29 100644 --- a/tests/baselines/reference/constraintsThatReferenceOtherContstraints1.js +++ b/tests/baselines/reference/constraintsThatReferenceOtherContstraints1.js @@ -12,6 +12,7 @@ var x: Foo< { a: string }, { a: string; b: number }>; // Error 2 Type '{ a: stri //// [constraintsThatReferenceOtherContstraints1.js] +"use strict"; class Foo { } class Bar { diff --git a/tests/baselines/reference/constraintsUsedInPrototypeProperty.js b/tests/baselines/reference/constraintsUsedInPrototypeProperty.js index d83b18cbfd33e..1f7ec7da14f98 100644 --- a/tests/baselines/reference/constraintsUsedInPrototypeProperty.js +++ b/tests/baselines/reference/constraintsUsedInPrototypeProperty.js @@ -5,6 +5,7 @@ class Foo { } Foo.prototype; // Foo //// [constraintsUsedInPrototypeProperty.js] +"use strict"; class Foo { } Foo.prototype; // Foo diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance.js index 47dfc0185f722..9b67fe4977b43 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance.js @@ -74,6 +74,7 @@ namespace MemberWithConstructSignature { } //// [constructSignatureAssignabilityInInheritance.js] +"use strict"; // Checking basic subtype relations with construct signatures var MemberWithConstructSignature; (function (MemberWithConstructSignature) { diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.errors.txt b/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.errors.txt new file mode 100644 index 0000000000000..f13457cd15b15 --- /dev/null +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.errors.txt @@ -0,0 +1,84 @@ +constructSignatureAssignabilityInInheritance2.ts(3,14): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. +constructSignatureAssignabilityInInheritance2.ts(4,30): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. +constructSignatureAssignabilityInInheritance2.ts(5,34): error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. +constructSignatureAssignabilityInInheritance2.ts(6,35): error TS2564: Property 'bing' has no initializer and is not definitely assigned in the constructor. + + +==== constructSignatureAssignabilityInInheritance2.ts (4 errors) ==== + // checking subtype relations for function types as it relates to contextual signature instantiation + + class Base { foo: string; } + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. + class Derived extends Base { bar: string; } + ~~~ +!!! error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. + class Derived2 extends Derived { baz: string; } + ~~~ +!!! error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. + class OtherDerived extends Base { bing: string; } + ~~~~ +!!! error TS2564: Property 'bing' has no initializer and is not definitely assigned in the constructor. + + interface A { // T + // M's + a: new (x: number) => number[]; + a2: new (x: number) => string[]; + a3: new (x: number) => void; + a4: new (x: string, y: number) => string; + a5: new (x: (arg: string) => number) => string; + a6: new (x: (arg: Base) => Derived) => Base; + a7: new (x: (arg: Base) => Derived) => (r: Base) => Derived; + a8: new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; + a9: new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; + a10: new (...x: Derived[]) => Derived; + a11: new (x: { foo: string }, y: { foo: string; bar: string }) => Base; + a12: new (x: Array, y: Array) => Array; + a13: new (x: Array, y: Array) => Array; + a14: new (x: { a: string; b: number }) => Object; + a15: { + new (x: number): number[]; + new (x: string): string[]; + }; + a16: { + new (x: T): number[]; + new (x: U): number[]; + }; + a17: { + new (x: new (a: number) => number): number[]; + new (x: new (a: string) => string): string[]; + }; + a18: { + new (x: { + new (a: number): number; + new (a: string): string; + }): any[]; + new (x: { + new (a: boolean): boolean; + new (a: Date): Date; + }): any[]; + }; + } + + // S's + interface I extends A { + // N's + a: new (x: T) => T[]; // ok, instantiation of N is a subtype of M, T is number + a2: new (x: T) => string[]; // ok + a3: new (x: T) => T; // ok since Base returns void + a4: new (x: T, y: U) => T; // ok, instantiation of N is a subtype of M, T is string, U is number + a5: new (x: (arg: T) => U) => T; // ok, U is in a parameter position so inferences can be made + a6: new (x: (arg: T) => U) => T; // ok, same as a5 but with object type hierarchy + a7: new (x: (arg: T) => U) => (r: T) => U; // ok + a8: new (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U; // ok + a9: new (x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U; // ok, same as a8 with compatible object literal + a10: new (...x: T[]) => T; // ok + a11: new (x: T, y: T) => T; // ok + a12: new >(x: Array, y: T) => Array; // ok, less specific parameter type + a13: new >(x: Array, y: T) => T; // ok, T = Array, satisfies constraint, contextual signature instantiation succeeds + a14: new (x: { a: T; b: U }) => T; // ok + a15: new (x: T) => T[]; // ok + a16: new (x: T) => number[]; // ok + a17: new (x: new (a: T) => T) => T[]; // ok + a18: new (x: new (a: T) => T) => T[]; // ok, no inferences for T but assignable to any + } \ No newline at end of file diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.js index 739d841ea40fd..06903dad95404 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.js @@ -72,6 +72,7 @@ interface I extends A { } //// [constructSignatureAssignabilityInInheritance2.js] +"use strict"; // checking subtype relations for function types as it relates to contextual signature instantiation class Base { } diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt index 6256795a9b973..564ffa3896a73 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt @@ -1,3 +1,7 @@ +constructSignatureAssignabilityInInheritance3.ts(5,18): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. +constructSignatureAssignabilityInInheritance3.ts(6,34): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. +constructSignatureAssignabilityInInheritance3.ts(7,38): error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. +constructSignatureAssignabilityInInheritance3.ts(8,39): error TS2564: Property 'bing' has no initializer and is not definitely assigned in the constructor. constructSignatureAssignabilityInInheritance3.ts(41,19): error TS2430: Interface 'I2' incorrectly extends interface 'A'. Types of property 'a2' are incompatible. Type 'new (x: T) => U[]' is not assignable to type 'new (x: number) => string[]'. @@ -12,6 +16,16 @@ constructSignatureAssignabilityInInheritance3.ts(50,19): error TS2430: Interface Type '{ foo: number; }' is not assignable to type 'Base'. Types of property 'foo' are incompatible. Type 'number' is not assignable to type 'string'. +constructSignatureAssignabilityInInheritance3.ts(54,19): error TS2430: Interface 'I4B' incorrectly extends interface 'A'. + Types of property 'a10' are incompatible. + Type 'new (...x: T[]) => T' is not assignable to type 'new (...x: Base[]) => Base'. + Types of parameters 'x' and 'x' are incompatible. + Property 'bar' is missing in type 'Base' but required in type 'Derived'. +constructSignatureAssignabilityInInheritance3.ts(58,19): error TS2430: Interface 'I4C' incorrectly extends interface 'A'. + Types of property 'a11' are incompatible. + Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base'. + Types of parameters 'x' and 'x' are incompatible. + Property 'bar' is missing in type '{ foo: string; }' but required in type 'Derived'. constructSignatureAssignabilityInInheritance3.ts(66,19): error TS2430: Interface 'I6' incorrectly extends interface 'A'. Types of property 'a15' are incompatible. Type 'new (x: { a: T; b: T; }) => T' is not assignable to type 'new (x: { a: string; b: number; }) => number'. @@ -37,15 +51,23 @@ constructSignatureAssignabilityInInheritance3.ts(95,19): error TS2430: Interface Type 'T' is not assignable to type 'string'. -==== constructSignatureAssignabilityInInheritance3.ts (6 errors) ==== +==== constructSignatureAssignabilityInInheritance3.ts (12 errors) ==== // checking subtype relations for function types as it relates to contextual signature instantiation // error cases namespace Errors { class Base { foo: string; } + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. class Derived extends Base { bar: string; } + ~~~ +!!! error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. class Derived2 extends Derived { baz: string; } + ~~~ +!!! error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. class OtherDerived extends Base { bing: string; } + ~~~~ +!!! error TS2564: Property 'bing' has no initializer and is not definitely assigned in the constructor. namespace WithNonGenericSignaturesInBaseType { // base type with non-generic call signatures @@ -108,10 +130,24 @@ constructSignatureAssignabilityInInheritance3.ts(95,19): error TS2430: Interface } interface I4B extends A { + ~~~ +!!! error TS2430: Interface 'I4B' incorrectly extends interface 'A'. +!!! error TS2430: Types of property 'a10' are incompatible. +!!! error TS2430: Type 'new (...x: T[]) => T' is not assignable to type 'new (...x: Base[]) => Base'. +!!! error TS2430: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2430: Property 'bar' is missing in type 'Base' but required in type 'Derived'. +!!! related TS2728 constructSignatureAssignabilityInInheritance3.ts:6:34: 'bar' is declared here. a10: new (...x: T[]) => T; // valid, parameter covariance works even after contextual signature instantiation } interface I4C extends A { + ~~~ +!!! error TS2430: Interface 'I4C' incorrectly extends interface 'A'. +!!! error TS2430: Types of property 'a11' are incompatible. +!!! error TS2430: Type 'new (x: T, y: T) => T' is not assignable to type 'new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base'. +!!! error TS2430: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2430: Property 'bar' is missing in type '{ foo: string; }' but required in type 'Derived'. +!!! related TS2728 constructSignatureAssignabilityInInheritance3.ts:6:34: 'bar' is declared here. a11: new (x: T, y: T) => T; // valid, even though x is a Base, parameter covariance works even after contextual signature instantiation } diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.js index 53475b03fe840..c6c526dc9f065 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.js @@ -114,6 +114,7 @@ namespace Errors { } //// [constructSignatureAssignabilityInInheritance3.js] +"use strict"; // checking subtype relations for function types as it relates to contextual signature instantiation // error cases var Errors; diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.types b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.types index 6aa19f9b3c73b..a9cd2152e987b 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.types +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.types @@ -136,8 +136,8 @@ namespace Errors { > : ^^^^^^ new (a?: number): number; ->a : number -> : ^^^^^^ +>a : number | undefined +> : ^^^^^^^^^^^^^^^^^^ }): number[]; new (x: { @@ -149,8 +149,8 @@ namespace Errors { > : ^^^^^^^ new (a?: boolean): boolean; ->a : boolean -> : ^^^^^^^ +>a : boolean | undefined +> : ^^^^^^^^^^^^^^^^^^^ }): boolean[]; }; diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.errors.txt b/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.errors.txt new file mode 100644 index 0000000000000..6e87e83068551 --- /dev/null +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.errors.txt @@ -0,0 +1,74 @@ +constructSignatureAssignabilityInInheritance4.ts(3,14): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. +constructSignatureAssignabilityInInheritance4.ts(4,30): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. +constructSignatureAssignabilityInInheritance4.ts(5,34): error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. +constructSignatureAssignabilityInInheritance4.ts(6,35): error TS2564: Property 'bing' has no initializer and is not definitely assigned in the constructor. + + +==== constructSignatureAssignabilityInInheritance4.ts (4 errors) ==== + // checking subtype relations for function types as it relates to contextual signature instantiation + + class Base { foo: string; } + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. + class Derived extends Base { bar: string; } + ~~~ +!!! error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. + class Derived2 extends Derived { baz: string; } + ~~~ +!!! error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. + class OtherDerived extends Base { bing: string; } + ~~~~ +!!! error TS2564: Property 'bing' has no initializer and is not definitely assigned in the constructor. + + interface A { // T + // M's + a: new (x: T) => T[]; + a2: new (x: T) => string[]; + a3: new (x: T) => void; + a4: new (x: T, y: U) => string; + a5: new (x: (arg: T) => U) => T; + a6: new (x: (arg: T) => Derived) => T; + a11: new (x: { foo: T }, y: { foo: T; bar: T }) => Base; + a15: new (x: { a: T; b: T }) => T[]; + a16: new (x: { a: T; b: T }) => T[]; + a17: { + new (x: T): T[]; + new (x: U): U[]; + }; + a18: { + new (x: T): number[]; + new (x: U): number[]; + }; + a19: { + new (x: new (a: T) => T): T[]; + new (x: new (a: U) => U): U[]; + }; + a20: { + new (x: { + new (a: T): T; + new (a: U): U; + }): any[]; + new (x: { + new (a: T): T; + new (a: U): U; + }): any[]; + }; + } + + // S's + interface I extends A { + // N's + a: new (x: T) => T[]; // ok, instantiation of N is a subtype of M, T is number + a2: new (x: T) => string[]; // ok + a3: new (x: T) => T; // ok since Base returns void + a4: new (x: T, y: U) => string; // ok, instantiation of N is a subtype of M, T is string, U is number + a5: new (x: (arg: T) => U) => T; // ok, U is in a parameter position so inferences can be made + a6: new (x: (arg: T) => U) => T; // ok, same as a5 but with object type hierarchy + a11: new (x: { foo: T }, y: { foo: U; bar: U }) => Base; // ok + a15: new (x: { a: U; b: V; }) => U[]; // ok, T = U, T = V + a16: new (x: { a: T; b: T }) => T[]; // ok, more general parameter type + a17: new (x: T) => T[]; // ok, more general parameter type + a18: new (x: T) => number[]; // ok, more general parameter type + a19: new (x: new (a: T) => T) => T[]; // ok + a20: new (x: new (a: T) => T) => any[]; // ok + } \ No newline at end of file diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.js index 806052f1e4813..839fd37fe109c 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.js @@ -62,6 +62,7 @@ interface I extends A { } //// [constructSignatureAssignabilityInInheritance4.js] +"use strict"; // checking subtype relations for function types as it relates to contextual signature instantiation class Base { } diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.errors.txt b/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.errors.txt new file mode 100644 index 0000000000000..6f546530cbbcd --- /dev/null +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.errors.txt @@ -0,0 +1,63 @@ +constructSignatureAssignabilityInInheritance5.ts(4,14): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. +constructSignatureAssignabilityInInheritance5.ts(5,30): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. +constructSignatureAssignabilityInInheritance5.ts(6,34): error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. +constructSignatureAssignabilityInInheritance5.ts(7,35): error TS2564: Property 'bing' has no initializer and is not definitely assigned in the constructor. + + +==== constructSignatureAssignabilityInInheritance5.ts (4 errors) ==== + // 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; } + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. + class Derived extends Base { bar: string; } + ~~~ +!!! error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. + class Derived2 extends Derived { baz: string; } + ~~~ +!!! error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. + class OtherDerived extends Base { bing: string; } + ~~~~ +!!! error TS2564: Property 'bing' has no initializer and is not definitely assigned in the constructor. + + interface A { // T + // M's + a: new (x: number) => number[]; + a2: new (x: number) => string[]; + a3: new (x: number) => void; + a4: new (x: string, y: number) => string; + a5: new (x: (arg: string) => number) => string; + a6: new (x: (arg: Base) => Derived) => Base; + a7: new (x: (arg: Base) => Derived) => (r: Base) => Derived; + a8: new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; + a9: new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; + a10: new (...x: Derived[]) => Derived; + a11: new (x: { foo: string }, y: { foo: string; bar: string }) => Base; + a12: new (x: Array, y: Array) => Array; + a13: new (x: Array, y: Array) => Array; + a14: new (x: { a: string; b: number }) => Object; + } + + interface B extends A { + a: new (x: T) => T[]; + } + + // S's + interface I extends B { + // N's + a: new (x: T) => T[]; // ok, instantiation of N is a subtype of M, T is number + a2: new (x: T) => string[]; // ok + a3: new (x: T) => T; // ok since Base returns void + a4: new (x: T, y: U) => T; // ok, instantiation of N is a subtype of M, T is string, U is number + a5: new (x: (arg: T) => U) => T; // ok, U is in a parameter position so inferences can be made + a6: new (x: (arg: T) => U) => T; // ok, same as a5 but with object type hierarchy + a7: new (x: (arg: T) => U) => (r: T) => U; // ok + a8: new (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U; // ok + a9: new (x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U; // ok, same as a8 with compatible object literal + a10: new (...x: T[]) => T; // ok + a11: new (x: T, y: T) => T; // ok + a12: new >(x: Array, y: T) => Array; // ok, less specific parameter type + a13: new >(x: Array, y: T) => T; // ok, T = Array, satisfies constraint, contextual signature instantiation succeeds + a14: new (x: { a: T; b: U }) => T; // ok + } \ No newline at end of file diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.js index 2705c44ab73b3..90c6288eaf1a7 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.js @@ -51,6 +51,7 @@ interface I extends B { } //// [constructSignatureAssignabilityInInheritance5.js] +"use strict"; // 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 { diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.errors.txt b/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.errors.txt index 0253d7c598933..86c6cc46d8a69 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.errors.txt +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.errors.txt @@ -1,3 +1,7 @@ +constructSignatureAssignabilityInInheritance6.ts(5,14): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. +constructSignatureAssignabilityInInheritance6.ts(6,30): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. +constructSignatureAssignabilityInInheritance6.ts(7,34): error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. +constructSignatureAssignabilityInInheritance6.ts(8,35): error TS2564: Property 'bing' has no initializer and is not definitely assigned in the constructor. constructSignatureAssignabilityInInheritance6.ts(24,11): error TS2430: Interface 'I' incorrectly extends interface 'A'. Types of property 'a' are incompatible. Type 'new (x: T) => T[]' is not assignable to type 'new (x: T) => T[]'. @@ -47,15 +51,23 @@ constructSignatureAssignabilityInInheritance6.ts(48,11): error TS2430: Interface 'T' could be instantiated with an arbitrary type which could be unrelated to 'T'. -==== constructSignatureAssignabilityInInheritance6.ts (7 errors) ==== +==== constructSignatureAssignabilityInInheritance6.ts (11 errors) ==== // 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; } + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. class Derived extends Base { bar: string; } + ~~~ +!!! error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. class Derived2 extends Derived { baz: string; } + ~~~ +!!! error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. class OtherDerived extends Base { bing: string; } + ~~~~ +!!! error TS2564: Property 'bing' has no initializer and is not definitely assigned in the constructor. interface A { // T // M's diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.js index d4d6c18c5adb8..933e86c5ab28a 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.js @@ -53,6 +53,7 @@ interface I9 extends A { } //// [constructSignatureAssignabilityInInheritance6.js] +"use strict"; // 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 diff --git a/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters.js b/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters.js index b4bfa44f542d7..3252c54bf7af1 100644 --- a/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters.js +++ b/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters.js @@ -32,6 +32,7 @@ var b: { } //// [constructSignatureWithAccessibilityModifiersOnParameters.js] +"use strict"; // Parameter properties are only valid in constructor definitions, not even in other forms of construct signatures class C { constructor(x, y) { diff --git a/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters2.js b/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters2.js index 6dd1aefb6b11c..d158c6f634850 100644 --- a/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters2.js +++ b/tests/baselines/reference/constructSignatureWithAccessibilityModifiersOnParameters2.js @@ -39,6 +39,7 @@ var b: { } //// [constructSignatureWithAccessibilityModifiersOnParameters2.js] +"use strict"; // Parameter properties are not valid in overloads of constructors class C { constructor(x, y) { diff --git a/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.errors.txt b/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.errors.txt new file mode 100644 index 0000000000000..9cbe8a6c936ec --- /dev/null +++ b/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.errors.txt @@ -0,0 +1,64 @@ +constructSignaturesWithIdenticalOverloads.ts(25,14): error TS2454: Variable 'i' is used before being assigned. +constructSignaturesWithIdenticalOverloads.ts(35,14): error TS2454: Variable 'i2' is used before being assigned. +constructSignaturesWithIdenticalOverloads.ts(42,14): error TS2454: Variable 'a' is used before being assigned. +constructSignaturesWithIdenticalOverloads.ts(49,14): error TS2454: Variable 'b' is used before being assigned. + + +==== constructSignaturesWithIdenticalOverloads.ts (4 errors) ==== + // Duplicate overloads of construct signatures should generate errors + + class C { + constructor(x: number, y: string); + constructor(x: number, y: string); // error + constructor(x: number) { } + } + + var r1 = new C(1, ''); + + class C2 { + constructor(x: T, y: string); + constructor(x: T, y: string); // error + constructor(x: T) { } + } + + var r2 = new C2(1, ''); + + interface I { + new (x: number, y: string): C; + new (x: number, y: string): C; // error + } + + var i: I; + var r3 = new i(1, ''); + ~ +!!! error TS2454: Variable 'i' is used before being assigned. + + interface I2 { + new (x: T, y: string): C2; + new (x: T, y: string): C2; // error + new (x: T, y: string): C2; + new (x: T, y: string): C2; // error + } + + var i2: I2; + var r4 = new i2(1, ''); + ~~ +!!! error TS2454: Variable 'i2' is used before being assigned. + + var a: { + new (x: number, y: string): C; + new (x: number, y: string): C; // error + } + + var r5 = new a(1, ''); + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + + var b: { + new (x: T, y: string): C2; + new (x: T, y: string): C2; // error + } + + var r6 = new b(1, ''); + ~ +!!! error TS2454: Variable 'b' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.js b/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.js index f8e117e451e92..fe17b90db042f 100644 --- a/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.js +++ b/tests/baselines/reference/constructSignaturesWithIdenticalOverloads.js @@ -52,6 +52,7 @@ var b: { var r6 = new b(1, ''); //// [constructSignaturesWithIdenticalOverloads.js] +"use strict"; // Duplicate overloads of construct signatures should generate errors class C { constructor(x) { } diff --git a/tests/baselines/reference/constructSignaturesWithOverloads.errors.txt b/tests/baselines/reference/constructSignaturesWithOverloads.errors.txt new file mode 100644 index 0000000000000..450e1d3be8b71 --- /dev/null +++ b/tests/baselines/reference/constructSignaturesWithOverloads.errors.txt @@ -0,0 +1,65 @@ +constructSignaturesWithOverloads.ts(25,14): error TS2454: Variable 'i' is used before being assigned. +constructSignaturesWithOverloads.ts(36,14): error TS2454: Variable 'i2' is used before being assigned. +constructSignaturesWithOverloads.ts(43,14): error TS2454: Variable 'a' is used before being assigned. +constructSignaturesWithOverloads.ts(50,14): error TS2454: Variable 'b' is used before being assigned. + + +==== constructSignaturesWithOverloads.ts (4 errors) ==== + // No errors expected for basic overloads of construct signatures + + class C { + constructor(x: number, y?: string); + constructor(x: number, y: string); + constructor(x: number) { } + } + + var r1 = new C(1, ''); + + class C2 { + constructor(x: T, y?: string); + constructor(x: T, y: string); + constructor(x: T) { } + } + + var r2 = new C2(1, ''); + + interface I { + new(x: number, y?: string): C; + new(x: number, y: string): C; + } + + var i: I; + var r3 = new i(1, ''); + ~ +!!! error TS2454: Variable 'i' is used before being assigned. + + interface I2 { + new (x: T, y?: string): C2; + new (x: T, y: string): C2; + new (x: T, y?: string): C2; + new (x: T, y: string): C2; + + } + + var i2: I2; + var r4 = new i2(1, ''); + ~~ +!!! error TS2454: Variable 'i2' is used before being assigned. + + var a: { + new(x: number, y?: string): C; + new(x: number, y: string): C; + } + + var r5 = new a(1, ''); + ~ +!!! error TS2454: Variable 'a' is used before being assigned. + + var b: { + new(x: T, y?: string): C2; + new(x: T, y: string): C2; + } + + var r6 = new b(1, ''); + ~ +!!! error TS2454: Variable 'b' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/constructSignaturesWithOverloads.js b/tests/baselines/reference/constructSignaturesWithOverloads.js index ece97496b6519..d39e1852903c5 100644 --- a/tests/baselines/reference/constructSignaturesWithOverloads.js +++ b/tests/baselines/reference/constructSignaturesWithOverloads.js @@ -53,6 +53,7 @@ var b: { var r6 = new b(1, ''); //// [constructSignaturesWithOverloads.js] +"use strict"; // No errors expected for basic overloads of construct signatures class C { constructor(x) { } diff --git a/tests/baselines/reference/constructSignaturesWithOverloads.types b/tests/baselines/reference/constructSignaturesWithOverloads.types index 6e52b77cec9d2..ffcd657249f43 100644 --- a/tests/baselines/reference/constructSignaturesWithOverloads.types +++ b/tests/baselines/reference/constructSignaturesWithOverloads.types @@ -10,8 +10,8 @@ class C { constructor(x: number, y?: string); >x : number > : ^^^^^^ ->y : string -> : ^^^^^^ +>y : string | undefined +> : ^^^^^^^^^^^^^^^^^^ constructor(x: number, y: string); >x : number @@ -43,8 +43,8 @@ class C2 { constructor(x: T, y?: string); >x : T > : ^ ->y : string -> : ^^^^^^ +>y : string | undefined +> : ^^^^^^^^^^^^^^^^^^ constructor(x: T, y: string); >x : T @@ -73,8 +73,8 @@ interface I { new(x: number, y?: string): C; >x : number > : ^^^^^^ ->y : string -> : ^^^^^^ +>y : string | undefined +> : ^^^^^^^^^^^^^^^^^^ new(x: number, y: string): C; >x : number @@ -103,8 +103,8 @@ interface I2 { new (x: T, y?: string): C2; >x : T > : ^ ->y : string -> : ^^^^^^ +>y : string | undefined +> : ^^^^^^^^^^^^^^^^^^ new (x: T, y: string): C2; >x : T @@ -115,8 +115,8 @@ interface I2 { new (x: T, y?: string): C2; >x : T > : ^ ->y : string -> : ^^^^^^ +>y : string | undefined +> : ^^^^^^^^^^^^^^^^^^ new (x: T, y: string): C2; >x : T @@ -149,8 +149,8 @@ var a: { new(x: number, y?: string): C; >x : number > : ^^^^^^ ->y : string -> : ^^^^^^ +>y : string | undefined +> : ^^^^^^^^^^^^^^^^^^ new(x: number, y: string): C; >x : number @@ -178,8 +178,8 @@ var b: { new(x: T, y?: string): C2; >x : T > : ^ ->y : string -> : ^^^^^^ +>y : string | undefined +> : ^^^^^^^^^^^^^^^^^^ new(x: T, y: string): C2; >x : T diff --git a/tests/baselines/reference/constructSignaturesWithOverloads2.js b/tests/baselines/reference/constructSignaturesWithOverloads2.js index f8820555de4f4..c09f34aa7025b 100644 --- a/tests/baselines/reference/constructSignaturesWithOverloads2.js +++ b/tests/baselines/reference/constructSignaturesWithOverloads2.js @@ -42,6 +42,7 @@ var r4 = new i2(1, ''); var r5 = new i2(1, 1); //// [constructSignaturesWithOverloads2.js] +"use strict"; // No errors expected for basic overloads of construct signatures with merged declarations // clodules class C { diff --git a/tests/baselines/reference/constructSignaturesWithOverloads2.types b/tests/baselines/reference/constructSignaturesWithOverloads2.types index d576846093f79..652b955cabbc6 100644 --- a/tests/baselines/reference/constructSignaturesWithOverloads2.types +++ b/tests/baselines/reference/constructSignaturesWithOverloads2.types @@ -11,8 +11,8 @@ class C { constructor(x: number, y?: string); >x : number > : ^^^^^^ ->y : string -> : ^^^^^^ +>y : string | undefined +> : ^^^^^^^^^^^^^^^^^^ constructor(x: number, y: string); >x : number @@ -54,8 +54,8 @@ class C2 { constructor(x: T, y?: string); >x : T > : ^ ->y : string -> : ^^^^^^ +>y : string | undefined +> : ^^^^^^^^^^^^^^^^^^ constructor(x: T, y: string); >x : T @@ -95,8 +95,8 @@ interface I { new (x: number, y?: string): C; >x : number > : ^^^^^^ ->y : string -> : ^^^^^^ +>y : string | undefined +> : ^^^^^^^^^^^^^^^^^^ new (x: number, y: string): C; >x : number @@ -109,8 +109,8 @@ interface I { new (x: T, y?: number): C2; >x : T > : ^ ->y : number -> : ^^^^^^ +>y : number | undefined +> : ^^^^^^^^^^^^^^^^^^ new (x: T, y: number): C2; >x : T diff --git a/tests/baselines/reference/constructSignaturesWithOverloadsThatDifferOnlyByReturnType.js b/tests/baselines/reference/constructSignaturesWithOverloadsThatDifferOnlyByReturnType.js index 520c68afb959e..d8985e1dd99fa 100644 --- a/tests/baselines/reference/constructSignaturesWithOverloadsThatDifferOnlyByReturnType.js +++ b/tests/baselines/reference/constructSignaturesWithOverloadsThatDifferOnlyByReturnType.js @@ -35,6 +35,7 @@ var b: { } //// [constructSignaturesWithOverloadsThatDifferOnlyByReturnType.js] +"use strict"; // Error for construct signature overloads to differ only by return type class C { constructor(x) { } diff --git a/tests/baselines/reference/constructSignaturesWithOverloadsThatDifferOnlyByReturnType.types b/tests/baselines/reference/constructSignaturesWithOverloadsThatDifferOnlyByReturnType.types index 0cc5607118a16..f91efa310bf0b 100644 --- a/tests/baselines/reference/constructSignaturesWithOverloadsThatDifferOnlyByReturnType.types +++ b/tests/baselines/reference/constructSignaturesWithOverloadsThatDifferOnlyByReturnType.types @@ -19,8 +19,8 @@ class C2 { constructor(x: T, y?: string) { } >x : T > : ^ ->y : string -> : ^^^^^^ +>y : string | undefined +> : ^^^^^^^^^^^^^^^^^^ } interface I { diff --git a/tests/baselines/reference/constructableDecoratorOnClass01.js b/tests/baselines/reference/constructableDecoratorOnClass01.js index 623f53fafee73..9775f4cbaa75a 100644 --- a/tests/baselines/reference/constructableDecoratorOnClass01.js +++ b/tests/baselines/reference/constructableDecoratorOnClass01.js @@ -10,6 +10,7 @@ class C { //// [constructableDecoratorOnClass01.js] +"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); diff --git a/tests/baselines/reference/constructorArgWithGenericCallSignature.errors.txt b/tests/baselines/reference/constructorArgWithGenericCallSignature.errors.txt new file mode 100644 index 0000000000000..8164e12f86b96 --- /dev/null +++ b/tests/baselines/reference/constructorArgWithGenericCallSignature.errors.txt @@ -0,0 +1,23 @@ +constructorArgWithGenericCallSignature.ts(12,8): error TS2454: Variable 'func' is used before being assigned. +constructorArgWithGenericCallSignature.ts(13,29): error TS2454: Variable 'func' is used before being assigned. + + +==== constructorArgWithGenericCallSignature.ts (2 errors) ==== + namespace Test { + export interface MyFunc { + (value1: T): T; + } + export class MyClass { + constructor(func: MyFunc) { } + } + + export function F(func: MyFunc) { } + } + var func: Test.MyFunc; + Test.F(func); // OK + ~~~~ +!!! error TS2454: Variable 'func' is used before being assigned. + var test = new Test.MyClass(func); // Should be OK + ~~~~ +!!! error TS2454: Variable 'func' is used before being assigned. + \ No newline at end of file diff --git a/tests/baselines/reference/constructorArgWithGenericCallSignature.js b/tests/baselines/reference/constructorArgWithGenericCallSignature.js index 3af6853e980e1..572c14ddd65d5 100644 --- a/tests/baselines/reference/constructorArgWithGenericCallSignature.js +++ b/tests/baselines/reference/constructorArgWithGenericCallSignature.js @@ -17,6 +17,7 @@ var test = new Test.MyClass(func); // Should be OK //// [constructorArgWithGenericCallSignature.js] +"use strict"; var Test; (function (Test) { class MyClass { diff --git a/tests/baselines/reference/constructorArgs.js b/tests/baselines/reference/constructorArgs.js index b6e08f0411993..f4567c45c65eb 100644 --- a/tests/baselines/reference/constructorArgs.js +++ b/tests/baselines/reference/constructorArgs.js @@ -18,6 +18,7 @@ class Sub extends Super { //// [constructorArgs.js] +"use strict"; class Super { constructor(value) { } diff --git a/tests/baselines/reference/constructorArgsErrors1.js b/tests/baselines/reference/constructorArgsErrors1.js index 17d342eed165b..425232db38b8d 100644 --- a/tests/baselines/reference/constructorArgsErrors1.js +++ b/tests/baselines/reference/constructorArgsErrors1.js @@ -7,6 +7,7 @@ class foo { } //// [constructorArgsErrors1.js] +"use strict"; class foo { constructor(a) { } diff --git a/tests/baselines/reference/constructorArgsErrors2.js b/tests/baselines/reference/constructorArgsErrors2.js index 4a81028f65908..76c1962a4f7c7 100644 --- a/tests/baselines/reference/constructorArgsErrors2.js +++ b/tests/baselines/reference/constructorArgsErrors2.js @@ -8,6 +8,7 @@ class foo { //// [constructorArgsErrors2.js] +"use strict"; class foo { constructor(a) { this.a = a; diff --git a/tests/baselines/reference/constructorArgsErrors3.js b/tests/baselines/reference/constructorArgsErrors3.js index 484196a5ecd62..3445a551eaa55 100644 --- a/tests/baselines/reference/constructorArgsErrors3.js +++ b/tests/baselines/reference/constructorArgsErrors3.js @@ -8,6 +8,7 @@ class foo { //// [constructorArgsErrors3.js] +"use strict"; class foo { constructor(a) { this.a = a; diff --git a/tests/baselines/reference/constructorArgsErrors4.js b/tests/baselines/reference/constructorArgsErrors4.js index 0fd76339f66ea..7c4eea0c4f28b 100644 --- a/tests/baselines/reference/constructorArgsErrors4.js +++ b/tests/baselines/reference/constructorArgsErrors4.js @@ -8,6 +8,7 @@ class foo { //// [constructorArgsErrors4.js] +"use strict"; class foo { constructor(a) { this.a = a; diff --git a/tests/baselines/reference/constructorArgsErrors5.js b/tests/baselines/reference/constructorArgsErrors5.js index 5f1e6964a5b8f..301163ac44de7 100644 --- a/tests/baselines/reference/constructorArgsErrors5.js +++ b/tests/baselines/reference/constructorArgsErrors5.js @@ -8,6 +8,7 @@ class foo { //// [constructorArgsErrors5.js] +"use strict"; class foo { constructor(a) { } diff --git a/tests/baselines/reference/constructorAsType.js b/tests/baselines/reference/constructorAsType.js index d512a58c24fab..b771f649f6460 100644 --- a/tests/baselines/reference/constructorAsType.js +++ b/tests/baselines/reference/constructorAsType.js @@ -8,5 +8,6 @@ declare var Person2:{new() : {name:string;};}; Person = Person2; //// [constructorAsType.js] +"use strict"; var Person = function () { return { name: "joe" }; }; Person = Person2; diff --git a/tests/baselines/reference/constructorDefaultValuesReferencingThis.js b/tests/baselines/reference/constructorDefaultValuesReferencingThis.js index ec3e785156b6a..e4418dad9b837 100644 --- a/tests/baselines/reference/constructorDefaultValuesReferencingThis.js +++ b/tests/baselines/reference/constructorDefaultValuesReferencingThis.js @@ -22,6 +22,7 @@ class F extends C { //// [constructorDefaultValuesReferencingThis.js] +"use strict"; class C { constructor(x = this) { this.baseProp = 1; diff --git a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.js b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.js index 24ec5df3f0f07..b9fc40cfbdf75 100644 --- a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.js +++ b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.js @@ -22,6 +22,7 @@ class Derived2 extends Base { } //// [constructorFunctionTypeIsAssignableToBaseType.js] +"use strict"; class Base { } class Derived extends Base { diff --git a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js index c9972af891a6e..acd07ebcf4472 100644 --- a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js +++ b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js @@ -35,6 +35,7 @@ class Derived2 extends Base { } //// [constructorFunctionTypeIsAssignableToBaseType2.js] +"use strict"; // the constructor function itself does not need to be a subtype of the base type constructor function class Base { constructor(x) { diff --git a/tests/baselines/reference/constructorHasPrototypeProperty.errors.txt b/tests/baselines/reference/constructorHasPrototypeProperty.errors.txt new file mode 100644 index 0000000000000..bf906b9c7ef74 --- /dev/null +++ b/tests/baselines/reference/constructorHasPrototypeProperty.errors.txt @@ -0,0 +1,52 @@ +constructorHasPrototypeProperty.ts(3,9): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. +constructorHasPrototypeProperty.ts(7,9): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. +constructorHasPrototypeProperty.ts(18,9): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. +constructorHasPrototypeProperty.ts(19,9): error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. +constructorHasPrototypeProperty.ts(23,9): error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. +constructorHasPrototypeProperty.ts(24,9): error TS2564: Property 'bing' has no initializer and is not definitely assigned in the constructor. + + +==== constructorHasPrototypeProperty.ts (6 errors) ==== + namespace NonGeneric { + class C { + foo: string; + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. + } + + class D extends C { + bar: string; + ~~~ +!!! error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. + } + + var r = C.prototype; + r.foo; + var r2 = D.prototype; + r2.bar; + } + + namespace Generic { + class C { + foo: T; + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. + bar: U; + ~~~ +!!! error TS2564: Property 'bar' has no initializer and is not definitely assigned in the constructor. + } + + class D extends C { + baz: T; + ~~~ +!!! error TS2564: Property 'baz' has no initializer and is not definitely assigned in the constructor. + bing: U; + ~~~~ +!!! error TS2564: Property 'bing' has no initializer and is not definitely assigned in the constructor. + } + + var r = C.prototype; // C + var ra = r.foo; // any + var r2 = D.prototype; // D + var rb = r2.baz; // any + } \ No newline at end of file diff --git a/tests/baselines/reference/constructorHasPrototypeProperty.js b/tests/baselines/reference/constructorHasPrototypeProperty.js index 758255710ec84..8895095bc207b 100644 --- a/tests/baselines/reference/constructorHasPrototypeProperty.js +++ b/tests/baselines/reference/constructorHasPrototypeProperty.js @@ -34,6 +34,7 @@ namespace Generic { } //// [constructorHasPrototypeProperty.js] +"use strict"; var NonGeneric; (function (NonGeneric) { class C { diff --git a/tests/baselines/reference/constructorHasPrototypeProperty.types b/tests/baselines/reference/constructorHasPrototypeProperty.types index c7969b6c0b57b..6865776e4b610 100644 --- a/tests/baselines/reference/constructorHasPrototypeProperty.types +++ b/tests/baselines/reference/constructorHasPrototypeProperty.types @@ -106,7 +106,9 @@ namespace Generic { var ra = r.foo; // any >ra : any +> : ^^^ >r.foo : any +> : ^^^ >r : C > : ^^^^^^^^^^^ >foo : any @@ -124,7 +126,9 @@ namespace Generic { var rb = r2.baz; // any >rb : any +> : ^^^ >r2.baz : any +> : ^^^ >r2 : D > : ^^^^^^^^^^^ >baz : any diff --git a/tests/baselines/reference/constructorImplementationWithDefaultValues.js b/tests/baselines/reference/constructorImplementationWithDefaultValues.js index 40ff1b101f0b1..a5bc4cd2fece5 100644 --- a/tests/baselines/reference/constructorImplementationWithDefaultValues.js +++ b/tests/baselines/reference/constructorImplementationWithDefaultValues.js @@ -23,6 +23,7 @@ class E { } //// [constructorImplementationWithDefaultValues.js] +"use strict"; class C { constructor(x = 1) { var y = x; diff --git a/tests/baselines/reference/constructorImplementationWithDefaultValues2.js b/tests/baselines/reference/constructorImplementationWithDefaultValues2.js index f8424b301ed22..0a15b17966917 100644 --- a/tests/baselines/reference/constructorImplementationWithDefaultValues2.js +++ b/tests/baselines/reference/constructorImplementationWithDefaultValues2.js @@ -23,6 +23,7 @@ class E { } //// [constructorImplementationWithDefaultValues2.js] +"use strict"; class C { constructor(x = 1) { this.x = x; diff --git a/tests/baselines/reference/constructorInvocationWithTooFewTypeArgs.errors.txt b/tests/baselines/reference/constructorInvocationWithTooFewTypeArgs.errors.txt index 17dcf3ae1c0c7..8b09cde289197 100644 --- a/tests/baselines/reference/constructorInvocationWithTooFewTypeArgs.errors.txt +++ b/tests/baselines/reference/constructorInvocationWithTooFewTypeArgs.errors.txt @@ -1,12 +1,18 @@ +constructorInvocationWithTooFewTypeArgs.ts(3,4): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. +constructorInvocationWithTooFewTypeArgs.ts(5,4): error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. constructorInvocationWithTooFewTypeArgs.ts(9,15): error TS2558: Expected 2 type arguments, but got 1. -==== constructorInvocationWithTooFewTypeArgs.ts (1 errors) ==== +==== constructorInvocationWithTooFewTypeArgs.ts (3 errors) ==== class D { x: T + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. y: U + ~ +!!! error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. } diff --git a/tests/baselines/reference/constructorInvocationWithTooFewTypeArgs.js b/tests/baselines/reference/constructorInvocationWithTooFewTypeArgs.js index add02e12c99d0..6dc57e2e02acb 100644 --- a/tests/baselines/reference/constructorInvocationWithTooFewTypeArgs.js +++ b/tests/baselines/reference/constructorInvocationWithTooFewTypeArgs.js @@ -13,6 +13,7 @@ var d = new D(); //// [constructorInvocationWithTooFewTypeArgs.js] +"use strict"; class D { } var d = new D(); diff --git a/tests/baselines/reference/constructorNameInAccessor.js b/tests/baselines/reference/constructorNameInAccessor.js index 7ce2369d59e35..2f16e860065d8 100644 --- a/tests/baselines/reference/constructorNameInAccessor.js +++ b/tests/baselines/reference/constructorNameInAccessor.js @@ -8,6 +8,7 @@ class C1 { //// [constructorNameInAccessor.js] +"use strict"; class C1 { get constructor() { return; } set constructor(value) { } diff --git a/tests/baselines/reference/constructorNameInGenerator.js b/tests/baselines/reference/constructorNameInGenerator.js index becb0208b7344..58eb17e9c9aad 100644 --- a/tests/baselines/reference/constructorNameInGenerator.js +++ b/tests/baselines/reference/constructorNameInGenerator.js @@ -7,6 +7,7 @@ class C2 { //// [constructorNameInGenerator.js] +"use strict"; class C2 { *constructor() { } } diff --git a/tests/baselines/reference/constructorNameInObjectLiteralAccessor.js b/tests/baselines/reference/constructorNameInObjectLiteralAccessor.js index 27c238b326f5b..7783ff311e0c9 100644 --- a/tests/baselines/reference/constructorNameInObjectLiteralAccessor.js +++ b/tests/baselines/reference/constructorNameInObjectLiteralAccessor.js @@ -8,6 +8,7 @@ const c1 = { //// [constructorNameInObjectLiteralAccessor.js] +"use strict"; const c1 = { get constructor() { return; }, set constructor(value) { } diff --git a/tests/baselines/reference/constructorOverloads1.js b/tests/baselines/reference/constructorOverloads1.js index 005699bee745f..e8dd5d33d41c9 100644 --- a/tests/baselines/reference/constructorOverloads1.js +++ b/tests/baselines/reference/constructorOverloads1.js @@ -24,6 +24,7 @@ f1.bar2(); //// [constructorOverloads1.js] +"use strict"; class Foo { constructor(x) { } diff --git a/tests/baselines/reference/constructorOverloads2.js b/tests/baselines/reference/constructorOverloads2.js index df65c702b7a1c..efc30125f75e7 100644 --- a/tests/baselines/reference/constructorOverloads2.js +++ b/tests/baselines/reference/constructorOverloads2.js @@ -28,6 +28,7 @@ f1.bar1(); //// [constructorOverloads2.js] +"use strict"; class FooBase { constructor(x) { } diff --git a/tests/baselines/reference/constructorOverloads3.js b/tests/baselines/reference/constructorOverloads3.js index 8a6bcfd60407a..aa051bfe4e5e9 100644 --- a/tests/baselines/reference/constructorOverloads3.js +++ b/tests/baselines/reference/constructorOverloads3.js @@ -25,6 +25,7 @@ f1.bar1(); //// [constructorOverloads3.js] +"use strict"; class Foo extends FooBase { constructor(x, y) { } bar1() { } diff --git a/tests/baselines/reference/constructorOverloads4.js b/tests/baselines/reference/constructorOverloads4.js index bf0b60d949b8b..d5e43e234c69e 100644 --- a/tests/baselines/reference/constructorOverloads4.js +++ b/tests/baselines/reference/constructorOverloads4.js @@ -15,5 +15,6 @@ M.Function("yo"); //// [constructorOverloads4.js] +"use strict"; (new M.Function("return 5"))(); M.Function("yo"); diff --git a/tests/baselines/reference/constructorOverloads5.js b/tests/baselines/reference/constructorOverloads5.js index 3cd36ce116bdc..f843fa88492b7 100644 --- a/tests/baselines/reference/constructorOverloads5.js +++ b/tests/baselines/reference/constructorOverloads5.js @@ -21,3 +21,4 @@ //// [constructorOverloads5.js] +"use strict"; diff --git a/tests/baselines/reference/constructorOverloads6.js b/tests/baselines/reference/constructorOverloads6.js index 831430f96cac0..dd3c8465cce5f 100644 --- a/tests/baselines/reference/constructorOverloads6.js +++ b/tests/baselines/reference/constructorOverloads6.js @@ -27,6 +27,7 @@ f1.bar1(); //// [constructorOverloads6.js] +"use strict"; var f1 = new Foo("hey"); var f2 = new Foo(0); var f3 = new Foo(f1); diff --git a/tests/baselines/reference/constructorOverloads7.js b/tests/baselines/reference/constructorOverloads7.js index 3b20c4827a236..7fb4d1101949d 100644 --- a/tests/baselines/reference/constructorOverloads7.js +++ b/tests/baselines/reference/constructorOverloads7.js @@ -28,6 +28,7 @@ function EF1(a,b) { return a+b; } //// [constructorOverloads7.js] +"use strict"; // Type provided by extern declaration // Because Point is a constructor function, this is inferred // to be Point and return type is inferred to be void diff --git a/tests/baselines/reference/constructorOverloads8.js b/tests/baselines/reference/constructorOverloads8.js index b88f2680b90eb..4299b72fd6616 100644 --- a/tests/baselines/reference/constructorOverloads8.js +++ b/tests/baselines/reference/constructorOverloads8.js @@ -18,6 +18,7 @@ interface I { } //// [constructorOverloads8.js] +"use strict"; class C { constructor(x) { } constructor(y, x) { } // illegal, 2 constructor implementations diff --git a/tests/baselines/reference/constructorOverloads9.types b/tests/baselines/reference/constructorOverloads9.types index 0f5459e0d816a..dfd05423c5bcb 100644 --- a/tests/baselines/reference/constructorOverloads9.types +++ b/tests/baselines/reference/constructorOverloads9.types @@ -6,7 +6,8 @@ export class C { > : ^ a; ->a : any +>a : string +> : ^^^^^^ constructor(); constructor(x = '') { @@ -18,11 +19,12 @@ export class C { this.a = x; >this.a = x : string > : ^^^^^^ ->this.a : any +>this.a : string +> : ^^^^^^ >this : this > : ^^^^ ->a : any -> : ^^^ +>a : string +> : ^^^^^^ >x : string > : ^^^^^^ } diff --git a/tests/baselines/reference/constructorOverloadsWithDefaultValues.errors.txt b/tests/baselines/reference/constructorOverloadsWithDefaultValues.errors.txt index 6e148b2c45129..c818eb6f5f449 100644 --- a/tests/baselines/reference/constructorOverloadsWithDefaultValues.errors.txt +++ b/tests/baselines/reference/constructorOverloadsWithDefaultValues.errors.txt @@ -1,10 +1,14 @@ +constructorOverloadsWithDefaultValues.ts(2,5): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. constructorOverloadsWithDefaultValues.ts(3,17): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. +constructorOverloadsWithDefaultValues.ts(9,5): error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. constructorOverloadsWithDefaultValues.ts(10,17): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. -==== constructorOverloadsWithDefaultValues.ts (2 errors) ==== +==== constructorOverloadsWithDefaultValues.ts (4 errors) ==== class C { foo: string; + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. constructor(x = 1); // error ~~~~~ !!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. @@ -14,6 +18,8 @@ constructorOverloadsWithDefaultValues.ts(10,17): error TS2371: A parameter initi class D { foo: string; + ~~~ +!!! error TS2564: Property 'foo' has no initializer and is not definitely assigned in the constructor. constructor(x = 1); // error ~~~~~ !!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation. diff --git a/tests/baselines/reference/constructorOverloadsWithDefaultValues.js b/tests/baselines/reference/constructorOverloadsWithDefaultValues.js index 5f3dfecef5679..ec28aad80d96d 100644 --- a/tests/baselines/reference/constructorOverloadsWithDefaultValues.js +++ b/tests/baselines/reference/constructorOverloadsWithDefaultValues.js @@ -16,6 +16,7 @@ class D { } //// [constructorOverloadsWithDefaultValues.js] +"use strict"; class C { constructor() { } diff --git a/tests/baselines/reference/constructorOverloadsWithOptionalParameters.js b/tests/baselines/reference/constructorOverloadsWithOptionalParameters.js index 5486695d084e0..731497d497bc0 100644 --- a/tests/baselines/reference/constructorOverloadsWithOptionalParameters.js +++ b/tests/baselines/reference/constructorOverloadsWithOptionalParameters.js @@ -16,6 +16,7 @@ class D { } //// [constructorOverloadsWithOptionalParameters.js] +"use strict"; class C { constructor() { } diff --git a/tests/baselines/reference/constructorParameterProperties.errors.txt b/tests/baselines/reference/constructorParameterProperties.errors.txt index b76eb9c6988c6..65c639e0166c7 100644 --- a/tests/baselines/reference/constructorParameterProperties.errors.txt +++ b/tests/baselines/reference/constructorParameterProperties.errors.txt @@ -1,13 +1,17 @@ +constructorParameterProperties.ts(2,5): error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. constructorParameterProperties.ts(8,12): error TS2341: Property 'x' is private and only accessible within class 'C'. constructorParameterProperties.ts(9,12): error TS2445: Property 'z' is protected and only accessible within class 'C' and its subclasses. +constructorParameterProperties.ts(12,5): error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. constructorParameterProperties.ts(18,12): error TS2341: Property 'x' is private and only accessible within class 'D'. constructorParameterProperties.ts(19,12): error TS2339: Property 'a' does not exist on type 'D'. constructorParameterProperties.ts(20,12): error TS2445: Property 'z' is protected and only accessible within class 'D' and its subclasses. -==== constructorParameterProperties.ts (5 errors) ==== +==== constructorParameterProperties.ts (7 errors) ==== class C { y: string; + ~ +!!! error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. constructor(private x: string, protected z: string) { } } @@ -22,6 +26,8 @@ constructorParameterProperties.ts(20,12): error TS2445: Property 'z' is protecte class D { y: T; + ~ +!!! error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. constructor(a: T, private x: T, protected z: T) { } } diff --git a/tests/baselines/reference/constructorParameterProperties.js b/tests/baselines/reference/constructorParameterProperties.js index b157b70f827c6..c6f39143d6760 100644 --- a/tests/baselines/reference/constructorParameterProperties.js +++ b/tests/baselines/reference/constructorParameterProperties.js @@ -24,6 +24,7 @@ var r4 = d.z; // error //// [constructorParameterProperties.js] +"use strict"; class C { constructor(x, z) { this.x = x; diff --git a/tests/baselines/reference/constructorParameterProperties2.errors.txt b/tests/baselines/reference/constructorParameterProperties2.errors.txt index 91c54823d681b..6a17d42066ea9 100644 --- a/tests/baselines/reference/constructorParameterProperties2.errors.txt +++ b/tests/baselines/reference/constructorParameterProperties2.errors.txt @@ -1,15 +1,21 @@ +constructorParameterProperties2.ts(2,5): error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. +constructorParameterProperties2.ts(10,5): error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. constructorParameterProperties2.ts(11,24): error TS2300: Duplicate identifier 'y'. +constructorParameterProperties2.ts(18,5): error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. constructorParameterProperties2.ts(18,5): error TS2687: All declarations of 'y' must have identical modifiers. constructorParameterProperties2.ts(19,25): error TS2300: Duplicate identifier 'y'. constructorParameterProperties2.ts(19,25): error TS2687: All declarations of 'y' must have identical modifiers. +constructorParameterProperties2.ts(26,5): error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. constructorParameterProperties2.ts(26,5): error TS2687: All declarations of 'y' must have identical modifiers. constructorParameterProperties2.ts(27,27): error TS2300: Duplicate identifier 'y'. constructorParameterProperties2.ts(27,27): error TS2687: All declarations of 'y' must have identical modifiers. -==== constructorParameterProperties2.ts (7 errors) ==== +==== constructorParameterProperties2.ts (11 errors) ==== class C { y: number; + ~ +!!! error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. constructor(y: number) { } // ok } @@ -18,6 +24,8 @@ constructorParameterProperties2.ts(27,27): error TS2687: All declarations of 'y' class D { y: number; + ~ +!!! error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. constructor(public y: number) { } // error ~ !!! error TS2300: Duplicate identifier 'y'. @@ -29,6 +37,8 @@ constructorParameterProperties2.ts(27,27): error TS2687: All declarations of 'y' class E { y: number; ~ +!!! error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. + ~ !!! error TS2687: All declarations of 'y' must have identical modifiers. constructor(private y: number) { } // error ~ @@ -43,6 +53,8 @@ constructorParameterProperties2.ts(27,27): error TS2687: All declarations of 'y' class F { y: number; ~ +!!! error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor. + ~ !!! error TS2687: All declarations of 'y' must have identical modifiers. constructor(protected y: number) { } // error ~ diff --git a/tests/baselines/reference/constructorParameterProperties2.js b/tests/baselines/reference/constructorParameterProperties2.js index 4669bd11142d3..93cf1837ea7e7 100644 --- a/tests/baselines/reference/constructorParameterProperties2.js +++ b/tests/baselines/reference/constructorParameterProperties2.js @@ -35,6 +35,7 @@ var r4 = f.y; // error //// [constructorParameterProperties2.js] +"use strict"; class C { constructor(y) { } // ok } diff --git a/tests/baselines/reference/constructorParameterShadowsOuterScopes.js b/tests/baselines/reference/constructorParameterShadowsOuterScopes.js index c71aeb393adc9..cd600776e7656 100644 --- a/tests/baselines/reference/constructorParameterShadowsOuterScopes.js +++ b/tests/baselines/reference/constructorParameterShadowsOuterScopes.js @@ -23,6 +23,7 @@ class D { } //// [constructorParameterShadowsOuterScopes.js] +"use strict"; // Initializer expressions for instance member variables are evaluated in the scope of the class constructor // body but are not permitted to reference parameters or local variables of the constructor. // This effectively means that entities from outer scopes by the same name as a constructor parameter or diff --git a/tests/baselines/reference/constructorParameterShadowsOuterScopes2.js b/tests/baselines/reference/constructorParameterShadowsOuterScopes2.js index 0bfdcaad8961f..5ad3d765620fc 100644 --- a/tests/baselines/reference/constructorParameterShadowsOuterScopes2.js +++ b/tests/baselines/reference/constructorParameterShadowsOuterScopes2.js @@ -35,6 +35,7 @@ class E { //// [constructorParameterShadowsOuterScopes2.js] +"use strict"; // With useDefineForClassFields: true and ESNext target, initializer // expressions for property declarations are evaluated in the scope of // the class body and are permitted to reference parameters or local diff --git a/tests/baselines/reference/constructorParametersInVariableDeclarations.js b/tests/baselines/reference/constructorParametersInVariableDeclarations.js index ff43212e61037..af3d60bd34259 100644 --- a/tests/baselines/reference/constructorParametersInVariableDeclarations.js +++ b/tests/baselines/reference/constructorParametersInVariableDeclarations.js @@ -19,6 +19,7 @@ class B { } //// [constructorParametersInVariableDeclarations.js] +"use strict"; class A { constructor(x) { this.a = x; diff --git a/tests/baselines/reference/constructorParametersThatShadowExternalNamesInVariableDeclarations.js b/tests/baselines/reference/constructorParametersThatShadowExternalNamesInVariableDeclarations.js index 4b17943c7a5aa..e261c7780325b 100644 --- a/tests/baselines/reference/constructorParametersThatShadowExternalNamesInVariableDeclarations.js +++ b/tests/baselines/reference/constructorParametersThatShadowExternalNamesInVariableDeclarations.js @@ -16,6 +16,7 @@ class B { } //// [constructorParametersThatShadowExternalNamesInVariableDeclarations.js] +"use strict"; var x = 1; class A { constructor(x) { diff --git a/tests/baselines/reference/constructorReturningAPrimitive.errors.txt b/tests/baselines/reference/constructorReturningAPrimitive.errors.txt new file mode 100644 index 0000000000000..aa4a3101704eb --- /dev/null +++ b/tests/baselines/reference/constructorReturningAPrimitive.errors.txt @@ -0,0 +1,32 @@ +constructorReturningAPrimitive.ts(15,9): error TS2322: Type 'T' is not assignable to type 'B'. +constructorReturningAPrimitive.ts(15,9): error TS2409: Return type of constructor signature must be assignable to the instance type of the class. +constructorReturningAPrimitive.ts(15,16): error TS2454: Variable 'x' is used before being assigned. + + +==== constructorReturningAPrimitive.ts (3 errors) ==== + // 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 { + constructor() { + return 1; + } + } + + var a = new A(); + + class B { + constructor() { + var x: T; + return x; + ~~~~~~ +!!! error TS2322: Type 'T' is not assignable to type 'B'. +!!! related TS2208 constructorReturningAPrimitive.ts:12:9: This type parameter might need an `extends B` constraint. + ~~~~~~ +!!! error TS2409: Return type of constructor signature must be assignable to the instance type of the class. + ~ +!!! error TS2454: Variable 'x' is used before being assigned. + } + } + + var b = new B(); \ No newline at end of file diff --git a/tests/baselines/reference/constructorReturningAPrimitive.js b/tests/baselines/reference/constructorReturningAPrimitive.js index c7ebad8599482..a4c7a4b9abacc 100644 --- a/tests/baselines/reference/constructorReturningAPrimitive.js +++ b/tests/baselines/reference/constructorReturningAPrimitive.js @@ -22,6 +22,7 @@ class B { var b = new B(); //// [constructorReturningAPrimitive.js] +"use strict"; // 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 { diff --git a/tests/baselines/reference/constructorReturnsInvalidType.js b/tests/baselines/reference/constructorReturnsInvalidType.js index 8dd4229884bda..45a3726c0944c 100644 --- a/tests/baselines/reference/constructorReturnsInvalidType.js +++ b/tests/baselines/reference/constructorReturnsInvalidType.js @@ -12,6 +12,7 @@ var x = new X(); //// [constructorReturnsInvalidType.js] +"use strict"; class X { constructor() { return 1; diff --git a/tests/baselines/reference/constructorStaticParamName.js b/tests/baselines/reference/constructorStaticParamName.js index 09611679fc579..c306e643b9308 100644 --- a/tests/baselines/reference/constructorStaticParamName.js +++ b/tests/baselines/reference/constructorStaticParamName.js @@ -9,6 +9,7 @@ class test { //// [constructorStaticParamName.js] +"use strict"; // static as constructor parameter name should only give error if 'use strict' class test { constructor(static) { } diff --git a/tests/baselines/reference/constructorTypeWithTypeParameters.js b/tests/baselines/reference/constructorTypeWithTypeParameters.js index f9b2ad81ddb53..9251f7f4c2095 100644 --- a/tests/baselines/reference/constructorTypeWithTypeParameters.js +++ b/tests/baselines/reference/constructorTypeWithTypeParameters.js @@ -10,6 +10,7 @@ declare var Y: { var anotherVar: new () => number; //// [constructorTypeWithTypeParameters.js] +"use strict"; var anotherVar; diff --git a/tests/baselines/reference/constructorWithAssignableReturnExpression.errors.txt b/tests/baselines/reference/constructorWithAssignableReturnExpression.errors.txt index cf0682aae0069..2e483bf7d83f1 100644 --- a/tests/baselines/reference/constructorWithAssignableReturnExpression.errors.txt +++ b/tests/baselines/reference/constructorWithAssignableReturnExpression.errors.txt @@ -1,11 +1,15 @@ +constructorWithAssignableReturnExpression.ts(10,5): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. constructorWithAssignableReturnExpression.ts(12,9): error TS2322: Type 'number' is not assignable to type 'D'. constructorWithAssignableReturnExpression.ts(12,9): error TS2409: Return type of constructor signature must be assignable to the instance type of the class. +constructorWithAssignableReturnExpression.ts(17,5): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. +constructorWithAssignableReturnExpression.ts(24,5): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. constructorWithAssignableReturnExpression.ts(26,9): error TS2409: Return type of constructor signature must be assignable to the instance type of the class. constructorWithAssignableReturnExpression.ts(26,18): error TS2322: Type 'number' is not assignable to type 'T'. 'T' could be instantiated with an arbitrary type which could be unrelated to 'number'. +constructorWithAssignableReturnExpression.ts(31,5): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. -==== constructorWithAssignableReturnExpression.ts (4 errors) ==== +==== constructorWithAssignableReturnExpression.ts (8 errors) ==== // a class constructor may return an expression, it must be assignable to the class instance type to be valid class C { @@ -16,6 +20,8 @@ constructorWithAssignableReturnExpression.ts(26,18): error TS2322: Type 'number' class D { x: number; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. constructor() { return 1; // error ~~~~~~ @@ -27,6 +33,8 @@ constructorWithAssignableReturnExpression.ts(26,18): error TS2322: Type 'number' class E { x: number; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. constructor() { return { x: 1 }; } @@ -34,6 +42,8 @@ constructorWithAssignableReturnExpression.ts(26,18): error TS2322: Type 'number' class F { x: T; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. constructor() { return { x: 1 }; // error ~~~~~~ @@ -47,6 +57,8 @@ constructorWithAssignableReturnExpression.ts(26,18): error TS2322: Type 'number' class G { x: T; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. constructor() { return { x: null }; } diff --git a/tests/baselines/reference/constructorWithAssignableReturnExpression.js b/tests/baselines/reference/constructorWithAssignableReturnExpression.js index 651da1461ac0b..3a22573600422 100644 --- a/tests/baselines/reference/constructorWithAssignableReturnExpression.js +++ b/tests/baselines/reference/constructorWithAssignableReturnExpression.js @@ -38,6 +38,7 @@ class G { } //// [constructorWithAssignableReturnExpression.js] +"use strict"; // a class constructor may return an expression, it must be assignable to the class instance type to be valid class C { constructor() { diff --git a/tests/baselines/reference/constructorWithCapturedSuper.js b/tests/baselines/reference/constructorWithCapturedSuper.js index 8cb79e52708a3..d1f34b8441052 100644 --- a/tests/baselines/reference/constructorWithCapturedSuper.js +++ b/tests/baselines/reference/constructorWithCapturedSuper.js @@ -55,6 +55,7 @@ class D extends A { } //// [constructorWithCapturedSuper.js] +"use strict"; let oneA; class A { constructor() { diff --git a/tests/baselines/reference/constructorWithCapturedSuper.types b/tests/baselines/reference/constructorWithCapturedSuper.types index 2f153c3888e7c..1e9bf24cde8c8 100644 --- a/tests/baselines/reference/constructorWithCapturedSuper.types +++ b/tests/baselines/reference/constructorWithCapturedSuper.types @@ -56,7 +56,8 @@ class B extends A { return } catch (e) { ->e : any +>e : unknown +> : ^^^^^^^ return; } diff --git a/tests/baselines/reference/constructorWithExpressionLessReturn.errors.txt b/tests/baselines/reference/constructorWithExpressionLessReturn.errors.txt new file mode 100644 index 0000000000000..eba5e55dbc1ba --- /dev/null +++ b/tests/baselines/reference/constructorWithExpressionLessReturn.errors.txt @@ -0,0 +1,30 @@ +constructorWithExpressionLessReturn.ts(8,5): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. + + +==== constructorWithExpressionLessReturn.ts (1 errors) ==== + class C { + constructor() { + return; + } + } + + class D { + x: number; + ~ +!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor. + constructor() { + return; + } + } + + class E { + constructor(public x: number) { + return; + } + } + + class F { + constructor(public x: T) { + return; + } + } \ No newline at end of file diff --git a/tests/baselines/reference/constructorWithExpressionLessReturn.js b/tests/baselines/reference/constructorWithExpressionLessReturn.js index 0a24692ab0e78..2a6e8e785c893 100644 --- a/tests/baselines/reference/constructorWithExpressionLessReturn.js +++ b/tests/baselines/reference/constructorWithExpressionLessReturn.js @@ -27,6 +27,7 @@ class F { } //// [constructorWithExpressionLessReturn.js] +"use strict"; class C { constructor() { return; diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt index 4acac636af7c2..ce4a8908ff6cf 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt @@ -1,3 +1,4 @@ +error TS-1: Pre-emit (93) and post-emit (94) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! constructorWithIncompleteTypeAnnotation.ts(11,13): error TS2503: Cannot find namespace 'module'. constructorWithIncompleteTypeAnnotation.ts(11,13): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. constructorWithIncompleteTypeAnnotation.ts(11,19): error TS1005: ';' expected. @@ -7,6 +8,8 @@ constructorWithIncompleteTypeAnnotation.ts(24,28): error TS1005: ':' expected. constructorWithIncompleteTypeAnnotation.ts(24,29): error TS1005: ',' expected. constructorWithIncompleteTypeAnnotation.ts(27,18): error TS1128: Declaration or statement expected. constructorWithIncompleteTypeAnnotation.ts(27,26): error TS2304: Cannot find name 'bfs'. +constructorWithIncompleteTypeAnnotation.ts(28,17): error TS7010: 'if', which lacks return-type annotation, implicitly has an 'any' return type. +constructorWithIncompleteTypeAnnotation.ts(28,21): error TS7006: Parameter 'retValue' implicitly has an 'any' type. constructorWithIncompleteTypeAnnotation.ts(28,30): error TS1005: ',' expected. constructorWithIncompleteTypeAnnotation.ts(28,34): error TS1005: ';' expected. constructorWithIncompleteTypeAnnotation.ts(31,18): error TS1109: Expression expected. @@ -27,6 +30,7 @@ constructorWithIncompleteTypeAnnotation.ts(58,5): error TS1128: Declaration or s constructorWithIncompleteTypeAnnotation.ts(69,13): error TS1109: Expression expected. constructorWithIncompleteTypeAnnotation.ts(72,37): error TS1127: Invalid character. constructorWithIncompleteTypeAnnotation.ts(81,13): error TS1109: Expression expected. +constructorWithIncompleteTypeAnnotation.ts(83,66): error TS7006: Parameter 'x' implicitly has an 'any' type. constructorWithIncompleteTypeAnnotation.ts(89,23): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. constructorWithIncompleteTypeAnnotation.ts(90,13): error TS1109: Expression expected. constructorWithIncompleteTypeAnnotation.ts(105,29): error TS1109: Expression expected. @@ -90,7 +94,10 @@ constructorWithIncompleteTypeAnnotation.ts(259,55): error TS1005: ';' expected. constructorWithIncompleteTypeAnnotation.ts(261,1): error TS1128: Declaration or statement expected. -==== constructorWithIncompleteTypeAnnotation.ts (90 errors) ==== +!!! error TS-1: Pre-emit (93) and post-emit (94) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! +!!! related TS-1: The excess diagnostics are: +!!! related TS7017 constructorWithIncompleteTypeAnnotation.ts:239:29: Element implicitly has an 'any' type because type 'typeof globalThis' has no index signature. +==== constructorWithIncompleteTypeAnnotation.ts (93 errors) ==== declare module "fs" { export class File { constructor(filename: string); @@ -141,6 +148,10 @@ constructorWithIncompleteTypeAnnotation.ts(261,1): error TS1128: Declaration or ~~~ !!! error TS2304: Cannot find name 'bfs'. if (retValue != 0) { + ~~ +!!! error TS7010: 'if', which lacks return-type annotation, implicitly has an 'any' return type. + ~~~~~~~~ +!!! error TS7006: Parameter 'retValue' implicitly has an 'any' type. ~~ !!! error TS1005: ',' expected. ~ @@ -236,6 +247,8 @@ constructorWithIncompleteTypeAnnotation.ts(261,1): error TS1128: Declaration or !!! error TS1109: Expression expected. var reg = /\w*/; var objLit = { "var": number = 42, equals: function (x) { return x["var"] === 42; }, instanceof : () => 'objLit{42}' }; + ~ +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. var weekday = Weekdays.Monday; var con = char + f + hexchar + float.toString() + float2.toString() + reg.toString() + objLit + weekday; diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js index dc1e4335b47b9..3f83cdc46221d 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js @@ -282,6 +282,7 @@ TypeScriptAllInOne.Program.Main(); //// [constructorWithIncompleteTypeAnnotation.js] +"use strict"; var fs = module; ("fs"); var TypeScriptAllInOne; diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.types b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.types index d05a348f1a54a..1b50ba086f429 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.types +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.types @@ -193,8 +193,8 @@ namespace TypeScriptAllInOne { } } catch (e) { ->e : any -> : ^^^ +>e : unknown +> : ^^^^^^^ console.log(e); >console.log(e) : any @@ -205,8 +205,8 @@ namespace TypeScriptAllInOne { > : ^^^ >log : any > : ^^^ ->e : any -> : ^^^ +>e : unknown +> : ^^^^^^^ } finally { @@ -782,14 +782,14 @@ namespace TypeScriptAllInOne { throw null; } catch (Exception) ? ->Exception : any -> : ^^^ +>Exception : unknown +> : ^^^^^^^ } finally { try { } catch (Exception) { } ->Exception : any -> : ^^^ +>Exception : unknown +> : ^^^^^^^ } return retVal; diff --git a/tests/baselines/reference/constructorWithParameterPropertiesAndPrivateFields.es2015.js b/tests/baselines/reference/constructorWithParameterPropertiesAndPrivateFields.es2015.js index f1e7282ed4eb2..33d651c959f64 100644 --- a/tests/baselines/reference/constructorWithParameterPropertiesAndPrivateFields.es2015.js +++ b/tests/baselines/reference/constructorWithParameterPropertiesAndPrivateFields.es2015.js @@ -32,6 +32,7 @@ class B { //// [constructorWithParameterPropertiesAndPrivateFields.es2015.js] +"use strict"; // https://github.com/microsoft/TypeScript/issues/48771 var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { if (kind === "m") throw new TypeError("Private method is not writable"); diff --git a/tests/baselines/reference/constructorsWithSpecializedSignatures.js b/tests/baselines/reference/constructorsWithSpecializedSignatures.js index 725a802243e8c..bdbd1c2e0c7a9 100644 --- a/tests/baselines/reference/constructorsWithSpecializedSignatures.js +++ b/tests/baselines/reference/constructorsWithSpecializedSignatures.js @@ -46,6 +46,7 @@ interface I2 { } //// [constructorsWithSpecializedSignatures.js] +"use strict"; // errors class D { constructor(x) { } diff --git a/tests/baselines/reference/contextualIntersectionType.js b/tests/baselines/reference/contextualIntersectionType.js index ad969275d2d62..98240c234213b 100644 --- a/tests/baselines/reference/contextualIntersectionType.js +++ b/tests/baselines/reference/contextualIntersectionType.js @@ -9,6 +9,7 @@ x = { //// [contextualIntersectionType.js] +"use strict"; var x; x = { a: s => s, diff --git a/tests/baselines/reference/contextualPropertyOfGenericMappedType.js b/tests/baselines/reference/contextualPropertyOfGenericMappedType.js index 1c6a523b6e7d0..fb61b6c5ed4e0 100644 --- a/tests/baselines/reference/contextualPropertyOfGenericMappedType.js +++ b/tests/baselines/reference/contextualPropertyOfGenericMappedType.js @@ -8,5 +8,6 @@ f({ data: 0 }, { data(value, key) {} }); //// [contextualPropertyOfGenericMappedType.js] +"use strict"; // Repro for #24694 f({ data: 0 }, { data(value, key) { } }); diff --git a/tests/baselines/reference/contextualReturnTypeOfIIFE.js b/tests/baselines/reference/contextualReturnTypeOfIIFE.js index 0a9205ee68712..61298dbdca509 100644 --- a/tests/baselines/reference/contextualReturnTypeOfIIFE.js +++ b/tests/baselines/reference/contextualReturnTypeOfIIFE.js @@ -15,6 +15,7 @@ const obj: { foo: [one: number, two: string] } = { //// [contextualReturnTypeOfIIFE.js] +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { @@ -24,7 +25,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -const test1 = (() => __awaiter(this, void 0, void 0, function* () { +const test1 = (() => __awaiter(void 0, void 0, void 0, function* () { return [1, 'two']; }))(); const test2 = new Promise((resolve) => resolve([1, 'two'])); diff --git a/tests/baselines/reference/contextualReturnTypeOfIIFE2.js b/tests/baselines/reference/contextualReturnTypeOfIIFE2.js index 9c23e7c1d2da3..484dd036e1acc 100644 --- a/tests/baselines/reference/contextualReturnTypeOfIIFE2.js +++ b/tests/baselines/reference/contextualReturnTypeOfIIFE2.js @@ -14,6 +14,7 @@ app.foo.bar.someFun(1); //// [contextualReturnTypeOfIIFE2.js] +"use strict"; app.foo.bar = (function () { const someFun = (arg) => { }; return { someFun }; diff --git a/tests/baselines/reference/contextualReturnTypeOfIIFE3.js b/tests/baselines/reference/contextualReturnTypeOfIIFE3.js index 98f81ee8353a8..9bce9d28e0bf8 100644 --- a/tests/baselines/reference/contextualReturnTypeOfIIFE3.js +++ b/tests/baselines/reference/contextualReturnTypeOfIIFE3.js @@ -17,6 +17,7 @@ app.foo.bar.someFun(1); //// [contextualReturnTypeOfIIFE3.js] +"use strict"; app.foo.bar = (function () { return { someFun(arg) { } }; })(); diff --git a/tests/baselines/reference/contextualSigInstantiationRestParams.js b/tests/baselines/reference/contextualSigInstantiationRestParams.js index 237b6bbdf79b4..0db035783121a 100644 --- a/tests/baselines/reference/contextualSigInstantiationRestParams.js +++ b/tests/baselines/reference/contextualSigInstantiationRestParams.js @@ -7,4 +7,5 @@ declare function contextual(...s: string[]): string var sig: typeof contextual = toInstantiate; //// [contextualSigInstantiationRestParams.js] +"use strict"; var sig = toInstantiate; diff --git a/tests/baselines/reference/contextualSigInstantiationRestParams.types b/tests/baselines/reference/contextualSigInstantiationRestParams.types index ba478ebb4f885..6c3c48f65b18b 100644 --- a/tests/baselines/reference/contextualSigInstantiationRestParams.types +++ b/tests/baselines/reference/contextualSigInstantiationRestParams.types @@ -4,10 +4,10 @@ declare function toInstantiate(a?: A, b?: B): B; >toInstantiate : (a?: A, b?: B) => B > : ^ ^^ ^^ ^^^ ^^ ^^^ ^^^^^ ->a : A -> : ^ ->b : B -> : ^ +>a : A | undefined +> : ^^^^^^^^^^^^^ +>b : B | undefined +> : ^^^^^^^^^^^^^ declare function contextual(...s: string[]): string >contextual : (...s: string[]) => string diff --git a/tests/baselines/reference/contextualSignatureInObjectFreeze.js b/tests/baselines/reference/contextualSignatureInObjectFreeze.js index 8771cb0312f32..daf517ee28ff9 100644 --- a/tests/baselines/reference/contextualSignatureInObjectFreeze.js +++ b/tests/baselines/reference/contextualSignatureInObjectFreeze.js @@ -9,6 +9,7 @@ Object.freeze({ //// [contextualSignatureInObjectFreeze.js] +"use strict"; // #49101 Object.freeze({ f: function () { } diff --git a/tests/baselines/reference/contextualSignatureInstantiation.js b/tests/baselines/reference/contextualSignatureInstantiation.js index 5ef5d170de473..5a19e23a76a96 100644 --- a/tests/baselines/reference/contextualSignatureInstantiation.js +++ b/tests/baselines/reference/contextualSignatureInstantiation.js @@ -32,6 +32,7 @@ var d = baz(d, d, g); // Should be number[] | string[] //// [contextualSignatureInstantiation.js] +"use strict"; // 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 diff --git a/tests/baselines/reference/contextualSignatureInstantiation1.js b/tests/baselines/reference/contextualSignatureInstantiation1.js index bad38b3e63a4d..a8caed9267401 100644 --- a/tests/baselines/reference/contextualSignatureInstantiation1.js +++ b/tests/baselines/reference/contextualSignatureInstantiation1.js @@ -10,6 +10,7 @@ var e2 = (x: string, y?: K) => x.length; var r100 = map2(e2); // type arg inference should fail for S since a generic lambda is not inferentially typed. Falls back to { length: number } //// [contextualSignatureInstantiation1.js] +"use strict"; var e = (x, y) => x.length; var r99 = map(e); // should be {}[] for S since a generic lambda is not inferentially typed var e2 = (x, y) => x.length; diff --git a/tests/baselines/reference/contextualSignatureInstantiation1.types b/tests/baselines/reference/contextualSignatureInstantiation1.types index be3f6216221ae..7cb60e494b715 100644 --- a/tests/baselines/reference/contextualSignatureInstantiation1.types +++ b/tests/baselines/reference/contextualSignatureInstantiation1.types @@ -18,8 +18,8 @@ var e = (x: string, y?: K) => x.length; > : ^ ^^ ^^ ^^ ^^^ ^^^^^^^^^^^ >x : string > : ^^^^^^ ->y : K -> : ^ +>y : K | undefined +> : ^^^^^^^^^^^^^ >x.length : number > : ^^^^^^ >x : string @@ -56,8 +56,8 @@ var e2 = (x: string, y?: K) => x.length; > : ^ ^^ ^^ ^^ ^^^ ^^^^^^^^^^^ >x : string > : ^^^^^^ ->y : K -> : ^ +>y : K | undefined +> : ^^^^^^^^^^^^^ >x.length : number > : ^^^^^^ >x : string diff --git a/tests/baselines/reference/contextualSignatureInstantiation2.errors.txt b/tests/baselines/reference/contextualSignatureInstantiation2.errors.txt new file mode 100644 index 0000000000000..d7d93ef726cce --- /dev/null +++ b/tests/baselines/reference/contextualSignatureInstantiation2.errors.txt @@ -0,0 +1,14 @@ +contextualSignatureInstantiation2.ts(5,15): error TS2454: Variable 'id' is used before being assigned. +contextualSignatureInstantiation2.ts(5,19): error TS2454: Variable 'id' is used before being assigned. + + +==== contextualSignatureInstantiation2.ts (2 errors) ==== + // dot f g x = f(g(x)) + var dot: (f: (_: T) => S) => (g: (_: U) => T) => (_: U) => S; + dot = (f: (_: T) => S) => (g: (_: U) => T): (r:U) => S => (x) => f(g(x)); + var id: (x:T) => T; + var r23 = dot(id)(id); + ~~ +!!! error TS2454: Variable 'id' is used before being assigned. + ~~ +!!! error TS2454: Variable 'id' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/contextualSignatureInstantiation2.js b/tests/baselines/reference/contextualSignatureInstantiation2.js index 8038e5ce0cf97..168ad2d77379a 100644 --- a/tests/baselines/reference/contextualSignatureInstantiation2.js +++ b/tests/baselines/reference/contextualSignatureInstantiation2.js @@ -8,6 +8,7 @@ var id: (x:T) => T; var r23 = dot(id)(id); //// [contextualSignatureInstantiation2.js] +"use strict"; // dot f g x = f(g(x)) var dot; dot = (f) => (g) => (x) => f(g(x)); diff --git a/tests/baselines/reference/contextualSignatureInstantiation3.js b/tests/baselines/reference/contextualSignatureInstantiation3.js index 9a29df8d592a2..896ba7c82d870 100644 --- a/tests/baselines/reference/contextualSignatureInstantiation3.js +++ b/tests/baselines/reference/contextualSignatureInstantiation3.js @@ -26,6 +26,7 @@ var v2 = map(xs, singleton); // Error if not number[][] //// [contextualSignatureInstantiation3.js] +"use strict"; function map(items, f) { return items.map(f); } diff --git a/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.errors.txt b/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.errors.txt new file mode 100644 index 0000000000000..60b7ba93016ea --- /dev/null +++ b/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.errors.txt @@ -0,0 +1,17 @@ +contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts(2,40): error TS2322: Type 'null' is not assignable to type 'U'. + 'U' could be instantiated with an arbitrary type which could be unrelated to 'null'. +contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts(6,9): error TS2454: Variable 'h' is used before being assigned. + + +==== contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts (2 errors) ==== + function f() { + function g(u: U): U { return null } + ~~~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'U'. +!!! error TS2322: 'U' could be instantiated with an arbitrary type which could be unrelated to 'null'. + return g; + } + var h: (v: V, func: (v: V) => W) => W; + var x = h("", f()); // Call should succeed and x should be string. All type parameters should be instantiated to string + ~ +!!! error TS2454: Variable 'h' is used before being assigned. \ No newline at end of file diff --git a/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.js b/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.js index 7f928ac342b95..10dc0252357b7 100644 --- a/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.js +++ b/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.js @@ -9,6 +9,7 @@ var h: (v: V, func: (v: V) => W) => W; var x = h("", f()); // Call should succeed and x should be string. All type parameters should be instantiated to string //// [contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.js] +"use strict"; function f() { function g(u) { return null; } return g; diff --git a/tests/baselines/reference/contextualSignatureInstatiationContravariance.js b/tests/baselines/reference/contextualSignatureInstatiationContravariance.js index 271c9c7aaa79d..5396b2485308b 100644 --- a/tests/baselines/reference/contextualSignatureInstatiationContravariance.js +++ b/tests/baselines/reference/contextualSignatureInstatiationContravariance.js @@ -14,5 +14,6 @@ declare var h2: (g1: Giraffe, g2: Giraffe) => void; h2 = f2; // valid because Giraffe satisfies the constraint. It is safe in the traditional contravariant fashion. //// [contextualSignatureInstatiationContravariance.js] +"use strict"; g2 = f2; // error because Giraffe and Elephant are disjoint types h2 = f2; // valid because Giraffe satisfies the constraint. It is safe in the traditional contravariant fashion. diff --git a/tests/baselines/reference/contextualSignatureInstatiationCovariance.js b/tests/baselines/reference/contextualSignatureInstatiationCovariance.js index 5755b200e57d6..f6a0f67b21bda 100644 --- a/tests/baselines/reference/contextualSignatureInstatiationCovariance.js +++ b/tests/baselines/reference/contextualSignatureInstatiationCovariance.js @@ -14,6 +14,7 @@ var h2: (a1: Animal, a2: Animal) => void; h2 = f2; // Animal does not satisfy the constraint, but T is at worst a Giraffe and compatible with Animal via covariance. //// [contextualSignatureInstatiationCovariance.js] +"use strict"; var f2; var g2; g2 = f2; // While neither Animal nor TallThing satisfy the constraint, T is at worst a Giraffe and compatible with both via covariance. diff --git a/tests/baselines/reference/contextualSignature_objectLiteralMethodMayReturnNever.js b/tests/baselines/reference/contextualSignature_objectLiteralMethodMayReturnNever.js index 203ae14fe7328..4cc39910c8967 100644 --- a/tests/baselines/reference/contextualSignature_objectLiteralMethodMayReturnNever.js +++ b/tests/baselines/reference/contextualSignature_objectLiteralMethodMayReturnNever.js @@ -6,4 +6,5 @@ const o: I = { m() { throw new Error("not implemented"); } }; //// [contextualSignature_objectLiteralMethodMayReturnNever.js] +"use strict"; const o = { m() { throw new Error("not implemented"); } }; diff --git a/tests/baselines/reference/contextualThisType.js b/tests/baselines/reference/contextualThisType.js index 90977a3bbb18d..ff059eee334cd 100644 --- a/tests/baselines/reference/contextualThisType.js +++ b/tests/baselines/reference/contextualThisType.js @@ -18,6 +18,7 @@ var y = x.a(x); //// [contextualThisType.js] +"use strict"; var x = { a(p) { return p; diff --git a/tests/baselines/reference/contextualTypeAny.js b/tests/baselines/reference/contextualTypeAny.js index 8260517277387..614d53eadb85d 100644 --- a/tests/baselines/reference/contextualTypeAny.js +++ b/tests/baselines/reference/contextualTypeAny.js @@ -8,6 +8,7 @@ var obj: { [s: string]: number } = { p: "", q: x }; var arr: number[] = ["", x]; //// [contextualTypeAny.js] +"use strict"; var x; var obj = { p: "", q: x }; var arr = ["", x]; diff --git a/tests/baselines/reference/contextualTypeAppliedToVarArgs.js b/tests/baselines/reference/contextualTypeAppliedToVarArgs.js index 1783c61e9df9f..cc0f571e4debd 100644 --- a/tests/baselines/reference/contextualTypeAppliedToVarArgs.js +++ b/tests/baselines/reference/contextualTypeAppliedToVarArgs.js @@ -19,6 +19,7 @@ class Foo{ //// [contextualTypeAppliedToVarArgs.js] +"use strict"; function delegate(instance, method, data) { return function () { }; } diff --git a/tests/baselines/reference/contextualTypeArrayReturnType.errors.txt b/tests/baselines/reference/contextualTypeArrayReturnType.errors.txt new file mode 100644 index 0000000000000..00a0d46155305 --- /dev/null +++ b/tests/baselines/reference/contextualTypeArrayReturnType.errors.txt @@ -0,0 +1,35 @@ +contextualTypeArrayReturnType.ts(14,5): error TS2322: Type '(width: number) => { ry: null; }[]' is not assignable to type '(width: number) => NamedTransform[]'. + Type '{ ry: null; }[]' is not assignable to type 'NamedTransform[]'. + Type '{ ry: null; }' is not assignable to type 'NamedTransform'. + Property ''ry'' is incompatible with index signature. + Type 'null' is not assignable to type 'Transform3D'. + + +==== contextualTypeArrayReturnType.ts (1 errors) ==== + interface IBookStyle { + initialLeftPageTransforms?: (width: number) => NamedTransform[]; + } + + interface NamedTransform { + [name: string]: Transform3D; + } + + interface Transform3D { + cachedCss: string; + } + + var style: IBookStyle = { + initialLeftPageTransforms: (width: number) => { + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2322: Type '(width: number) => { ry: null; }[]' is not assignable to type '(width: number) => NamedTransform[]'. +!!! error TS2322: Type '{ ry: null; }[]' is not assignable to type 'NamedTransform[]'. +!!! error TS2322: Type '{ ry: null; }' is not assignable to type 'NamedTransform'. +!!! error TS2322: Property ''ry'' is incompatible with index signature. +!!! error TS2322: Type 'null' is not assignable to type 'Transform3D'. +!!! related TS6500 contextualTypeArrayReturnType.ts:2:5: The expected type comes from property 'initialLeftPageTransforms' which is declared here on type 'IBookStyle' + return [ + {'ry': null } + ]; + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypeArrayReturnType.js b/tests/baselines/reference/contextualTypeArrayReturnType.js index 2934eb58ab442..030752edaf237 100644 --- a/tests/baselines/reference/contextualTypeArrayReturnType.js +++ b/tests/baselines/reference/contextualTypeArrayReturnType.js @@ -23,6 +23,7 @@ var style: IBookStyle = { //// [contextualTypeArrayReturnType.js] +"use strict"; var style = { initialLeftPageTransforms: (width) => { return [ diff --git a/tests/baselines/reference/contextualTypeArrayReturnType.types b/tests/baselines/reference/contextualTypeArrayReturnType.types index 0aaae3fa2d542..7782e56054719 100644 --- a/tests/baselines/reference/contextualTypeArrayReturnType.types +++ b/tests/baselines/reference/contextualTypeArrayReturnType.types @@ -3,8 +3,8 @@ === contextualTypeArrayReturnType.ts === interface IBookStyle { initialLeftPageTransforms?: (width: number) => NamedTransform[]; ->initialLeftPageTransforms : (width: number) => NamedTransform[] -> : ^ ^^ ^^^^^ +>initialLeftPageTransforms : ((width: number) => NamedTransform[]) | undefined +> : ^^ ^^ ^^^^^ ^^^^^^^^^^^^^ >width : number > : ^^^^^^ } @@ -24,14 +24,14 @@ interface Transform3D { var style: IBookStyle = { >style : IBookStyle > : ^^^^^^^^^^ ->{ initialLeftPageTransforms: (width: number) => { return [ {'ry': null } ]; }} : { initialLeftPageTransforms: (width: number) => { ry: any; }[]; } -> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^ +>{ initialLeftPageTransforms: (width: number) => { return [ {'ry': null } ]; }} : { initialLeftPageTransforms: (width: number) => { ry: null; }[]; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^ initialLeftPageTransforms: (width: number) => { ->initialLeftPageTransforms : (width: number) => { ry: any; }[] -> : ^ ^^ ^^^^^^^^^^^^^^^^^^^ ->(width: number) => { return [ {'ry': null } ]; } : (width: number) => { ry: any; }[] -> : ^ ^^ ^^^^^^^^^^^^^^^^^^^ +>initialLeftPageTransforms : (width: number) => { ry: null; }[] +> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^ +>(width: number) => { return [ {'ry': null } ]; } : (width: number) => { ry: null; }[] +> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^ >width : number > : ^^^^^^ diff --git a/tests/baselines/reference/contextualTypeLogicalOr.js b/tests/baselines/reference/contextualTypeLogicalOr.js index 214f776219bbe..eebcc80f67338 100644 --- a/tests/baselines/reference/contextualTypeLogicalOr.js +++ b/tests/baselines/reference/contextualTypeLogicalOr.js @@ -21,6 +21,7 @@ var a = //// [contextualTypeLogicalOr.js] +"use strict"; // Repro from #18005 let x = 123; var a = x && [1, 2, 3, 4] || diff --git a/tests/baselines/reference/contextualTypeLogicalOr.types b/tests/baselines/reference/contextualTypeLogicalOr.types index d229dac24ecb2..b0e8672406de1 100644 --- a/tests/baselines/reference/contextualTypeLogicalOr.types +++ b/tests/baselines/reference/contextualTypeLogicalOr.types @@ -10,36 +10,36 @@ let x = 123; > : ^^^ var a = ->a : number[] -> : ^^^^^^^^ +>a : 0 | number[] +> : ^^^^^^^^^^^^ x && [1, 2, 3, 4] || ->x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : number[] -> : ^^^^^^^^ ->x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : number[] -> : ^^^^^^^^ ->x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : number[] -> : ^^^^^^^^ ->x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : number[] -> : ^^^^^^^^ ->x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : number[] -> : ^^^^^^^^ ->x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : number[] -> : ^^^^^^^^ ->x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : number[] -> : ^^^^^^^^ ->x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : number[] -> : ^^^^^^^^ ->x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : number[] -> : ^^^^^^^^ ->x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : number[] -> : ^^^^^^^^ ->x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : number[] -> : ^^^^^^^^ ->x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : number[] -> : ^^^^^^^^ ->x && [1, 2, 3, 4] : number[] -> : ^^^^^^^^ +>x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : 0 | number[] +> : ^^^^^^^^^^^^ +>x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : 0 | number[] +> : ^^^^^^^^^^^^ +>x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : 0 | number[] +> : ^^^^^^^^^^^^ +>x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : 0 | number[] +> : ^^^^^^^^^^^^ +>x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : 0 | number[] +> : ^^^^^^^^^^^^ +>x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : 0 | number[] +> : ^^^^^^^^^^^^ +>x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : 0 | number[] +> : ^^^^^^^^^^^^ +>x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : 0 | number[] +> : ^^^^^^^^^^^^ +>x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : 0 | number[] +> : ^^^^^^^^^^^^ +>x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : 0 | number[] +> : ^^^^^^^^^^^^ +>x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : 0 | number[] +> : ^^^^^^^^^^^^ +>x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : 0 | number[] +> : ^^^^^^^^^^^^ +>x && [1, 2, 3, 4] : 0 | number[] +> : ^^^^^^^^^^^^ >x : number > : ^^^^^^ >[1, 2, 3, 4] : number[] @@ -54,8 +54,8 @@ var a = > : ^ x && [1, 2, 3, 4] || ->x && [1, 2, 3, 4] : number[] -> : ^^^^^^^^ +>x && [1, 2, 3, 4] : 0 | number[] +> : ^^^^^^^^^^^^ >x : number > : ^^^^^^ >[1, 2, 3, 4] : number[] @@ -70,8 +70,8 @@ var a = > : ^ x && [1, 2, 3, 4] || ->x && [1, 2, 3, 4] : number[] -> : ^^^^^^^^ +>x && [1, 2, 3, 4] : 0 | number[] +> : ^^^^^^^^^^^^ >x : number > : ^^^^^^ >[1, 2, 3, 4] : number[] @@ -86,8 +86,8 @@ var a = > : ^ x && [1, 2, 3, 4] || ->x && [1, 2, 3, 4] : number[] -> : ^^^^^^^^ +>x && [1, 2, 3, 4] : 0 | number[] +> : ^^^^^^^^^^^^ >x : number > : ^^^^^^ >[1, 2, 3, 4] : number[] @@ -102,8 +102,8 @@ var a = > : ^ x && [1, 2, 3, 4] || ->x && [1, 2, 3, 4] : number[] -> : ^^^^^^^^ +>x && [1, 2, 3, 4] : 0 | number[] +> : ^^^^^^^^^^^^ >x : number > : ^^^^^^ >[1, 2, 3, 4] : number[] @@ -118,8 +118,8 @@ var a = > : ^ x && [1, 2, 3, 4] || ->x && [1, 2, 3, 4] : number[] -> : ^^^^^^^^ +>x && [1, 2, 3, 4] : 0 | number[] +> : ^^^^^^^^^^^^ >x : number > : ^^^^^^ >[1, 2, 3, 4] : number[] @@ -134,8 +134,8 @@ var a = > : ^ x && [1, 2, 3, 4] || ->x && [1, 2, 3, 4] : number[] -> : ^^^^^^^^ +>x && [1, 2, 3, 4] : 0 | number[] +> : ^^^^^^^^^^^^ >x : number > : ^^^^^^ >[1, 2, 3, 4] : number[] @@ -150,8 +150,8 @@ var a = > : ^ x && [1, 2, 3, 4] || ->x && [1, 2, 3, 4] : number[] -> : ^^^^^^^^ +>x && [1, 2, 3, 4] : 0 | number[] +> : ^^^^^^^^^^^^ >x : number > : ^^^^^^ >[1, 2, 3, 4] : number[] @@ -166,8 +166,8 @@ var a = > : ^ x && [1, 2, 3, 4] || ->x && [1, 2, 3, 4] : number[] -> : ^^^^^^^^ +>x && [1, 2, 3, 4] : 0 | number[] +> : ^^^^^^^^^^^^ >x : number > : ^^^^^^ >[1, 2, 3, 4] : number[] @@ -182,8 +182,8 @@ var a = > : ^ x && [1, 2, 3, 4] || ->x && [1, 2, 3, 4] : number[] -> : ^^^^^^^^ +>x && [1, 2, 3, 4] : 0 | number[] +> : ^^^^^^^^^^^^ >x : number > : ^^^^^^ >[1, 2, 3, 4] : number[] @@ -198,8 +198,8 @@ var a = > : ^ x && [1, 2, 3, 4] || ->x && [1, 2, 3, 4] : number[] -> : ^^^^^^^^ +>x && [1, 2, 3, 4] : 0 | number[] +> : ^^^^^^^^^^^^ >x : number > : ^^^^^^ >[1, 2, 3, 4] : number[] @@ -214,8 +214,8 @@ var a = > : ^ x && [1, 2, 3, 4] || ->x && [1, 2, 3, 4] : number[] -> : ^^^^^^^^ +>x && [1, 2, 3, 4] : 0 | number[] +> : ^^^^^^^^^^^^ >x : number > : ^^^^^^ >[1, 2, 3, 4] : number[] @@ -230,8 +230,8 @@ var a = > : ^ x && [1, 2, 3, 4]; ->x && [1, 2, 3, 4] : number[] -> : ^^^^^^^^ +>x && [1, 2, 3, 4] : 0 | number[] +> : ^^^^^^^^^^^^ >x : number > : ^^^^^^ >[1, 2, 3, 4] : number[] diff --git a/tests/baselines/reference/contextualTypeObjectSpreadExpression.js b/tests/baselines/reference/contextualTypeObjectSpreadExpression.js index dc90049321175..96a449c96b4e9 100644 --- a/tests/baselines/reference/contextualTypeObjectSpreadExpression.js +++ b/tests/baselines/reference/contextualTypeObjectSpreadExpression.js @@ -9,5 +9,6 @@ i = { ...{ a: "a" } }; //// [contextualTypeObjectSpreadExpression.js] +"use strict"; let i; i = Object.assign({ a: "a" }); diff --git a/tests/baselines/reference/contextualTypeWithTuple.js b/tests/baselines/reference/contextualTypeWithTuple.js index bc23b07f00e99..c338ad35112fe 100644 --- a/tests/baselines/reference/contextualTypeWithTuple.js +++ b/tests/baselines/reference/contextualTypeWithTuple.js @@ -39,6 +39,7 @@ const withExtra: MyEmptyTuple = [] //// [contextualTypeWithTuple.js] +"use strict"; // no error var numStrTuple = [5, "hello"]; var numStrTuple2 = [5, "foo", true]; diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.errors.txt b/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.errors.txt new file mode 100644 index 0000000000000..3a81d214da6eb --- /dev/null +++ b/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.errors.txt @@ -0,0 +1,45 @@ +contextualTypeWithUnionTypeCallSignatures.ts(33,54): error TS7006: Parameter 'a' implicitly has an 'any' type. +contextualTypeWithUnionTypeCallSignatures.ts(36,54): error TS7006: Parameter 'a' implicitly has an 'any' type. + + +==== contextualTypeWithUnionTypeCallSignatures.ts (2 errors) ==== + //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 { + foo: string; + } + interface IWithCallSignatures { + (a: number): string; + } + interface IWithCallSignatures2 { + (a: number): number; + } + interface IWithCallSignatures3 { + (b: string): number; + } + interface IWithCallSignatures4 { + (a: number): string; + (a: string, b: number): number; + } + + // With no call signature | callSignatures + var x: IWithNoCallSignatures | IWithCallSignatures = a => a.toString(); + + // With call signatures with different return type + var x2: IWithCallSignatures | IWithCallSignatures2 = a => a.toString(); // Like iWithCallSignatures + var x2: IWithCallSignatures | IWithCallSignatures2 = a => a; // Like iWithCallSignatures2 + + // With call signatures of mismatching parameter type + var x3: IWithCallSignatures | IWithCallSignatures3 = a => /*here a should be any*/ a.toString(); + ~ +!!! error TS7006: Parameter 'a' implicitly has an 'any' type. + + // With call signature count mismatch + var x4: IWithCallSignatures | IWithCallSignatures4 = a => /*here a should be any*/ a.toString(); + ~ +!!! error TS7006: Parameter 'a' implicitly has an 'any' type. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.js b/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.js index ec2a7f792631f..0f41c17720aca 100644 --- a/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.js +++ b/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.js @@ -39,6 +39,7 @@ var x3: IWithCallSignatures | IWithCallSignatures3 = a => /*here a should be any var x4: IWithCallSignatures | IWithCallSignatures4 = a => /*here a should be any*/ a.toString(); //// [contextualTypeWithUnionTypeCallSignatures.js] +"use strict"; //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. // With no call signature | callSignatures diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.symbols b/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.symbols index 545d5aece2c4e..a581f19563825 100644 --- a/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.symbols +++ b/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.symbols @@ -84,7 +84,5 @@ var x4: IWithCallSignatures | IWithCallSignatures4 = a => /*here a should be any >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.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) >a : Symbol(a, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 35, 52)) ->toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.types b/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.types index d5470ad755e56..8fa6aa9663275 100644 --- a/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.types +++ b/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.types @@ -91,8 +91,11 @@ var x3: IWithCallSignatures | IWithCallSignatures3 = a => /*here a should be any >a => /*here a should be any*/ a.toString() : (a: any) => any > : ^ ^^^^^^^^^^^^^ >a : any +> : ^^^ >a.toString() : any +> : ^^^ >a.toString : any +> : ^^^ >a : any > : ^^^ >toString : any @@ -102,16 +105,16 @@ var x3: IWithCallSignatures | IWithCallSignatures3 = a => /*here a should be any var x4: IWithCallSignatures | IWithCallSignatures4 = a => /*here a should be any*/ a.toString(); >x4 : IWithCallSignatures | IWithCallSignatures4 > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->a => /*here a should be any*/ a.toString() : (a: number) => string -> : ^ ^^^^^^^^^^^^^^^^^^^ ->a : number -> : ^^^^^^ ->a.toString() : string -> : ^^^^^^ ->a.toString : (radix?: number) => string -> : ^ ^^^ ^^^^^ ->a : number -> : ^^^^^^ ->toString : (radix?: number) => string -> : ^ ^^^ ^^^^^ +>a => /*here a should be any*/ a.toString() : (a: any) => any +> : ^ ^^^^^^^^^^^^^ +>a : any +> : ^^^ +>a.toString() : any +> : ^^^ +>a.toString : any +> : ^^^ +>a : any +> : ^^^ +>toString : any +> : ^^^ diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.js b/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.js index 7a0954e3426f0..f4e4e5005d5a4 100644 --- a/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.js +++ b/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.js @@ -57,6 +57,7 @@ var x4: IWithNumberIndexSignature1 | IWithNumberIndexSignature2 = { 1: a => a.to var x4: IWithNumberIndexSignature1 | IWithNumberIndexSignature2 = { 1: a => a }; // a should be number //// [contextualTypeWithUnionTypeIndexSignatures.js] +"use strict"; // 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 diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeMembers.errors.txt b/tests/baselines/reference/contextualTypeWithUnionTypeMembers.errors.txt new file mode 100644 index 0000000000000..cadd0a274dbc2 --- /dev/null +++ b/tests/baselines/reference/contextualTypeWithUnionTypeMembers.errors.txt @@ -0,0 +1,152 @@ +contextualTypeWithUnionTypeMembers.ts(24,39): error TS2454: Variable 'i1' is used before being assigned. +contextualTypeWithUnionTypeMembers.ts(25,39): error TS2454: Variable 'i2' is used before being assigned. +contextualTypeWithUnionTypeMembers.ts(52,52): error TS2454: Variable 'i1' is used before being assigned. +contextualTypeWithUnionTypeMembers.ts(52,56): error TS2454: Variable 'i2' is used before being assigned. +contextualTypeWithUnionTypeMembers.ts(87,27): error TS2454: Variable 'i11' is used before being assigned. +contextualTypeWithUnionTypeMembers.ts(88,27): error TS2454: Variable 'i21' is used before being assigned. +contextualTypeWithUnionTypeMembers.ts(105,42): error TS2454: Variable 'i11' is used before being assigned. +contextualTypeWithUnionTypeMembers.ts(105,47): error TS2454: Variable 'i21' is used before being assigned. +contextualTypeWithUnionTypeMembers.ts(105,52): error TS2454: Variable 'i11' is used before being assigned. +contextualTypeWithUnionTypeMembers.ts(105,59): error TS2454: Variable 'i21' is used before being assigned. + + +==== contextualTypeWithUnionTypeMembers.ts (10 errors) ==== + //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 { + commonMethodType(a: string): string; + commonPropertyType: string; + commonMethodWithTypeParameter(a: T): T; + + methodOnlyInI1(a: string): string; + propertyOnlyInI1: string; + } + interface I2 { + commonMethodType(a: string): string; + commonPropertyType: string; + commonMethodWithTypeParameter(a: T): T; + + methodOnlyInI2(a: string): string; + propertyOnlyInI2: string; + } + + // 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; + var i2: I2; + var i1Ori2: I1 | I2 = i1; + ~~ +!!! error TS2454: Variable 'i1' is used before being assigned. + var i1Ori2: I1 | I2 = i2; + ~~ +!!! error TS2454: Variable 'i2' is used before being assigned. + var i1Ori2: I1 | I2 = { // Like i1 + commonPropertyType: "hello", + commonMethodType: a=> a, + commonMethodWithTypeParameter: a => a, + + methodOnlyInI1: a => a, + propertyOnlyInI1: "Hello", + }; + var i1Ori2: I1 | I2 = { // Like i2 + commonPropertyType: "hello", + commonMethodType: a=> a, + commonMethodWithTypeParameter: a => a, + + methodOnlyInI2: a => a, + propertyOnlyInI2: "Hello", + }; + var i1Ori2: I1 | I2 = { // Like i1 and i2 both + commonPropertyType: "hello", + commonMethodType: a=> a, + commonMethodWithTypeParameter: a => a, + methodOnlyInI1: a => a, + propertyOnlyInI1: "Hello", + methodOnlyInI2: a => a, + propertyOnlyInI2: "Hello", + }; + + var arrayI1OrI2: Array | I2> = [i1, i2, { // Like i1 + ~~ +!!! error TS2454: Variable 'i1' is used before being assigned. + ~~ +!!! error TS2454: Variable 'i2' is used before being assigned. + commonPropertyType: "hello", + commonMethodType: a=> a, + commonMethodWithTypeParameter: a => a, + + methodOnlyInI1: a => a, + propertyOnlyInI1: "Hello", + }, + { // Like i2 + commonPropertyType: "hello", + commonMethodType: a=> a, + commonMethodWithTypeParameter: a => a, + + methodOnlyInI2: a => a, + propertyOnlyInI2: "Hello", + }, { // Like i1 and i2 both + commonPropertyType: "hello", + commonMethodType: a=> a, + commonMethodWithTypeParameter: a => a, + methodOnlyInI1: a => a, + propertyOnlyInI1: "Hello", + methodOnlyInI2: a => a, + propertyOnlyInI2: "Hello", + }]; + + interface I11 { + commonMethodDifferentReturnType(a: string, b: number): string; + commonPropertyDifferentType: string; + } + interface I21 { + commonMethodDifferentReturnType(a: string, b: number): number; + commonPropertyDifferentType: number; + } + var i11: I11; + var i21: I21; + var i11Ori21: I11 | I21 = i11; + ~~~ +!!! error TS2454: Variable 'i11' is used before being assigned. + var i11Ori21: I11 | I21 = i21; + ~~~ +!!! error TS2454: Variable 'i21' is used before being assigned. + var i11Ori21: I11 | I21 = { + // Like i1 + commonMethodDifferentReturnType: (a, b) => { + var z = a.charAt(b); + return z; + }, + commonPropertyDifferentType: "hello", + }; + var i11Ori21: I11 | I21 = { + // Like i2 + commonMethodDifferentReturnType: (a, b) => { + var z = a.charCodeAt(b); + return z; + }, + commonPropertyDifferentType: 10, + }; + var arrayOrI11OrI21: Array = [i11, i21, i11 || i21, { + ~~~ +!!! error TS2454: Variable 'i11' is used before being assigned. + ~~~ +!!! error TS2454: Variable 'i21' is used before being assigned. + ~~~ +!!! error TS2454: Variable 'i11' is used before being assigned. + ~~~ +!!! error TS2454: Variable 'i21' is used before being assigned. + // Like i1 + commonMethodDifferentReturnType: (a, b) => { + var z = a.charAt(b); + return z; + }, + commonPropertyDifferentType: "hello", + }, { + // Like i2 + commonMethodDifferentReturnType: (a, b) => { + var z = a.charCodeAt(b); + return z; + }, + commonPropertyDifferentType: 10, + }]; \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeMembers.js b/tests/baselines/reference/contextualTypeWithUnionTypeMembers.js index 807f26cacd3be..6214c2460ce77 100644 --- a/tests/baselines/reference/contextualTypeWithUnionTypeMembers.js +++ b/tests/baselines/reference/contextualTypeWithUnionTypeMembers.js @@ -122,6 +122,7 @@ var arrayOrI11OrI21: Array = [i11, i21, i11 || i21, { }]; //// [contextualTypeWithUnionTypeMembers.js] +"use strict"; // 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; diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeMembers.types b/tests/baselines/reference/contextualTypeWithUnionTypeMembers.types index d3f6a07dc2755..90a98a5cc3502 100644 --- a/tests/baselines/reference/contextualTypeWithUnionTypeMembers.types +++ b/tests/baselines/reference/contextualTypeWithUnionTypeMembers.types @@ -550,8 +550,8 @@ var arrayOrI11OrI21: Array = [i11, i21, i11 || i21, { > : ^^^ >i21 : I21 > : ^^^ ->i11 || i21 : I11 | I21 -> : ^^^^^^^^^ +>i11 || i21 : I11 +> : ^^^ >i11 : I11 > : ^^^ >i21 : I21 diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.js b/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.js index bfc3324a70a69..d5c09adf65f02 100644 --- a/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.js +++ b/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.js @@ -62,6 +62,7 @@ var i11Ori21: I11 | I21 = { // Like i1 and i2 both }; //// [contextualTypeWithUnionTypeObjectLiteral.js] +"use strict"; var strOrNumber = str || num; var objStrOrNum1 = objStr || objNum; var objStrOrNum2 = objStr || objNum; diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.types b/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.types index 2079eaad23453..8d8cd2c47c67c 100644 --- a/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.types +++ b/tests/baselines/reference/contextualTypeWithUnionTypeObjectLiteral.types @@ -38,8 +38,8 @@ var objStrOrNum1: { prop: string } | { prop: number } = objStr || objNum; > : ^^^^^^ >prop : number > : ^^^^^^ ->objStr || objNum : { prop: string; } | { prop: number; } -> : ^^^^^^^^ ^^^^^^^^^^^^^^ ^^^ +>objStr || objNum : { prop: string; } +> : ^^^^^^^^ ^^^ >objStr : { prop: string; } > : ^^^^^^^^ ^^^ >objNum : { prop: number; } @@ -50,8 +50,8 @@ var objStrOrNum2: { prop: string | number } = objStr || objNum; > : ^^^^^^^^ ^^^ >prop : string | number > : ^^^^^^^^^^^^^^^ ->objStr || objNum : { prop: string; } | { prop: number; } -> : ^^^^^^^^ ^^^^^^^^^^^^^^ ^^^ +>objStr || objNum : { prop: string; } +> : ^^^^^^^^ ^^^ >objStr : { prop: string; } > : ^^^^^^^^ ^^^ >objNum : { prop: number; } diff --git a/tests/baselines/reference/contextualTyping.js b/tests/baselines/reference/contextualTyping.js index 08f09977057b3..545dc63a43c99 100644 --- a/tests/baselines/reference/contextualTyping.js +++ b/tests/baselines/reference/contextualTyping.js @@ -227,6 +227,7 @@ var x: B = { }; //// [contextualTyping.js] +"use strict"; // CONTEXT: Class property declaration class C1T5 { constructor() { diff --git a/tests/baselines/reference/contextualTyping.js.map b/tests/baselines/reference/contextualTyping.js.map index 40ee25e4624d0..7c0a7f533bdad 100644 --- a/tests/baselines/reference/contextualTyping.js.map +++ b/tests/baselines/reference/contextualTyping.js.map @@ -1,3 +1,3 @@ //// [contextualTyping.js.map] -{"version":3,"file":"contextualTyping.js","sourceRoot":"","sources":["contextualTyping.ts"],"names":[],"mappings":"AAYA,sCAAsC;AACtC,MAAM,IAAI;IAAV;QACI,QAAG,GAAqC,UAAS,CAAC;YAC9C,OAAO,CAAC,CAAC;QACb,CAAC,CAAA;IACL,CAAC;CAAA;AAED,0CAA0C;AAC1C,IAAU,IAAI,CAIb;AAJD,WAAU,IAAI;IACC,QAAG,GAAqC,UAAS,CAAC;QACzD,OAAO,CAAC,CAAC;IACb,CAAC,CAAA;AACL,CAAC,EAJS,IAAI,KAAJ,IAAI,QAIb;AAED,gCAAgC;AAChC,IAAI,IAAI,GAA0B,CAAC,UAAS,CAAC,IAAI,OAAO,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC;AAC7D,IAAI,IAAI,GAAS,CAAC;IACd,CAAC,EAAE,CAAC;CACP,CAAC,CAAA;AACF,IAAI,IAAI,GAAa,EAAE,CAAC;AACxB,IAAI,IAAI,GAAe,cAAa,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AACxD,IAAI,IAAI,GAAwB,UAAS,CAAC,IAAI,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAClE,IAAI,IAAI,GAAmC,UAAS,CAAC,EAAE,CAAC,IAAI,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAChF,IAAI,IAAI,GAGJ,UAAS,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AAE9B,IAAI,IAAI,GAAqC,UAAS,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AACvE,IAAI,IAAI,GAAe,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC;AAC/B,IAAI,KAAK,GAAW,CAAO,CAAC,EAAE,CAAC,EAAO,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5C,IAAI,KAAK,GAAwC,CAAC,UAAS,CAAC,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAChF,IAAI,KAAK,GAAS;IACd,GAAG,EAAQ,CAAC,EAAE,CAAC;CAClB,CAAA;AACD,IAAI,KAAK,GAAS,CAAC;IACf,CAAC,EAAE,UAAS,CAAC,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;CAClC,CAAC,CAAA;AACF,IAAI,KAAK,GAAS,CAAC;IACf,CAAC,EAAE,EAAE;CACR,CAAC,CAAA;AAEF,qCAAqC;AACrC,MAAM,IAAI;IAEN;QACI,IAAI,CAAC,GAAG,GAAG,UAAS,CAAC,EAAE,CAAC;YACpB,OAAO,CAAC,CAAC;QACb,CAAC,CAAA;IACL,CAAC;CACJ;AAED,yCAAyC;AACzC,IAAU,IAAI,CAKb;AALD,WAAU,IAAI;IAEV,KAAA,GAAG,GAAG,UAAS,CAAC,EAAE,CAAC;QACf,OAAO,CAAC,CAAC;IACb,CAAC,CAAA;AACL,CAAC,EALS,IAAI,KAAJ,IAAI,QAKb;AAED,+BAA+B;AAC/B,IAAI,IAAyB,CAAC;AAC9B,IAAI,GAAwB,UAAS,CAAC,IAAI,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAE9D,kCAAkC;AAClC,IAAI,IAAI,GAAW,EAAE,CAAC;AACtB,IAAI,CAAC,CAAC,CAAC,GAAS,CAAC,EAAC,CAAC,EAAE,CAAC,EAAC,CAAC,CAAC;AAuBzB,IAAI,KAAK,GAkBS,CAAC,EAAE,CAAC,CAAC;AAEvB,KAAK,CAAC,EAAE,GAAG,CAAC,UAAS,CAAC,IAAI,OAAO,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC;AACtC,KAAK,CAAC,EAAE,GAAS,CAAC;IACd,CAAC,EAAE,CAAC;CACP,CAAC,CAAC;AACH,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC;AACd,KAAK,CAAC,EAAE,GAAG,cAAa,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAC5C,KAAK,CAAC,EAAE,GAAG,UAAS,CAAC,IAAI,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAC7C,KAAK,CAAC,EAAE,GAAG,UAAS,CAAC,EAAE,CAAC,IAAI,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAChD,KAAK,CAAC,EAAE,GAAG,UAAS,CAAS,IAAI,OAAO,CAAC,CAAA,CAAC,CAAC,CAAC;AAE5C,KAAK,CAAC,EAAE,GAAG,UAAS,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AACrC,KAAK,CAAC,EAAE,GAAG,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC;AACnB,KAAK,CAAC,GAAG,GAAG,CAAO,CAAC,EAAE,CAAC,EAAO,CAAC,EAAE,CAAC,CAAC,CAAC;AACpC,KAAK,CAAC,GAAG,GAAG,CAAC,UAAS,CAAC,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3C,KAAK,CAAC,GAAG,GAAG;IACR,GAAG,EAAQ,CAAC,EAAE,CAAC;CAClB,CAAA;AACD,KAAK,CAAC,GAAG,GAAS,CAAC;IACf,CAAC,EAAE,UAAS,CAAC,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;CAClC,CAAC,CAAA;AACF,KAAK,CAAC,GAAG,GAAS,CAAC;IACf,CAAC,EAAE,EAAE;CACR,CAAC,CAAA;AACF,yBAAyB;AACzB,SAAS,IAAI,CAAC,CAAsB,IAAG,CAAC;AAAA,CAAC;AACzC,IAAI,CAAC,UAAS,CAAC;IACX,OAAa,CAAC,EAAE,CAAC,CAAC;AACtB,CAAC,CAAC,CAAC;AAEH,4BAA4B;AAC5B,IAAI,KAAK,GAA8B,cAAa,OAAO,UAAS,CAAC,IAAI,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAA,CAAC,CAAC,CAAC;AAE/F,0BAA0B;AAC1B,MAAM,KAAK;IAAG,YAAY,CAAsB,IAAI,CAAC;CAAE;AAAA,CAAC;AACxD,IAAI,CAAC,GAAG,IAAI,KAAK,CAAC,UAAS,CAAC,IAAI,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC;AAErD,qCAAqC;AACrC,IAAI,KAAK,GAA2B,CAAC,UAAS,CAAC,IAAI,OAAO,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC;AAC/D,IAAI,KAAK,GAAU,CAAC;IAChB,CAAC,EAAE,CAAC;CACP,CAAC,CAAC;AACH,IAAI,KAAK,GAAc,EAAE,CAAC;AAC1B,IAAI,KAAK,GAAgB,cAAa,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAC1D,IAAI,KAAK,GAAyB,UAAS,CAAC,IAAI,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AACpE,IAAI,KAAK,GAAoC,UAAS,CAAC,EAAE,CAAC,IAAI,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAClF,IAAI,KAAK,GAGN,UAAS,CAAQ,IAAI,OAAO,CAAC,CAAA,CAAC,CAAC,CAAC;AAEnC,IAAI,KAAK,GAAsC,UAAS,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AACzE,IAAI,KAAK,GAAgB,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC;AACjC,IAAI,MAAM,GAAY,CAAO,CAAC,EAAE,CAAC,EAAO,CAAC,EAAE,CAAC,CAAC,CAAC;AAC9C,IAAI,MAAM,GAAyC,CAAC,UAAS,CAAC,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClF,IAAI,MAAM,GAAU;IAChB,GAAG,EAAQ,CAAC,EAAE,CAAC;CAClB,CAAA;AACD,IAAI,MAAM,GAAU,CAAC;IACjB,CAAC,EAAE,UAAS,CAAC,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;CAClC,CAAC,CAAA;AACF,IAAI,MAAM,GAAU,CAAC;IACjB,CAAC,EAAE,EAAE;CACR,CAAC,CAAA;AAOF,SAAS,GAAG,CAAC,CAAC,EAAC,CAAC,IAAI,OAAO,CAAC,GAAC,CAAC,CAAC,CAAC,CAAC;AAEjC,IAAI,GAAG,GAAG,GAAG,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC;AAcnB,KAAK,CAAC,MAAM,GAAG,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAE/B,KAAK,CAAC,SAAS,CAAC,GAAG,GAAG,UAAS,EAAE,EAAE,EAAE;IACjC,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;AAC/C,CAAC,CAAC;AAEF,KAAK,CAAC,SAAS,GAAG;IACd,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,GAAG,EAAE,UAAS,EAAE,EAAE,EAAE;QAChB,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IAC/C,CAAC;CACJ,CAAC;AAIF,IAAI,CAAC,GAAM,EAAG,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,Ly8gQ09OVEVYVDogQ2xhc3MgcHJvcGVydHkgZGVjbGFyYXRpb24NCmNsYXNzIEMxVDUgew0KICAgIGNvbnN0cnVjdG9yKCkgew0KICAgICAgICB0aGlzLmZvbyA9IGZ1bmN0aW9uIChpKSB7DQogICAgICAgICAgICByZXR1cm4gaTsNCiAgICAgICAgfTsNCiAgICB9DQp9DQovLyBDT05URVhUOiBOYW1lc3BhY2UgcHJvcGVydHkgZGVjbGFyYXRpb24NCnZhciBDMlQ1Ow0KKGZ1bmN0aW9uIChDMlQ1KSB7DQogICAgQzJUNS5mb28gPSBmdW5jdGlvbiAoaSkgew0KICAgICAgICByZXR1cm4gaTsNCiAgICB9Ow0KfSkoQzJUNSB8fCAoQzJUNSA9IHt9KSk7DQovLyBDT05URVhUOiBWYXJpYWJsZSBkZWNsYXJhdGlvbg0KdmFyIGMzdDEgPSAoZnVuY3Rpb24gKHMpIHsgcmV0dXJuIHM7IH0pOw0KdmFyIGMzdDIgPSAoew0KICAgIG46IDENCn0pOw0KdmFyIGMzdDMgPSBbXTsNCnZhciBjM3Q0ID0gZnVuY3Rpb24gKCkgeyByZXR1cm4gKHt9KTsgfTsNCnZhciBjM3Q1ID0gZnVuY3Rpb24gKG4pIHsgcmV0dXJuICh7fSk7IH07DQp2YXIgYzN0NiA9IGZ1bmN0aW9uIChuLCBzKSB7IHJldHVybiAoe30pOyB9Ow0KdmFyIGMzdDcgPSBmdW5jdGlvbiAobikgeyByZXR1cm4gbjsgfTsNCnZhciBjM3Q4ID0gZnVuY3Rpb24gKG4pIHsgcmV0dXJuIG47IH07DQp2YXIgYzN0OSA9IFtbXSwgW11dOw0KdmFyIGMzdDEwID0gWyh7fSksICh7fSldOw0KdmFyIGMzdDExID0gW2Z1bmN0aW9uIChuLCBzKSB7IHJldHVybiBzOyB9XTsNCnZhciBjM3QxMiA9IHsNCiAgICBmb286ICh7fSkNCn07DQp2YXIgYzN0MTMgPSAoew0KICAgIGY6IGZ1bmN0aW9uIChpLCBzKSB7IHJldHVybiBzOyB9DQp9KTsNCnZhciBjM3QxNCA9ICh7DQogICAgYTogW10NCn0pOw0KLy8gQ09OVEVYVDogQ2xhc3MgcHJvcGVydHkgYXNzaWdubWVudA0KY2xhc3MgQzRUNSB7DQogICAgY29uc3RydWN0b3IoKSB7DQogICAgICAgIHRoaXMuZm9vID0gZnVuY3Rpb24gKGksIHMpIHsNCiAgICAgICAgICAgIHJldHVybiBzOw0KICAgICAgICB9Ow0KICAgIH0NCn0NCi8vIENPTlRFWFQ6IE5hbWVzcGFjZSBwcm9wZXJ0eSBhc3NpZ25tZW50DQp2YXIgQzVUNTsNCihmdW5jdGlvbiAoQzVUNSkgew0KICAgIEM1VDUuZm9vID0gZnVuY3Rpb24gKGksIHMpIHsNCiAgICAgICAgcmV0dXJuIHM7DQogICAgfTsNCn0pKEM1VDUgfHwgKEM1VDUgPSB7fSkpOw0KLy8gQ09OVEVYVDogVmFyaWFibGUgYXNzaWdubWVudA0KdmFyIGM2dDU7DQpjNnQ1ID0gZnVuY3Rpb24gKG4pIHsgcmV0dXJuICh7fSk7IH07DQovLyBDT05URVhUOiBBcnJheSBpbmRleCBhc3NpZ25tZW50DQp2YXIgYzd0MiA9IFtdOw0KYzd0MlswXSA9ICh7IG46IDEgfSk7DQp2YXIgb2JqYzggPSAoe30pOw0Kb2JqYzgudDEgPSAoZnVuY3Rpb24gKHMpIHsgcmV0dXJuIHM7IH0pOw0Kb2JqYzgudDIgPSAoew0KICAgIG46IDENCn0pOw0Kb2JqYzgudDMgPSBbXTsNCm9iamM4LnQ0ID0gZnVuY3Rpb24gKCkgeyByZXR1cm4gKHt9KTsgfTsNCm9iamM4LnQ1ID0gZnVuY3Rpb24gKG4pIHsgcmV0dXJuICh7fSk7IH07DQpvYmpjOC50NiA9IGZ1bmN0aW9uIChuLCBzKSB7IHJldHVybiAoe30pOyB9Ow0Kb2JqYzgudDcgPSBmdW5jdGlvbiAobikgeyByZXR1cm4gbjsgfTsNCm9iamM4LnQ4ID0gZnVuY3Rpb24gKG4pIHsgcmV0dXJuIG47IH07DQpvYmpjOC50OSA9IFtbXSwgW11dOw0Kb2JqYzgudDEwID0gWyh7fSksICh7fSldOw0Kb2JqYzgudDExID0gW2Z1bmN0aW9uIChuLCBzKSB7IHJldHVybiBzOyB9XTsNCm9iamM4LnQxMiA9IHsNCiAgICBmb286ICh7fSkNCn07DQpvYmpjOC50MTMgPSAoew0KICAgIGY6IGZ1bmN0aW9uIChpLCBzKSB7IHJldHVybiBzOyB9DQp9KTsNCm9iamM4LnQxNCA9ICh7DQogICAgYTogW10NCn0pOw0KLy8gQ09OVEVYVDogRnVuY3Rpb24gY2FsbA0KZnVuY3Rpb24gYzl0NShmKSB7IH0NCjsNCmM5dDUoZnVuY3Rpb24gKG4pIHsNCiAgICByZXR1cm4gKHt9KTsNCn0pOw0KLy8gQ09OVEVYVDogUmV0dXJuIHN0YXRlbWVudA0KdmFyIGMxMHQ1ID0gZnVuY3Rpb24gKCkgeyByZXR1cm4gZnVuY3Rpb24gKG4pIHsgcmV0dXJuICh7fSk7IH07IH07DQovLyBDT05URVhUOiBOZXdpbmcgYSBjbGFzcw0KY2xhc3MgQzExdDUgew0KICAgIGNvbnN0cnVjdG9yKGYpIHsgfQ0KfQ0KOw0KdmFyIGkgPSBuZXcgQzExdDUoZnVuY3Rpb24gKG4pIHsgcmV0dXJuICh7fSk7IH0pOw0KLy8gQ09OVEVYVDogVHlwZSBhbm5vdGF0ZWQgZXhwcmVzc2lvbg0KdmFyIGMxMnQxID0gKGZ1bmN0aW9uIChzKSB7IHJldHVybiBzOyB9KTsNCnZhciBjMTJ0MiA9ICh7DQogICAgbjogMQ0KfSk7DQp2YXIgYzEydDMgPSBbXTsNCnZhciBjMTJ0NCA9IGZ1bmN0aW9uICgpIHsgcmV0dXJuICh7fSk7IH07DQp2YXIgYzEydDUgPSBmdW5jdGlvbiAobikgeyByZXR1cm4gKHt9KTsgfTsNCnZhciBjMTJ0NiA9IGZ1bmN0aW9uIChuLCBzKSB7IHJldHVybiAoe30pOyB9Ow0KdmFyIGMxMnQ3ID0gZnVuY3Rpb24gKG4pIHsgcmV0dXJuIG47IH07DQp2YXIgYzEydDggPSBmdW5jdGlvbiAobikgeyByZXR1cm4gbjsgfTsNCnZhciBjMTJ0OSA9IFtbXSwgW11dOw0KdmFyIGMxMnQxMCA9IFsoe30pLCAoe30pXTsNCnZhciBjMTJ0MTEgPSBbZnVuY3Rpb24gKG4sIHMpIHsgcmV0dXJuIHM7IH1dOw0KdmFyIGMxMnQxMiA9IHsNCiAgICBmb286ICh7fSkNCn07DQp2YXIgYzEydDEzID0gKHsNCiAgICBmOiBmdW5jdGlvbiAoaSwgcykgeyByZXR1cm4gczsgfQ0KfSk7DQp2YXIgYzEydDE0ID0gKHsNCiAgICBhOiBbXQ0KfSk7DQpmdW5jdGlvbiBFRjEoYSwgYikgeyByZXR1cm4gYSArIGI7IH0NCnZhciBlZnYgPSBFRjEoMSwgMik7DQpQb2ludC5vcmlnaW4gPSBuZXcgUG9pbnQoMCwgMCk7DQpQb2ludC5wcm90b3R5cGUuYWRkID0gZnVuY3Rpb24gKGR4LCBkeSkgew0KICAgIHJldHVybiBuZXcgUG9pbnQodGhpcy54ICsgZHgsIHRoaXMueSArIGR5KTsNCn07DQpQb2ludC5wcm90b3R5cGUgPSB7DQogICAgeDogMCwNCiAgICB5OiAwLA0KICAgIGFkZDogZnVuY3Rpb24gKGR4LCBkeSkgew0KICAgICAgICByZXR1cm4gbmV3IFBvaW50KHRoaXMueCArIGR4LCB0aGlzLnkgKyBkeSk7DQogICAgfQ0KfTsNCnZhciB4ID0ge307DQovLyMgc291cmNlTWFwcGluZ1VSTD1jb250ZXh0dWFsVHlwaW5nLmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udGV4dHVhbFR5cGluZy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImNvbnRleHR1YWxUeXBpbmcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBWUEsc0NBQXNDO0FBQ3RDLE1BQU0sSUFBSTtJQUFWO1FBQ0ksUUFBRyxHQUFxQyxVQUFTLENBQUM7WUFDOUMsT0FBTyxDQUFDLENBQUM7UUFDYixDQUFDLENBQUE7SUFDTCxDQUFDO0NBQUE7QUFFRCwwQ0FBMEM7QUFDMUMsSUFBVSxJQUFJLENBSWI7QUFKRCxXQUFVLElBQUk7SUFDQyxRQUFHLEdBQXFDLFVBQVMsQ0FBQztRQUN6RCxPQUFPLENBQUMsQ0FBQztJQUNiLENBQUMsQ0FBQTtBQUNMLENBQUMsRUFKUyxJQUFJLEtBQUosSUFBSSxRQUliO0FBRUQsZ0NBQWdDO0FBQ2hDLElBQUksSUFBSSxHQUEwQixDQUFDLFVBQVMsQ0FBQyxJQUFJLE9BQU8sQ0FBQyxDQUFBLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDN0QsSUFBSSxJQUFJLEdBQVMsQ0FBQztJQUNkLENBQUMsRUFBRSxDQUFDO0NBQ1AsQ0FBQyxDQUFBO0FBQ0YsSUFBSSxJQUFJLEdBQWEsRUFBRSxDQUFDO0FBQ3hCLElBQUksSUFBSSxHQUFlLGNBQWEsT0FBYSxDQUFDLEVBQUUsQ0FBQyxDQUFBLENBQUMsQ0FBQyxDQUFDO0FBQ3hELElBQUksSUFBSSxHQUF3QixVQUFTLENBQUMsSUFBSSxPQUFhLENBQUMsRUFBRSxDQUFDLENBQUEsQ0FBQyxDQUFDLENBQUM7QUFDbEUsSUFBSSxJQUFJLEdBQW1DLFVBQVMsQ0FBQyxFQUFFLENBQUMsSUFBSSxPQUFhLENBQUMsRUFBRSxDQUFDLENBQUEsQ0FBQyxDQUFDLENBQUM7QUFDaEYsSUFBSSxJQUFJLEdBR0osVUFBUyxDQUFDLElBQUksT0FBTyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFFOUIsSUFBSSxJQUFJLEdBQXFDLFVBQVMsQ0FBQyxJQUFJLE9BQU8sQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ3ZFLElBQUksSUFBSSxHQUFlLENBQUMsRUFBRSxFQUFDLEVBQUUsQ0FBQyxDQUFDO0FBQy9CLElBQUksS0FBSyxHQUFXLENBQU8sQ0FBQyxFQUFFLENBQUMsRUFBTyxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUM7QUFDNUMsSUFBSSxLQUFLLEdBQXdDLENBQUMsVUFBUyxDQUFDLEVBQUUsQ0FBQyxJQUFJLE9BQU8sQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDaEYsSUFBSSxLQUFLLEdBQVM7SUFDZCxHQUFHLEVBQVEsQ0FBQyxFQUFFLENBQUM7Q0FDbEIsQ0FBQTtBQUNELElBQUksS0FBSyxHQUFTLENBQUM7SUFDZixDQUFDLEVBQUUsVUFBUyxDQUFDLEVBQUUsQ0FBQyxJQUFJLE9BQU8sQ0FBQyxDQUFDLENBQUMsQ0FBQztDQUNsQyxDQUFDLENBQUE7QUFDRixJQUFJLEtBQUssR0FBUyxDQUFDO0lBQ2YsQ0FBQyxFQUFFLEVBQUU7Q0FDUixDQUFDLENBQUE7QUFFRixxQ0FBcUM7QUFDckMsTUFBTSxJQUFJO0lBRU47UUFDSSxJQUFJLENBQUMsR0FBRyxHQUFHLFVBQVMsQ0FBQyxFQUFFLENBQUM7WUFDcEIsT0FBTyxDQUFDLENBQUM7UUFDYixDQUFDLENBQUE7SUFDTCxDQUFDO0NBQ0o7QUFFRCx5Q0FBeUM7QUFDekMsSUFBVSxJQUFJLENBS2I7QUFMRCxXQUFVLElBQUk7SUFFVixLQUFBLEdBQUcsR0FBRyxVQUFTLENBQUMsRUFBRSxDQUFDO1FBQ2YsT0FBTyxDQUFDLENBQUM7SUFDYixDQUFDLENBQUE7QUFDTCxDQUFDLEVBTFMsSUFBSSxLQUFKLElBQUksUUFLYjtBQUVELCtCQUErQjtBQUMvQixJQUFJLElBQXlCLENBQUM7QUFDOUIsSUFBSSxHQUF3QixVQUFTLENBQUMsSUFBSSxPQUFhLENBQUMsRUFBRSxDQUFDLENBQUEsQ0FBQyxDQUFDLENBQUM7QUFFOUQsa0NBQWtDO0FBQ2xDLElBQUksSUFBSSxHQUFXLEVBQUUsQ0FBQztBQUN0QixJQUFJLENBQUMsQ0FBQyxDQUFDLEdBQVMsQ0FBQyxFQUFDLENBQUMsRUFBRSxDQUFDLEVBQUMsQ0FBQyxDQUFDO0FBdUJ6QixJQUFJLEtBQUssR0FrQlMsQ0FBQyxFQUFFLENBQUMsQ0FBQztBQUV2QixLQUFLLENBQUMsRUFBRSxHQUFHLENBQUMsVUFBUyxDQUFDLElBQUksT0FBTyxDQUFDLENBQUEsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUN0QyxLQUFLLENBQUMsRUFBRSxHQUFTLENBQUM7SUFDZCxDQUFDLEVBQUUsQ0FBQztDQUNQLENBQUMsQ0FBQztBQUNILEtBQUssQ0FBQyxFQUFFLEdBQUcsRUFBRSxDQUFDO0FBQ2QsS0FBSyxDQUFDLEVBQUUsR0FBRyxjQUFhLE9BQWEsQ0FBQyxFQUFFLENBQUMsQ0FBQSxDQUFDLENBQUMsQ0FBQztBQUM1QyxLQUFLLENBQUMsRUFBRSxHQUFHLFVBQVMsQ0FBQyxJQUFJLE9BQWEsQ0FBQyxFQUFFLENBQUMsQ0FBQSxDQUFDLENBQUMsQ0FBQztBQUM3QyxLQUFLLENBQUMsRUFBRSxHQUFHLFVBQVMsQ0FBQyxFQUFFLENBQUMsSUFBSSxPQUFhLENBQUMsRUFBRSxDQUFDLENBQUEsQ0FBQyxDQUFDLENBQUM7QUFDaEQsS0FBSyxDQUFDLEVBQUUsR0FBRyxVQUFTLENBQVMsSUFBSSxPQUFPLENBQUMsQ0FBQSxDQUFDLENBQUMsQ0FBQztBQUU1QyxLQUFLLENBQUMsRUFBRSxHQUFHLFVBQVMsQ0FBQyxJQUFJLE9BQU8sQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ3JDLEtBQUssQ0FBQyxFQUFFLEdBQUcsQ0FBQyxFQUFFLEVBQUMsRUFBRSxDQUFDLENBQUM7QUFDbkIsS0FBSyxDQUFDLEdBQUcsR0FBRyxDQUFPLENBQUMsRUFBRSxDQUFDLEVBQU8sQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDO0FBQ3BDLEtBQUssQ0FBQyxHQUFHLEdBQUcsQ0FBQyxVQUFTLENBQUMsRUFBRSxDQUFDLElBQUksT0FBTyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUMzQyxLQUFLLENBQUMsR0FBRyxHQUFHO0lBQ1IsR0FBRyxFQUFRLENBQUMsRUFBRSxDQUFDO0NBQ2xCLENBQUE7QUFDRCxLQUFLLENBQUMsR0FBRyxHQUFTLENBQUM7SUFDZixDQUFDLEVBQUUsVUFBUyxDQUFDLEVBQUUsQ0FBQyxJQUFJLE9BQU8sQ0FBQyxDQUFDLENBQUMsQ0FBQztDQUNsQyxDQUFDLENBQUE7QUFDRixLQUFLLENBQUMsR0FBRyxHQUFTLENBQUM7SUFDZixDQUFDLEVBQUUsRUFBRTtDQUNSLENBQUMsQ0FBQTtBQUNGLHlCQUF5QjtBQUN6QixTQUFTLElBQUksQ0FBQyxDQUFzQixJQUFHLENBQUM7QUFBQSxDQUFDO0FBQ3pDLElBQUksQ0FBQyxVQUFTLENBQUM7SUFDWCxPQUFhLENBQUMsRUFBRSxDQUFDLENBQUM7QUFDdEIsQ0FBQyxDQUFDLENBQUM7QUFFSCw0QkFBNEI7QUFDNUIsSUFBSSxLQUFLLEdBQThCLGNBQWEsT0FBTyxVQUFTLENBQUMsSUFBSSxPQUFhLENBQUMsRUFBRSxDQUFDLENBQUEsQ0FBQyxDQUFDLENBQUEsQ0FBQyxDQUFDLENBQUM7QUFFL0YsMEJBQTBCO0FBQzFCLE1BQU0sS0FBSztJQUFHLFlBQVksQ0FBc0IsSUFBSSxDQUFDO0NBQUU7QUFBQSxDQUFDO0FBQ3hELElBQUksQ0FBQyxHQUFHLElBQUksS0FBSyxDQUFDLFVBQVMsQ0FBQyxJQUFJLE9BQWEsQ0FBQyxFQUFFLENBQUMsQ0FBQSxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBRXJELHFDQUFxQztBQUNyQyxJQUFJLEtBQUssR0FBMkIsQ0FBQyxVQUFTLENBQUMsSUFBSSxPQUFPLENBQUMsQ0FBQSxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQy9ELElBQUksS0FBSyxHQUFVLENBQUM7SUFDaEIsQ0FBQyxFQUFFLENBQUM7Q0FDUCxDQUFDLENBQUM7QUFDSCxJQUFJLEtBQUssR0FBYyxFQUFFLENBQUM7QUFDMUIsSUFBSSxLQUFLLEdBQWdCLGNBQWEsT0FBYSxDQUFDLEVBQUUsQ0FBQyxDQUFBLENBQUMsQ0FBQyxDQUFDO0FBQzFELElBQUksS0FBSyxHQUF5QixVQUFTLENBQUMsSUFBSSxPQUFhLENBQUMsRUFBRSxDQUFDLENBQUEsQ0FBQyxDQUFDLENBQUM7QUFDcEUsSUFBSSxLQUFLLEdBQW9DLFVBQVMsQ0FBQyxFQUFFLENBQUMsSUFBSSxPQUFhLENBQUMsRUFBRSxDQUFDLENBQUEsQ0FBQyxDQUFDLENBQUM7QUFDbEYsSUFBSSxLQUFLLEdBR04sVUFBUyxDQUFRLElBQUksT0FBTyxDQUFDLENBQUEsQ0FBQyxDQUFDLENBQUM7QUFFbkMsSUFBSSxLQUFLLEdBQXNDLFVBQVMsQ0FBQyxJQUFJLE9BQU8sQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ3pFLElBQUksS0FBSyxHQUFnQixDQUFDLEVBQUUsRUFBQyxFQUFFLENBQUMsQ0FBQztBQUNqQyxJQUFJLE1BQU0sR0FBWSxDQUFPLENBQUMsRUFBRSxDQUFDLEVBQU8sQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDO0FBQzlDLElBQUksTUFBTSxHQUF5QyxDQUFDLFVBQVMsQ0FBQyxFQUFFLENBQUMsSUFBSSxPQUFPLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ2xGLElBQUksTUFBTSxHQUFVO0lBQ2hCLEdBQUcsRUFBUSxDQUFDLEVBQUUsQ0FBQztDQUNsQixDQUFBO0FBQ0QsSUFBSSxNQUFNLEdBQVUsQ0FBQztJQUNqQixDQUFDLEVBQUUsVUFBUyxDQUFDLEVBQUUsQ0FBQyxJQUFJLE9BQU8sQ0FBQyxDQUFDLENBQUMsQ0FBQztDQUNsQyxDQUFDLENBQUE7QUFDRixJQUFJLE1BQU0sR0FBVSxDQUFDO0lBQ2pCLENBQUMsRUFBRSxFQUFFO0NBQ1IsQ0FBQyxDQUFBO0FBT0YsU0FBUyxHQUFHLENBQUMsQ0FBQyxFQUFDLENBQUMsSUFBSSxPQUFPLENBQUMsR0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBRWpDLElBQUksR0FBRyxHQUFHLEdBQUcsQ0FBQyxDQUFDLEVBQUMsQ0FBQyxDQUFDLENBQUM7QUFjbkIsS0FBSyxDQUFDLE1BQU0sR0FBRyxJQUFJLEtBQUssQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUM7QUFFL0IsS0FBSyxDQUFDLFNBQVMsQ0FBQyxHQUFHLEdBQUcsVUFBUyxFQUFFLEVBQUUsRUFBRTtJQUNqQyxPQUFPLElBQUksS0FBSyxDQUFDLElBQUksQ0FBQyxDQUFDLEdBQUcsRUFBRSxFQUFFLElBQUksQ0FBQyxDQUFDLEdBQUcsRUFBRSxDQUFDLENBQUM7QUFDL0MsQ0FBQyxDQUFDO0FBRUYsS0FBSyxDQUFDLFNBQVMsR0FBRztJQUNkLENBQUMsRUFBRSxDQUFDO0lBQ0osQ0FBQyxFQUFFLENBQUM7SUFDSixHQUFHLEVBQUUsVUFBUyxFQUFFLEVBQUUsRUFBRTtRQUNoQixPQUFPLElBQUksS0FBSyxDQUFDLElBQUksQ0FBQyxDQUFDLEdBQUcsRUFBRSxFQUFFLElBQUksQ0FBQyxDQUFDLEdBQUcsRUFBRSxDQUFDLENBQUM7SUFDL0MsQ0FBQztDQUNKLENBQUM7QUFJRixJQUFJLENBQUMsR0FBTSxFQUFHLENBQUMifQ==,Ly8gREVGQVVMVCBJTlRFUkZBQ0VTCmludGVyZmFjZSBJRm9vIHsKICAgIG46IG51bWJlcjsKICAgIHM6IHN0cmluZzsKICAgIGYoaTogbnVtYmVyLCBzOiBzdHJpbmcpOiBzdHJpbmc7CiAgICBhOiBudW1iZXJbXTsKfQoKaW50ZXJmYWNlIElCYXIgewogICAgZm9vOiBJRm9vOwp9CgovLyBDT05URVhUOiBDbGFzcyBwcm9wZXJ0eSBkZWNsYXJhdGlvbgpjbGFzcyBDMVQ1IHsKICAgIGZvbzogKGk6IG51bWJlciwgczogc3RyaW5nKSA9PiBudW1iZXIgPSBmdW5jdGlvbihpKSB7CiAgICAgICAgcmV0dXJuIGk7CiAgICB9Cn0KCi8vIENPTlRFWFQ6IE5hbWVzcGFjZSBwcm9wZXJ0eSBkZWNsYXJhdGlvbgpuYW1lc3BhY2UgQzJUNSB7CiAgICBleHBvcnQgdmFyIGZvbzogKGk6IG51bWJlciwgczogc3RyaW5nKSA9PiBudW1iZXIgPSBmdW5jdGlvbihpKSB7CiAgICAgICAgcmV0dXJuIGk7CiAgICB9Cn0KCi8vIENPTlRFWFQ6IFZhcmlhYmxlIGRlY2xhcmF0aW9uCnZhciBjM3QxOiAoczogc3RyaW5nKSA9PiBzdHJpbmcgPSAoZnVuY3Rpb24ocykgeyByZXR1cm4gcyB9KTsKdmFyIGMzdDIgPSA8SUZvbz4oewogICAgbjogMQp9KQp2YXIgYzN0MzogbnVtYmVyW10gPSBbXTsKdmFyIGMzdDQ6ICgpID0+IElGb28gPSBmdW5jdGlvbigpIHsgcmV0dXJuIDxJRm9vPih7fSkgfTsKdmFyIGMzdDU6IChuOiBudW1iZXIpID0+IElGb28gPSBmdW5jdGlvbihuKSB7IHJldHVybiA8SUZvbz4oe30pIH07CnZhciBjM3Q2OiAobjogbnVtYmVyLCBzOiBzdHJpbmcpID0+IElGb28gPSBmdW5jdGlvbihuLCBzKSB7IHJldHVybiA8SUZvbz4oe30pIH07CnZhciBjM3Q3OiB7CiAgICAobjogbnVtYmVyKTogbnVtYmVyOyAgICAKICAgIChzMTogc3RyaW5nKTogbnVtYmVyOwp9ID0gZnVuY3Rpb24obikgeyByZXR1cm4gbjsgfTsKCnZhciBjM3Q4OiAobjogbnVtYmVyLCBzOiBzdHJpbmcpID0+IG51bWJlciA9IGZ1bmN0aW9uKG4pIHsgcmV0dXJuIG47IH07CnZhciBjM3Q5OiBudW1iZXJbXVtdID0gW1tdLFtdXTsKdmFyIGMzdDEwOiBJRm9vW10gPSBbPElGb28+KHt9KSw8SUZvbz4oe30pXTsKdmFyIGMzdDExOiB7KG46IG51bWJlciwgczogc3RyaW5nKTogc3RyaW5nO31bXSA9IFtmdW5jdGlvbihuLCBzKSB7IHJldHVybiBzOyB9XTsKdmFyIGMzdDEyOiBJQmFyID0gewogICAgZm9vOiA8SUZvbz4oe30pCn0KdmFyIGMzdDEzID0gPElGb28+KHsKICAgIGY6IGZ1bmN0aW9uKGksIHMpIHsgcmV0dXJuIHM7IH0KfSkKdmFyIGMzdDE0ID0gPElGb28+KHsKICAgIGE6IFtdCn0pCgovLyBDT05URVhUOiBDbGFzcyBwcm9wZXJ0eSBhc3NpZ25tZW50CmNsYXNzIEM0VDUgewogICAgZm9vOiAoaTogbnVtYmVyLCBzOiBzdHJpbmcpID0+IHN0cmluZzsKICAgIGNvbnN0cnVjdG9yKCkgewogICAgICAgIHRoaXMuZm9vID0gZnVuY3Rpb24oaSwgcykgewogICAgICAgICAgICByZXR1cm4gczsKICAgICAgICB9CiAgICB9Cn0KCi8vIENPTlRFWFQ6IE5hbWVzcGFjZSBwcm9wZXJ0eSBhc3NpZ25tZW50Cm5hbWVzcGFjZSBDNVQ1IHsKICAgIGV4cG9ydCB2YXIgZm9vOiAoaTogbnVtYmVyLCBzOiBzdHJpbmcpID0+IHN0cmluZzsKICAgIGZvbyA9IGZ1bmN0aW9uKGksIHMpIHsKICAgICAgICByZXR1cm4gczsKICAgIH0KfQoKLy8gQ09OVEVYVDogVmFyaWFibGUgYXNzaWdubWVudAp2YXIgYzZ0NTogKG46IG51bWJlcikgPT4gSUZvbzsKYzZ0NSA9IDwobjogbnVtYmVyKSA9PiBJRm9vPmZ1bmN0aW9uKG4pIHsgcmV0dXJuIDxJRm9vPih7fSkgfTsKCi8vIENPTlRFWFQ6IEFycmF5IGluZGV4IGFzc2lnbm1lbnQKdmFyIGM3dDI6IElGb29bXSA9IFtdOwpjN3QyWzBdID0gPElGb28+KHtuOiAxfSk7CgovLyBDT05URVhUOiBPYmplY3QgcHJvcGVydHkgYXNzaWdubWVudAppbnRlcmZhY2UgSVBsYWNlSG9sZGVyIHsKICAgIHQxOiAoczogc3RyaW5nKSA9PiBzdHJpbmc7CiAgICB0MjogSUZvbzsKICAgIHQzOiBudW1iZXJbXTsKICAgIHQ0OiAoKSA9PiBJRm9vOwogICAgdDU6IChuOiBudW1iZXIpID0+IElGb287CiAgICB0NjogKG46IG51bWJlciwgczogc3RyaW5nKSA9PiBJRm9vOwogICAgdDc6IHsKICAgICAgICAgICAgKG46IG51bWJlciwgczogc3RyaW5nKTogbnVtYmVyOyAgICAKICAgICAgICAgICAgLy8oczE6IHN0cmluZywgczI6IHN0cmluZyk6IG51bWJlcjsKICAgICAgICB9OwogICAgdDg6IChuOiBudW1iZXIsIHM6IHN0cmluZykgPT4gbnVtYmVyOwogICAgdDk6IG51bWJlcltdW107CiAgICB0MTA6IElGb29bXTsKICAgIHQxMTogeyhuOiBudW1iZXIsIHM6IHN0cmluZyk6IHN0cmluZzt9W107CiAgICB0MTI6IElCYXI7CiAgICB0MTM6IElGb287CiAgICB0MTQ6IElGb287CiAgICB9Cgp2YXIgb2JqYzg6IHsKICAgIHQxOiAoczogc3RyaW5nKSA9PiBzdHJpbmc7CiAgICB0MjogSUZvbzsKICAgIHQzOiBudW1iZXJbXTsKICAgIHQ0OiAoKSA9PiBJRm9vOwogICAgdDU6IChuOiBudW1iZXIpID0+IElGb287CiAgICB0NjogKG46IG51bWJlciwgczogc3RyaW5nKSA9PiBJRm9vOwogICAgdDc6IHsKICAgICAgICAgICAgKG46IG51bWJlciwgczogc3RyaW5nKTogbnVtYmVyOyAgICAKICAgICAgICAgICAgLy8oczE6IHN0cmluZywgczI6IHN0cmluZyk6IG51bWJlcjsKICAgICAgICB9OwogICAgdDg6IChuOiBudW1iZXIsIHM6IHN0cmluZykgPT4gbnVtYmVyOwogICAgdDk6IG51bWJlcltdW107CiAgICB0MTA6IElGb29bXTsKICAgIHQxMTogeyhuOiBudW1iZXIsIHM6IHN0cmluZyk6IHN0cmluZzt9W107CiAgICB0MTI6IElCYXI7CiAgICB0MTM6IElGb287CiAgICB0MTQ6IElGb287Cn0gPSA8SVBsYWNlSG9sZGVyPih7fSk7CgpvYmpjOC50MSA9IChmdW5jdGlvbihzKSB7IHJldHVybiBzIH0pOwpvYmpjOC50MiA9IDxJRm9vPih7CiAgICBuOiAxCn0pOwpvYmpjOC50MyA9IFtdOwpvYmpjOC50NCA9IGZ1bmN0aW9uKCkgeyByZXR1cm4gPElGb28+KHt9KSB9OwpvYmpjOC50NSA9IGZ1bmN0aW9uKG4pIHsgcmV0dXJuIDxJRm9vPih7fSkgfTsKb2JqYzgudDYgPSBmdW5jdGlvbihuLCBzKSB7IHJldHVybiA8SUZvbz4oe30pIH07Cm9iamM4LnQ3ID0gZnVuY3Rpb24objogbnVtYmVyKSB7IHJldHVybiBuIH07CgpvYmpjOC50OCA9IGZ1bmN0aW9uKG4pIHsgcmV0dXJuIG47IH07Cm9iamM4LnQ5ID0gW1tdLFtdXTsKb2JqYzgudDEwID0gWzxJRm9vPih7fSksPElGb28+KHt9KV07Cm9iamM4LnQxMSA9IFtmdW5jdGlvbihuLCBzKSB7IHJldHVybiBzOyB9XTsKb2JqYzgudDEyID0gewogICAgZm9vOiA8SUZvbz4oe30pCn0Kb2JqYzgudDEzID0gPElGb28+KHsKICAgIGY6IGZ1bmN0aW9uKGksIHMpIHsgcmV0dXJuIHM7IH0KfSkKb2JqYzgudDE0ID0gPElGb28+KHsKICAgIGE6IFtdCn0pCi8vIENPTlRFWFQ6IEZ1bmN0aW9uIGNhbGwKZnVuY3Rpb24gYzl0NShmOiAobjogbnVtYmVyKSA9PiBJRm9vKSB7fTsKYzl0NShmdW5jdGlvbihuKSB7CiAgICByZXR1cm4gPElGb28+KHt9KTsKfSk7CgovLyBDT05URVhUOiBSZXR1cm4gc3RhdGVtZW50CnZhciBjMTB0NTogKCkgPT4gKG46IG51bWJlcikgPT4gSUZvbyA9IGZ1bmN0aW9uKCkgeyByZXR1cm4gZnVuY3Rpb24obikgeyByZXR1cm4gPElGb28+KHt9KSB9IH07CgovLyBDT05URVhUOiBOZXdpbmcgYSBjbGFzcwpjbGFzcyBDMTF0NSB7IGNvbnN0cnVjdG9yKGY6IChuOiBudW1iZXIpID0+IElGb28pIHsgfSB9Owp2YXIgaSA9IG5ldyBDMTF0NShmdW5jdGlvbihuKSB7IHJldHVybiA8SUZvbz4oe30pIH0pOwoKLy8gQ09OVEVYVDogVHlwZSBhbm5vdGF0ZWQgZXhwcmVzc2lvbgp2YXIgYzEydDEgPSA8KHM6IHN0cmluZykgPT4gc3RyaW5nPiAoZnVuY3Rpb24ocykgeyByZXR1cm4gcyB9KTsKdmFyIGMxMnQyID0gPElGb28+ICh7CiAgICBuOiAxCn0pOwp2YXIgYzEydDMgPSA8bnVtYmVyW10+IFtdOwp2YXIgYzEydDQgPSA8KCkgPT4gSUZvbz4gZnVuY3Rpb24oKSB7IHJldHVybiA8SUZvbz4oe30pIH07CnZhciBjMTJ0NSA9IDwobjogbnVtYmVyKSA9PiBJRm9vPiBmdW5jdGlvbihuKSB7IHJldHVybiA8SUZvbz4oe30pIH07CnZhciBjMTJ0NiA9IDwobjogbnVtYmVyLCBzOiBzdHJpbmcpID0+IElGb28+IGZ1bmN0aW9uKG4sIHMpIHsgcmV0dXJuIDxJRm9vPih7fSkgfTsKdmFyIGMxMnQ3ID0gPHsKICAgIChuOiBudW1iZXIsIHM6IHN0cmluZyk6IG51bWJlcjsgICAgCiAgICAvLyhzMTogc3RyaW5nLCBzMjogc3RyaW5nKTogbnVtYmVyOwp9PiBmdW5jdGlvbihuOm51bWJlcikgeyByZXR1cm4gbiB9OwoKdmFyIGMxMnQ4ID0gPChuOiBudW1iZXIsIHM6IHN0cmluZykgPT4gbnVtYmVyPiBmdW5jdGlvbihuKSB7IHJldHVybiBuOyB9Owp2YXIgYzEydDkgPSA8bnVtYmVyW11bXT4gW1tdLFtdXTsKdmFyIGMxMnQxMCA9IDxJRm9vW10+IFs8SUZvbz4oe30pLDxJRm9vPih7fSldOwp2YXIgYzEydDExID0gPHsobjogbnVtYmVyLCBzOiBzdHJpbmcpOiBzdHJpbmc7fVtdPiBbZnVuY3Rpb24obiwgcykgeyByZXR1cm4gczsgfV07CnZhciBjMTJ0MTIgPSA8SUJhcj4gewogICAgZm9vOiA8SUZvbz4oe30pCn0KdmFyIGMxMnQxMyA9IDxJRm9vPiAoewogICAgZjogZnVuY3Rpb24oaSwgcykgeyByZXR1cm4gczsgfQp9KQp2YXIgYzEydDE0ID0gPElGb28+ICh7CiAgICBhOiBbXQp9KQoKLy8gQ09OVEVYVDogQ29udGV4dHVhbCB0eXBpbmcgZGVjbGFyYXRpb25zCgovLyBjb250ZXh0dWFsbHkgdHlwaW5nIGZ1bmN0aW9uIGRlY2xhcmF0aW9ucwpkZWNsYXJlIGZ1bmN0aW9uIEVGMShhOm51bWJlciwgYjpudW1iZXIpOm51bWJlcjsKCmZ1bmN0aW9uIEVGMShhLGIpIHsgcmV0dXJuIGErYjsgfQoKdmFyIGVmdiA9IEVGMSgxLDIpOwoKCi8vIGNvbnRleHR1YWxseSB0eXBpbmcgZnJvbSBhbWJpZW50IGNsYXNzIGRlY2xhcmF0aW9ucwpkZWNsYXJlIGNsYXNzIFBvaW50CnsKICAgICAgY29uc3RydWN0b3IoeDogbnVtYmVyLCB5OiBudW1iZXIpOwogICAgICB4OiBudW1iZXI7CiAgICAgIHk6IG51bWJlcjsKICAgICAgYWRkKGR4OiBudW1iZXIsIGR5OiBudW1iZXIpOiBQb2ludDsKICAgICAgc3RhdGljIG9yaWdpbjogUG9pbnQ7Cgp9CgpQb2ludC5vcmlnaW4gPSBuZXcgUG9pbnQoMCwgMCk7CgpQb2ludC5wcm90b3R5cGUuYWRkID0gZnVuY3Rpb24oZHgsIGR5KSB7CiAgICByZXR1cm4gbmV3IFBvaW50KHRoaXMueCArIGR4LCB0aGlzLnkgKyBkeSk7Cn07CgpQb2ludC5wcm90b3R5cGUgPSB7CiAgICB4OiAwLAogICAgeTogMCwKICAgIGFkZDogZnVuY3Rpb24oZHgsIGR5KSB7CiAgICAgICAgcmV0dXJuIG5ldyBQb2ludCh0aGlzLnggKyBkeCwgdGhpcy55ICsgZHkpOwogICAgfQp9OwoKaW50ZXJmYWNlIEEgeyB4OiBzdHJpbmc7IH0KaW50ZXJmYWNlIEIgZXh0ZW5kcyBBIHsgfQp2YXIgeDogQiA9IHsgfTsK +{"version":3,"file":"contextualTyping.js","sourceRoot":"","sources":["contextualTyping.ts"],"names":[],"mappings":";AAYA,sCAAsC;AACtC,MAAM,IAAI;IAAV;QACI,QAAG,GAAqC,UAAS,CAAC;YAC9C,OAAO,CAAC,CAAC;QACb,CAAC,CAAA;IACL,CAAC;CAAA;AAED,0CAA0C;AAC1C,IAAU,IAAI,CAIb;AAJD,WAAU,IAAI;IACC,QAAG,GAAqC,UAAS,CAAC;QACzD,OAAO,CAAC,CAAC;IACb,CAAC,CAAA;AACL,CAAC,EAJS,IAAI,KAAJ,IAAI,QAIb;AAED,gCAAgC;AAChC,IAAI,IAAI,GAA0B,CAAC,UAAS,CAAC,IAAI,OAAO,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC;AAC7D,IAAI,IAAI,GAAS,CAAC;IACd,CAAC,EAAE,CAAC;CACP,CAAC,CAAA;AACF,IAAI,IAAI,GAAa,EAAE,CAAC;AACxB,IAAI,IAAI,GAAe,cAAa,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AACxD,IAAI,IAAI,GAAwB,UAAS,CAAC,IAAI,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAClE,IAAI,IAAI,GAAmC,UAAS,CAAC,EAAE,CAAC,IAAI,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAChF,IAAI,IAAI,GAGJ,UAAS,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AAE9B,IAAI,IAAI,GAAqC,UAAS,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AACvE,IAAI,IAAI,GAAe,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC;AAC/B,IAAI,KAAK,GAAW,CAAO,CAAC,EAAE,CAAC,EAAO,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5C,IAAI,KAAK,GAAwC,CAAC,UAAS,CAAC,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAChF,IAAI,KAAK,GAAS;IACd,GAAG,EAAQ,CAAC,EAAE,CAAC;CAClB,CAAA;AACD,IAAI,KAAK,GAAS,CAAC;IACf,CAAC,EAAE,UAAS,CAAC,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;CAClC,CAAC,CAAA;AACF,IAAI,KAAK,GAAS,CAAC;IACf,CAAC,EAAE,EAAE;CACR,CAAC,CAAA;AAEF,qCAAqC;AACrC,MAAM,IAAI;IAEN;QACI,IAAI,CAAC,GAAG,GAAG,UAAS,CAAC,EAAE,CAAC;YACpB,OAAO,CAAC,CAAC;QACb,CAAC,CAAA;IACL,CAAC;CACJ;AAED,yCAAyC;AACzC,IAAU,IAAI,CAKb;AALD,WAAU,IAAI;IAEV,KAAA,GAAG,GAAG,UAAS,CAAC,EAAE,CAAC;QACf,OAAO,CAAC,CAAC;IACb,CAAC,CAAA;AACL,CAAC,EALS,IAAI,KAAJ,IAAI,QAKb;AAED,+BAA+B;AAC/B,IAAI,IAAyB,CAAC;AAC9B,IAAI,GAAwB,UAAS,CAAC,IAAI,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAE9D,kCAAkC;AAClC,IAAI,IAAI,GAAW,EAAE,CAAC;AACtB,IAAI,CAAC,CAAC,CAAC,GAAS,CAAC,EAAC,CAAC,EAAE,CAAC,EAAC,CAAC,CAAC;AAuBzB,IAAI,KAAK,GAkBS,CAAC,EAAE,CAAC,CAAC;AAEvB,KAAK,CAAC,EAAE,GAAG,CAAC,UAAS,CAAC,IAAI,OAAO,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC;AACtC,KAAK,CAAC,EAAE,GAAS,CAAC;IACd,CAAC,EAAE,CAAC;CACP,CAAC,CAAC;AACH,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC;AACd,KAAK,CAAC,EAAE,GAAG,cAAa,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAC5C,KAAK,CAAC,EAAE,GAAG,UAAS,CAAC,IAAI,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAC7C,KAAK,CAAC,EAAE,GAAG,UAAS,CAAC,EAAE,CAAC,IAAI,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAChD,KAAK,CAAC,EAAE,GAAG,UAAS,CAAS,IAAI,OAAO,CAAC,CAAA,CAAC,CAAC,CAAC;AAE5C,KAAK,CAAC,EAAE,GAAG,UAAS,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AACrC,KAAK,CAAC,EAAE,GAAG,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC;AACnB,KAAK,CAAC,GAAG,GAAG,CAAO,CAAC,EAAE,CAAC,EAAO,CAAC,EAAE,CAAC,CAAC,CAAC;AACpC,KAAK,CAAC,GAAG,GAAG,CAAC,UAAS,CAAC,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3C,KAAK,CAAC,GAAG,GAAG;IACR,GAAG,EAAQ,CAAC,EAAE,CAAC;CAClB,CAAA;AACD,KAAK,CAAC,GAAG,GAAS,CAAC;IACf,CAAC,EAAE,UAAS,CAAC,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;CAClC,CAAC,CAAA;AACF,KAAK,CAAC,GAAG,GAAS,CAAC;IACf,CAAC,EAAE,EAAE;CACR,CAAC,CAAA;AACF,yBAAyB;AACzB,SAAS,IAAI,CAAC,CAAsB,IAAG,CAAC;AAAA,CAAC;AACzC,IAAI,CAAC,UAAS,CAAC;IACX,OAAa,CAAC,EAAE,CAAC,CAAC;AACtB,CAAC,CAAC,CAAC;AAEH,4BAA4B;AAC5B,IAAI,KAAK,GAA8B,cAAa,OAAO,UAAS,CAAC,IAAI,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAA,CAAC,CAAC,CAAC;AAE/F,0BAA0B;AAC1B,MAAM,KAAK;IAAG,YAAY,CAAsB,IAAI,CAAC;CAAE;AAAA,CAAC;AACxD,IAAI,CAAC,GAAG,IAAI,KAAK,CAAC,UAAS,CAAC,IAAI,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC;AAErD,qCAAqC;AACrC,IAAI,KAAK,GAA2B,CAAC,UAAS,CAAC,IAAI,OAAO,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC;AAC/D,IAAI,KAAK,GAAU,CAAC;IAChB,CAAC,EAAE,CAAC;CACP,CAAC,CAAC;AACH,IAAI,KAAK,GAAc,EAAE,CAAC;AAC1B,IAAI,KAAK,GAAgB,cAAa,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAC1D,IAAI,KAAK,GAAyB,UAAS,CAAC,IAAI,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AACpE,IAAI,KAAK,GAAoC,UAAS,CAAC,EAAE,CAAC,IAAI,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAClF,IAAI,KAAK,GAGN,UAAS,CAAQ,IAAI,OAAO,CAAC,CAAA,CAAC,CAAC,CAAC;AAEnC,IAAI,KAAK,GAAsC,UAAS,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AACzE,IAAI,KAAK,GAAgB,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC;AACjC,IAAI,MAAM,GAAY,CAAO,CAAC,EAAE,CAAC,EAAO,CAAC,EAAE,CAAC,CAAC,CAAC;AAC9C,IAAI,MAAM,GAAyC,CAAC,UAAS,CAAC,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClF,IAAI,MAAM,GAAU;IAChB,GAAG,EAAQ,CAAC,EAAE,CAAC;CAClB,CAAA;AACD,IAAI,MAAM,GAAU,CAAC;IACjB,CAAC,EAAE,UAAS,CAAC,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;CAClC,CAAC,CAAA;AACF,IAAI,MAAM,GAAU,CAAC;IACjB,CAAC,EAAE,EAAE;CACR,CAAC,CAAA;AAOF,SAAS,GAAG,CAAC,CAAC,EAAC,CAAC,IAAI,OAAO,CAAC,GAAC,CAAC,CAAC,CAAC,CAAC;AAEjC,IAAI,GAAG,GAAG,GAAG,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC;AAcnB,KAAK,CAAC,MAAM,GAAG,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAE/B,KAAK,CAAC,SAAS,CAAC,GAAG,GAAG,UAAS,EAAE,EAAE,EAAE;IACjC,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;AAC/C,CAAC,CAAC;AAEF,KAAK,CAAC,SAAS,GAAG;IACd,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,GAAG,EAAE,UAAS,EAAE,EAAE,EAAE;QAChB,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IAC/C,CAAC;CACJ,CAAC;AAIF,IAAI,CAAC,GAAM,EAAG,CAAC"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KLy8gQ09OVEVYVDogQ2xhc3MgcHJvcGVydHkgZGVjbGFyYXRpb24NCmNsYXNzIEMxVDUgew0KICAgIGNvbnN0cnVjdG9yKCkgew0KICAgICAgICB0aGlzLmZvbyA9IGZ1bmN0aW9uIChpKSB7DQogICAgICAgICAgICByZXR1cm4gaTsNCiAgICAgICAgfTsNCiAgICB9DQp9DQovLyBDT05URVhUOiBOYW1lc3BhY2UgcHJvcGVydHkgZGVjbGFyYXRpb24NCnZhciBDMlQ1Ow0KKGZ1bmN0aW9uIChDMlQ1KSB7DQogICAgQzJUNS5mb28gPSBmdW5jdGlvbiAoaSkgew0KICAgICAgICByZXR1cm4gaTsNCiAgICB9Ow0KfSkoQzJUNSB8fCAoQzJUNSA9IHt9KSk7DQovLyBDT05URVhUOiBWYXJpYWJsZSBkZWNsYXJhdGlvbg0KdmFyIGMzdDEgPSAoZnVuY3Rpb24gKHMpIHsgcmV0dXJuIHM7IH0pOw0KdmFyIGMzdDIgPSAoew0KICAgIG46IDENCn0pOw0KdmFyIGMzdDMgPSBbXTsNCnZhciBjM3Q0ID0gZnVuY3Rpb24gKCkgeyByZXR1cm4gKHt9KTsgfTsNCnZhciBjM3Q1ID0gZnVuY3Rpb24gKG4pIHsgcmV0dXJuICh7fSk7IH07DQp2YXIgYzN0NiA9IGZ1bmN0aW9uIChuLCBzKSB7IHJldHVybiAoe30pOyB9Ow0KdmFyIGMzdDcgPSBmdW5jdGlvbiAobikgeyByZXR1cm4gbjsgfTsNCnZhciBjM3Q4ID0gZnVuY3Rpb24gKG4pIHsgcmV0dXJuIG47IH07DQp2YXIgYzN0OSA9IFtbXSwgW11dOw0KdmFyIGMzdDEwID0gWyh7fSksICh7fSldOw0KdmFyIGMzdDExID0gW2Z1bmN0aW9uIChuLCBzKSB7IHJldHVybiBzOyB9XTsNCnZhciBjM3QxMiA9IHsNCiAgICBmb286ICh7fSkNCn07DQp2YXIgYzN0MTMgPSAoew0KICAgIGY6IGZ1bmN0aW9uIChpLCBzKSB7IHJldHVybiBzOyB9DQp9KTsNCnZhciBjM3QxNCA9ICh7DQogICAgYTogW10NCn0pOw0KLy8gQ09OVEVYVDogQ2xhc3MgcHJvcGVydHkgYXNzaWdubWVudA0KY2xhc3MgQzRUNSB7DQogICAgY29uc3RydWN0b3IoKSB7DQogICAgICAgIHRoaXMuZm9vID0gZnVuY3Rpb24gKGksIHMpIHsNCiAgICAgICAgICAgIHJldHVybiBzOw0KICAgICAgICB9Ow0KICAgIH0NCn0NCi8vIENPTlRFWFQ6IE5hbWVzcGFjZSBwcm9wZXJ0eSBhc3NpZ25tZW50DQp2YXIgQzVUNTsNCihmdW5jdGlvbiAoQzVUNSkgew0KICAgIEM1VDUuZm9vID0gZnVuY3Rpb24gKGksIHMpIHsNCiAgICAgICAgcmV0dXJuIHM7DQogICAgfTsNCn0pKEM1VDUgfHwgKEM1VDUgPSB7fSkpOw0KLy8gQ09OVEVYVDogVmFyaWFibGUgYXNzaWdubWVudA0KdmFyIGM2dDU7DQpjNnQ1ID0gZnVuY3Rpb24gKG4pIHsgcmV0dXJuICh7fSk7IH07DQovLyBDT05URVhUOiBBcnJheSBpbmRleCBhc3NpZ25tZW50DQp2YXIgYzd0MiA9IFtdOw0KYzd0MlswXSA9ICh7IG46IDEgfSk7DQp2YXIgb2JqYzggPSAoe30pOw0Kb2JqYzgudDEgPSAoZnVuY3Rpb24gKHMpIHsgcmV0dXJuIHM7IH0pOw0Kb2JqYzgudDIgPSAoew0KICAgIG46IDENCn0pOw0Kb2JqYzgudDMgPSBbXTsNCm9iamM4LnQ0ID0gZnVuY3Rpb24gKCkgeyByZXR1cm4gKHt9KTsgfTsNCm9iamM4LnQ1ID0gZnVuY3Rpb24gKG4pIHsgcmV0dXJuICh7fSk7IH07DQpvYmpjOC50NiA9IGZ1bmN0aW9uIChuLCBzKSB7IHJldHVybiAoe30pOyB9Ow0Kb2JqYzgudDcgPSBmdW5jdGlvbiAobikgeyByZXR1cm4gbjsgfTsNCm9iamM4LnQ4ID0gZnVuY3Rpb24gKG4pIHsgcmV0dXJuIG47IH07DQpvYmpjOC50OSA9IFtbXSwgW11dOw0Kb2JqYzgudDEwID0gWyh7fSksICh7fSldOw0Kb2JqYzgudDExID0gW2Z1bmN0aW9uIChuLCBzKSB7IHJldHVybiBzOyB9XTsNCm9iamM4LnQxMiA9IHsNCiAgICBmb286ICh7fSkNCn07DQpvYmpjOC50MTMgPSAoew0KICAgIGY6IGZ1bmN0aW9uIChpLCBzKSB7IHJldHVybiBzOyB9DQp9KTsNCm9iamM4LnQxNCA9ICh7DQogICAgYTogW10NCn0pOw0KLy8gQ09OVEVYVDogRnVuY3Rpb24gY2FsbA0KZnVuY3Rpb24gYzl0NShmKSB7IH0NCjsNCmM5dDUoZnVuY3Rpb24gKG4pIHsNCiAgICByZXR1cm4gKHt9KTsNCn0pOw0KLy8gQ09OVEVYVDogUmV0dXJuIHN0YXRlbWVudA0KdmFyIGMxMHQ1ID0gZnVuY3Rpb24gKCkgeyByZXR1cm4gZnVuY3Rpb24gKG4pIHsgcmV0dXJuICh7fSk7IH07IH07DQovLyBDT05URVhUOiBOZXdpbmcgYSBjbGFzcw0KY2xhc3MgQzExdDUgew0KICAgIGNvbnN0cnVjdG9yKGYpIHsgfQ0KfQ0KOw0KdmFyIGkgPSBuZXcgQzExdDUoZnVuY3Rpb24gKG4pIHsgcmV0dXJuICh7fSk7IH0pOw0KLy8gQ09OVEVYVDogVHlwZSBhbm5vdGF0ZWQgZXhwcmVzc2lvbg0KdmFyIGMxMnQxID0gKGZ1bmN0aW9uIChzKSB7IHJldHVybiBzOyB9KTsNCnZhciBjMTJ0MiA9ICh7DQogICAgbjogMQ0KfSk7DQp2YXIgYzEydDMgPSBbXTsNCnZhciBjMTJ0NCA9IGZ1bmN0aW9uICgpIHsgcmV0dXJuICh7fSk7IH07DQp2YXIgYzEydDUgPSBmdW5jdGlvbiAobikgeyByZXR1cm4gKHt9KTsgfTsNCnZhciBjMTJ0NiA9IGZ1bmN0aW9uIChuLCBzKSB7IHJldHVybiAoe30pOyB9Ow0KdmFyIGMxMnQ3ID0gZnVuY3Rpb24gKG4pIHsgcmV0dXJuIG47IH07DQp2YXIgYzEydDggPSBmdW5jdGlvbiAobikgeyByZXR1cm4gbjsgfTsNCnZhciBjMTJ0OSA9IFtbXSwgW11dOw0KdmFyIGMxMnQxMCA9IFsoe30pLCAoe30pXTsNCnZhciBjMTJ0MTEgPSBbZnVuY3Rpb24gKG4sIHMpIHsgcmV0dXJuIHM7IH1dOw0KdmFyIGMxMnQxMiA9IHsNCiAgICBmb286ICh7fSkNCn07DQp2YXIgYzEydDEzID0gKHsNCiAgICBmOiBmdW5jdGlvbiAoaSwgcykgeyByZXR1cm4gczsgfQ0KfSk7DQp2YXIgYzEydDE0ID0gKHsNCiAgICBhOiBbXQ0KfSk7DQpmdW5jdGlvbiBFRjEoYSwgYikgeyByZXR1cm4gYSArIGI7IH0NCnZhciBlZnYgPSBFRjEoMSwgMik7DQpQb2ludC5vcmlnaW4gPSBuZXcgUG9pbnQoMCwgMCk7DQpQb2ludC5wcm90b3R5cGUuYWRkID0gZnVuY3Rpb24gKGR4LCBkeSkgew0KICAgIHJldHVybiBuZXcgUG9pbnQodGhpcy54ICsgZHgsIHRoaXMueSArIGR5KTsNCn07DQpQb2ludC5wcm90b3R5cGUgPSB7DQogICAgeDogMCwNCiAgICB5OiAwLA0KICAgIGFkZDogZnVuY3Rpb24gKGR4LCBkeSkgew0KICAgICAgICByZXR1cm4gbmV3IFBvaW50KHRoaXMueCArIGR4LCB0aGlzLnkgKyBkeSk7DQogICAgfQ0KfTsNCnZhciB4ID0ge307DQovLyMgc291cmNlTWFwcGluZ1VSTD1jb250ZXh0dWFsVHlwaW5nLmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udGV4dHVhbFR5cGluZy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImNvbnRleHR1YWxUeXBpbmcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQVlBLHNDQUFzQztBQUN0QyxNQUFNLElBQUk7SUFBVjtRQUNJLFFBQUcsR0FBcUMsVUFBUyxDQUFDO1lBQzlDLE9BQU8sQ0FBQyxDQUFDO1FBQ2IsQ0FBQyxDQUFBO0lBQ0wsQ0FBQztDQUFBO0FBRUQsMENBQTBDO0FBQzFDLElBQVUsSUFBSSxDQUliO0FBSkQsV0FBVSxJQUFJO0lBQ0MsUUFBRyxHQUFxQyxVQUFTLENBQUM7UUFDekQsT0FBTyxDQUFDLENBQUM7SUFDYixDQUFDLENBQUE7QUFDTCxDQUFDLEVBSlMsSUFBSSxLQUFKLElBQUksUUFJYjtBQUVELGdDQUFnQztBQUNoQyxJQUFJLElBQUksR0FBMEIsQ0FBQyxVQUFTLENBQUMsSUFBSSxPQUFPLENBQUMsQ0FBQSxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQzdELElBQUksSUFBSSxHQUFTLENBQUM7SUFDZCxDQUFDLEVBQUUsQ0FBQztDQUNQLENBQUMsQ0FBQTtBQUNGLElBQUksSUFBSSxHQUFhLEVBQUUsQ0FBQztBQUN4QixJQUFJLElBQUksR0FBZSxjQUFhLE9BQWEsQ0FBQyxFQUFFLENBQUMsQ0FBQSxDQUFDLENBQUMsQ0FBQztBQUN4RCxJQUFJLElBQUksR0FBd0IsVUFBUyxDQUFDLElBQUksT0FBYSxDQUFDLEVBQUUsQ0FBQyxDQUFBLENBQUMsQ0FBQyxDQUFDO0FBQ2xFLElBQUksSUFBSSxHQUFtQyxVQUFTLENBQUMsRUFBRSxDQUFDLElBQUksT0FBYSxDQUFDLEVBQUUsQ0FBQyxDQUFBLENBQUMsQ0FBQyxDQUFDO0FBQ2hGLElBQUksSUFBSSxHQUdKLFVBQVMsQ0FBQyxJQUFJLE9BQU8sQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBRTlCLElBQUksSUFBSSxHQUFxQyxVQUFTLENBQUMsSUFBSSxPQUFPLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUN2RSxJQUFJLElBQUksR0FBZSxDQUFDLEVBQUUsRUFBQyxFQUFFLENBQUMsQ0FBQztBQUMvQixJQUFJLEtBQUssR0FBVyxDQUFPLENBQUMsRUFBRSxDQUFDLEVBQU8sQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDO0FBQzVDLElBQUksS0FBSyxHQUF3QyxDQUFDLFVBQVMsQ0FBQyxFQUFFLENBQUMsSUFBSSxPQUFPLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ2hGLElBQUksS0FBSyxHQUFTO0lBQ2QsR0FBRyxFQUFRLENBQUMsRUFBRSxDQUFDO0NBQ2xCLENBQUE7QUFDRCxJQUFJLEtBQUssR0FBUyxDQUFDO0lBQ2YsQ0FBQyxFQUFFLFVBQVMsQ0FBQyxFQUFFLENBQUMsSUFBSSxPQUFPLENBQUMsQ0FBQyxDQUFDLENBQUM7Q0FDbEMsQ0FBQyxDQUFBO0FBQ0YsSUFBSSxLQUFLLEdBQVMsQ0FBQztJQUNmLENBQUMsRUFBRSxFQUFFO0NBQ1IsQ0FBQyxDQUFBO0FBRUYscUNBQXFDO0FBQ3JDLE1BQU0sSUFBSTtJQUVOO1FBQ0ksSUFBSSxDQUFDLEdBQUcsR0FBRyxVQUFTLENBQUMsRUFBRSxDQUFDO1lBQ3BCLE9BQU8sQ0FBQyxDQUFDO1FBQ2IsQ0FBQyxDQUFBO0lBQ0wsQ0FBQztDQUNKO0FBRUQseUNBQXlDO0FBQ3pDLElBQVUsSUFBSSxDQUtiO0FBTEQsV0FBVSxJQUFJO0lBRVYsS0FBQSxHQUFHLEdBQUcsVUFBUyxDQUFDLEVBQUUsQ0FBQztRQUNmLE9BQU8sQ0FBQyxDQUFDO0lBQ2IsQ0FBQyxDQUFBO0FBQ0wsQ0FBQyxFQUxTLElBQUksS0FBSixJQUFJLFFBS2I7QUFFRCwrQkFBK0I7QUFDL0IsSUFBSSxJQUF5QixDQUFDO0FBQzlCLElBQUksR0FBd0IsVUFBUyxDQUFDLElBQUksT0FBYSxDQUFDLEVBQUUsQ0FBQyxDQUFBLENBQUMsQ0FBQyxDQUFDO0FBRTlELGtDQUFrQztBQUNsQyxJQUFJLElBQUksR0FBVyxFQUFFLENBQUM7QUFDdEIsSUFBSSxDQUFDLENBQUMsQ0FBQyxHQUFTLENBQUMsRUFBQyxDQUFDLEVBQUUsQ0FBQyxFQUFDLENBQUMsQ0FBQztBQXVCekIsSUFBSSxLQUFLLEdBa0JTLENBQUMsRUFBRSxDQUFDLENBQUM7QUFFdkIsS0FBSyxDQUFDLEVBQUUsR0FBRyxDQUFDLFVBQVMsQ0FBQyxJQUFJLE9BQU8sQ0FBQyxDQUFBLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDdEMsS0FBSyxDQUFDLEVBQUUsR0FBUyxDQUFDO0lBQ2QsQ0FBQyxFQUFFLENBQUM7Q0FDUCxDQUFDLENBQUM7QUFDSCxLQUFLLENBQUMsRUFBRSxHQUFHLEVBQUUsQ0FBQztBQUNkLEtBQUssQ0FBQyxFQUFFLEdBQUcsY0FBYSxPQUFhLENBQUMsRUFBRSxDQUFDLENBQUEsQ0FBQyxDQUFDLENBQUM7QUFDNUMsS0FBSyxDQUFDLEVBQUUsR0FBRyxVQUFTLENBQUMsSUFBSSxPQUFhLENBQUMsRUFBRSxDQUFDLENBQUEsQ0FBQyxDQUFDLENBQUM7QUFDN0MsS0FBSyxDQUFDLEVBQUUsR0FBRyxVQUFTLENBQUMsRUFBRSxDQUFDLElBQUksT0FBYSxDQUFDLEVBQUUsQ0FBQyxDQUFBLENBQUMsQ0FBQyxDQUFDO0FBQ2hELEtBQUssQ0FBQyxFQUFFLEdBQUcsVUFBUyxDQUFTLElBQUksT0FBTyxDQUFDLENBQUEsQ0FBQyxDQUFDLENBQUM7QUFFNUMsS0FBSyxDQUFDLEVBQUUsR0FBRyxVQUFTLENBQUMsSUFBSSxPQUFPLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNyQyxLQUFLLENBQUMsRUFBRSxHQUFHLENBQUMsRUFBRSxFQUFDLEVBQUUsQ0FBQyxDQUFDO0FBQ25CLEtBQUssQ0FBQyxHQUFHLEdBQUcsQ0FBTyxDQUFDLEVBQUUsQ0FBQyxFQUFPLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQztBQUNwQyxLQUFLLENBQUMsR0FBRyxHQUFHLENBQUMsVUFBUyxDQUFDLEVBQUUsQ0FBQyxJQUFJLE9BQU8sQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDM0MsS0FBSyxDQUFDLEdBQUcsR0FBRztJQUNSLEdBQUcsRUFBUSxDQUFDLEVBQUUsQ0FBQztDQUNsQixDQUFBO0FBQ0QsS0FBSyxDQUFDLEdBQUcsR0FBUyxDQUFDO0lBQ2YsQ0FBQyxFQUFFLFVBQVMsQ0FBQyxFQUFFLENBQUMsSUFBSSxPQUFPLENBQUMsQ0FBQyxDQUFDLENBQUM7Q0FDbEMsQ0FBQyxDQUFBO0FBQ0YsS0FBSyxDQUFDLEdBQUcsR0FBUyxDQUFDO0lBQ2YsQ0FBQyxFQUFFLEVBQUU7Q0FDUixDQUFDLENBQUE7QUFDRix5QkFBeUI7QUFDekIsU0FBUyxJQUFJLENBQUMsQ0FBc0IsSUFBRyxDQUFDO0FBQUEsQ0FBQztBQUN6QyxJQUFJLENBQUMsVUFBUyxDQUFDO0lBQ1gsT0FBYSxDQUFDLEVBQUUsQ0FBQyxDQUFDO0FBQ3RCLENBQUMsQ0FBQyxDQUFDO0FBRUgsNEJBQTRCO0FBQzVCLElBQUksS0FBSyxHQUE4QixjQUFhLE9BQU8sVUFBUyxDQUFDLElBQUksT0FBYSxDQUFDLEVBQUUsQ0FBQyxDQUFBLENBQUMsQ0FBQyxDQUFBLENBQUMsQ0FBQyxDQUFDO0FBRS9GLDBCQUEwQjtBQUMxQixNQUFNLEtBQUs7SUFBRyxZQUFZLENBQXNCLElBQUksQ0FBQztDQUFFO0FBQUEsQ0FBQztBQUN4RCxJQUFJLENBQUMsR0FBRyxJQUFJLEtBQUssQ0FBQyxVQUFTLENBQUMsSUFBSSxPQUFhLENBQUMsRUFBRSxDQUFDLENBQUEsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUVyRCxxQ0FBcUM7QUFDckMsSUFBSSxLQUFLLEdBQTJCLENBQUMsVUFBUyxDQUFDLElBQUksT0FBTyxDQUFDLENBQUEsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUMvRCxJQUFJLEtBQUssR0FBVSxDQUFDO0lBQ2hCLENBQUMsRUFBRSxDQUFDO0NBQ1AsQ0FBQyxDQUFDO0FBQ0gsSUFBSSxLQUFLLEdBQWMsRUFBRSxDQUFDO0FBQzFCLElBQUksS0FBSyxHQUFnQixjQUFhLE9BQWEsQ0FBQyxFQUFFLENBQUMsQ0FBQSxDQUFDLENBQUMsQ0FBQztBQUMxRCxJQUFJLEtBQUssR0FBeUIsVUFBUyxDQUFDLElBQUksT0FBYSxDQUFDLEVBQUUsQ0FBQyxDQUFBLENBQUMsQ0FBQyxDQUFDO0FBQ3BFLElBQUksS0FBSyxHQUFvQyxVQUFTLENBQUMsRUFBRSxDQUFDLElBQUksT0FBYSxDQUFDLEVBQUUsQ0FBQyxDQUFBLENBQUMsQ0FBQyxDQUFDO0FBQ2xGLElBQUksS0FBSyxHQUdOLFVBQVMsQ0FBUSxJQUFJLE9BQU8sQ0FBQyxDQUFBLENBQUMsQ0FBQyxDQUFDO0FBRW5DLElBQUksS0FBSyxHQUFzQyxVQUFTLENBQUMsSUFBSSxPQUFPLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUN6RSxJQUFJLEtBQUssR0FBZ0IsQ0FBQyxFQUFFLEVBQUMsRUFBRSxDQUFDLENBQUM7QUFDakMsSUFBSSxNQUFNLEdBQVksQ0FBTyxDQUFDLEVBQUUsQ0FBQyxFQUFPLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQztBQUM5QyxJQUFJLE1BQU0sR0FBeUMsQ0FBQyxVQUFTLENBQUMsRUFBRSxDQUFDLElBQUksT0FBTyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNsRixJQUFJLE1BQU0sR0FBVTtJQUNoQixHQUFHLEVBQVEsQ0FBQyxFQUFFLENBQUM7Q0FDbEIsQ0FBQTtBQUNELElBQUksTUFBTSxHQUFVLENBQUM7SUFDakIsQ0FBQyxFQUFFLFVBQVMsQ0FBQyxFQUFFLENBQUMsSUFBSSxPQUFPLENBQUMsQ0FBQyxDQUFDLENBQUM7Q0FDbEMsQ0FBQyxDQUFBO0FBQ0YsSUFBSSxNQUFNLEdBQVUsQ0FBQztJQUNqQixDQUFDLEVBQUUsRUFBRTtDQUNSLENBQUMsQ0FBQTtBQU9GLFNBQVMsR0FBRyxDQUFDLENBQUMsRUFBQyxDQUFDLElBQUksT0FBTyxDQUFDLEdBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUVqQyxJQUFJLEdBQUcsR0FBRyxHQUFHLENBQUMsQ0FBQyxFQUFDLENBQUMsQ0FBQyxDQUFDO0FBY25CLEtBQUssQ0FBQyxNQUFNLEdBQUcsSUFBSSxLQUFLLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDO0FBRS9CLEtBQUssQ0FBQyxTQUFTLENBQUMsR0FBRyxHQUFHLFVBQVMsRUFBRSxFQUFFLEVBQUU7SUFDakMsT0FBTyxJQUFJLEtBQUssQ0FBQyxJQUFJLENBQUMsQ0FBQyxHQUFHLEVBQUUsRUFBRSxJQUFJLENBQUMsQ0FBQyxHQUFHLEVBQUUsQ0FBQyxDQUFDO0FBQy9DLENBQUMsQ0FBQztBQUVGLEtBQUssQ0FBQyxTQUFTLEdBQUc7SUFDZCxDQUFDLEVBQUUsQ0FBQztJQUNKLENBQUMsRUFBRSxDQUFDO0lBQ0osR0FBRyxFQUFFLFVBQVMsRUFBRSxFQUFFLEVBQUU7UUFDaEIsT0FBTyxJQUFJLEtBQUssQ0FBQyxJQUFJLENBQUMsQ0FBQyxHQUFHLEVBQUUsRUFBRSxJQUFJLENBQUMsQ0FBQyxHQUFHLEVBQUUsQ0FBQyxDQUFDO0lBQy9DLENBQUM7Q0FDSixDQUFDO0FBSUYsSUFBSSxDQUFDLEdBQU0sRUFBRyxDQUFDIn0=,Ly8gREVGQVVMVCBJTlRFUkZBQ0VTCmludGVyZmFjZSBJRm9vIHsKICAgIG46IG51bWJlcjsKICAgIHM6IHN0cmluZzsKICAgIGYoaTogbnVtYmVyLCBzOiBzdHJpbmcpOiBzdHJpbmc7CiAgICBhOiBudW1iZXJbXTsKfQoKaW50ZXJmYWNlIElCYXIgewogICAgZm9vOiBJRm9vOwp9CgovLyBDT05URVhUOiBDbGFzcyBwcm9wZXJ0eSBkZWNsYXJhdGlvbgpjbGFzcyBDMVQ1IHsKICAgIGZvbzogKGk6IG51bWJlciwgczogc3RyaW5nKSA9PiBudW1iZXIgPSBmdW5jdGlvbihpKSB7CiAgICAgICAgcmV0dXJuIGk7CiAgICB9Cn0KCi8vIENPTlRFWFQ6IE5hbWVzcGFjZSBwcm9wZXJ0eSBkZWNsYXJhdGlvbgpuYW1lc3BhY2UgQzJUNSB7CiAgICBleHBvcnQgdmFyIGZvbzogKGk6IG51bWJlciwgczogc3RyaW5nKSA9PiBudW1iZXIgPSBmdW5jdGlvbihpKSB7CiAgICAgICAgcmV0dXJuIGk7CiAgICB9Cn0KCi8vIENPTlRFWFQ6IFZhcmlhYmxlIGRlY2xhcmF0aW9uCnZhciBjM3QxOiAoczogc3RyaW5nKSA9PiBzdHJpbmcgPSAoZnVuY3Rpb24ocykgeyByZXR1cm4gcyB9KTsKdmFyIGMzdDIgPSA8SUZvbz4oewogICAgbjogMQp9KQp2YXIgYzN0MzogbnVtYmVyW10gPSBbXTsKdmFyIGMzdDQ6ICgpID0+IElGb28gPSBmdW5jdGlvbigpIHsgcmV0dXJuIDxJRm9vPih7fSkgfTsKdmFyIGMzdDU6IChuOiBudW1iZXIpID0+IElGb28gPSBmdW5jdGlvbihuKSB7IHJldHVybiA8SUZvbz4oe30pIH07CnZhciBjM3Q2OiAobjogbnVtYmVyLCBzOiBzdHJpbmcpID0+IElGb28gPSBmdW5jdGlvbihuLCBzKSB7IHJldHVybiA8SUZvbz4oe30pIH07CnZhciBjM3Q3OiB7CiAgICAobjogbnVtYmVyKTogbnVtYmVyOyAgICAKICAgIChzMTogc3RyaW5nKTogbnVtYmVyOwp9ID0gZnVuY3Rpb24obikgeyByZXR1cm4gbjsgfTsKCnZhciBjM3Q4OiAobjogbnVtYmVyLCBzOiBzdHJpbmcpID0+IG51bWJlciA9IGZ1bmN0aW9uKG4pIHsgcmV0dXJuIG47IH07CnZhciBjM3Q5OiBudW1iZXJbXVtdID0gW1tdLFtdXTsKdmFyIGMzdDEwOiBJRm9vW10gPSBbPElGb28+KHt9KSw8SUZvbz4oe30pXTsKdmFyIGMzdDExOiB7KG46IG51bWJlciwgczogc3RyaW5nKTogc3RyaW5nO31bXSA9IFtmdW5jdGlvbihuLCBzKSB7IHJldHVybiBzOyB9XTsKdmFyIGMzdDEyOiBJQmFyID0gewogICAgZm9vOiA8SUZvbz4oe30pCn0KdmFyIGMzdDEzID0gPElGb28+KHsKICAgIGY6IGZ1bmN0aW9uKGksIHMpIHsgcmV0dXJuIHM7IH0KfSkKdmFyIGMzdDE0ID0gPElGb28+KHsKICAgIGE6IFtdCn0pCgovLyBDT05URVhUOiBDbGFzcyBwcm9wZXJ0eSBhc3NpZ25tZW50CmNsYXNzIEM0VDUgewogICAgZm9vOiAoaTogbnVtYmVyLCBzOiBzdHJpbmcpID0+IHN0cmluZzsKICAgIGNvbnN0cnVjdG9yKCkgewogICAgICAgIHRoaXMuZm9vID0gZnVuY3Rpb24oaSwgcykgewogICAgICAgICAgICByZXR1cm4gczsKICAgICAgICB9CiAgICB9Cn0KCi8vIENPTlRFWFQ6IE5hbWVzcGFjZSBwcm9wZXJ0eSBhc3NpZ25tZW50Cm5hbWVzcGFjZSBDNVQ1IHsKICAgIGV4cG9ydCB2YXIgZm9vOiAoaTogbnVtYmVyLCBzOiBzdHJpbmcpID0+IHN0cmluZzsKICAgIGZvbyA9IGZ1bmN0aW9uKGksIHMpIHsKICAgICAgICByZXR1cm4gczsKICAgIH0KfQoKLy8gQ09OVEVYVDogVmFyaWFibGUgYXNzaWdubWVudAp2YXIgYzZ0NTogKG46IG51bWJlcikgPT4gSUZvbzsKYzZ0NSA9IDwobjogbnVtYmVyKSA9PiBJRm9vPmZ1bmN0aW9uKG4pIHsgcmV0dXJuIDxJRm9vPih7fSkgfTsKCi8vIENPTlRFWFQ6IEFycmF5IGluZGV4IGFzc2lnbm1lbnQKdmFyIGM3dDI6IElGb29bXSA9IFtdOwpjN3QyWzBdID0gPElGb28+KHtuOiAxfSk7CgovLyBDT05URVhUOiBPYmplY3QgcHJvcGVydHkgYXNzaWdubWVudAppbnRlcmZhY2UgSVBsYWNlSG9sZGVyIHsKICAgIHQxOiAoczogc3RyaW5nKSA9PiBzdHJpbmc7CiAgICB0MjogSUZvbzsKICAgIHQzOiBudW1iZXJbXTsKICAgIHQ0OiAoKSA9PiBJRm9vOwogICAgdDU6IChuOiBudW1iZXIpID0+IElGb287CiAgICB0NjogKG46IG51bWJlciwgczogc3RyaW5nKSA9PiBJRm9vOwogICAgdDc6IHsKICAgICAgICAgICAgKG46IG51bWJlciwgczogc3RyaW5nKTogbnVtYmVyOyAgICAKICAgICAgICAgICAgLy8oczE6IHN0cmluZywgczI6IHN0cmluZyk6IG51bWJlcjsKICAgICAgICB9OwogICAgdDg6IChuOiBudW1iZXIsIHM6IHN0cmluZykgPT4gbnVtYmVyOwogICAgdDk6IG51bWJlcltdW107CiAgICB0MTA6IElGb29bXTsKICAgIHQxMTogeyhuOiBudW1iZXIsIHM6IHN0cmluZyk6IHN0cmluZzt9W107CiAgICB0MTI6IElCYXI7CiAgICB0MTM6IElGb287CiAgICB0MTQ6IElGb287CiAgICB9Cgp2YXIgb2JqYzg6IHsKICAgIHQxOiAoczogc3RyaW5nKSA9PiBzdHJpbmc7CiAgICB0MjogSUZvbzsKICAgIHQzOiBudW1iZXJbXTsKICAgIHQ0OiAoKSA9PiBJRm9vOwogICAgdDU6IChuOiBudW1iZXIpID0+IElGb287CiAgICB0NjogKG46IG51bWJlciwgczogc3RyaW5nKSA9PiBJRm9vOwogICAgdDc6IHsKICAgICAgICAgICAgKG46IG51bWJlciwgczogc3RyaW5nKTogbnVtYmVyOyAgICAKICAgICAgICAgICAgLy8oczE6IHN0cmluZywgczI6IHN0cmluZyk6IG51bWJlcjsKICAgICAgICB9OwogICAgdDg6IChuOiBudW1iZXIsIHM6IHN0cmluZykgPT4gbnVtYmVyOwogICAgdDk6IG51bWJlcltdW107CiAgICB0MTA6IElGb29bXTsKICAgIHQxMTogeyhuOiBudW1iZXIsIHM6IHN0cmluZyk6IHN0cmluZzt9W107CiAgICB0MTI6IElCYXI7CiAgICB0MTM6IElGb287CiAgICB0MTQ6IElGb287Cn0gPSA8SVBsYWNlSG9sZGVyPih7fSk7CgpvYmpjOC50MSA9IChmdW5jdGlvbihzKSB7IHJldHVybiBzIH0pOwpvYmpjOC50MiA9IDxJRm9vPih7CiAgICBuOiAxCn0pOwpvYmpjOC50MyA9IFtdOwpvYmpjOC50NCA9IGZ1bmN0aW9uKCkgeyByZXR1cm4gPElGb28+KHt9KSB9OwpvYmpjOC50NSA9IGZ1bmN0aW9uKG4pIHsgcmV0dXJuIDxJRm9vPih7fSkgfTsKb2JqYzgudDYgPSBmdW5jdGlvbihuLCBzKSB7IHJldHVybiA8SUZvbz4oe30pIH07Cm9iamM4LnQ3ID0gZnVuY3Rpb24objogbnVtYmVyKSB7IHJldHVybiBuIH07CgpvYmpjOC50OCA9IGZ1bmN0aW9uKG4pIHsgcmV0dXJuIG47IH07Cm9iamM4LnQ5ID0gW1tdLFtdXTsKb2JqYzgudDEwID0gWzxJRm9vPih7fSksPElGb28+KHt9KV07Cm9iamM4LnQxMSA9IFtmdW5jdGlvbihuLCBzKSB7IHJldHVybiBzOyB9XTsKb2JqYzgudDEyID0gewogICAgZm9vOiA8SUZvbz4oe30pCn0Kb2JqYzgudDEzID0gPElGb28+KHsKICAgIGY6IGZ1bmN0aW9uKGksIHMpIHsgcmV0dXJuIHM7IH0KfSkKb2JqYzgudDE0ID0gPElGb28+KHsKICAgIGE6IFtdCn0pCi8vIENPTlRFWFQ6IEZ1bmN0aW9uIGNhbGwKZnVuY3Rpb24gYzl0NShmOiAobjogbnVtYmVyKSA9PiBJRm9vKSB7fTsKYzl0NShmdW5jdGlvbihuKSB7CiAgICByZXR1cm4gPElGb28+KHt9KTsKfSk7CgovLyBDT05URVhUOiBSZXR1cm4gc3RhdGVtZW50CnZhciBjMTB0NTogKCkgPT4gKG46IG51bWJlcikgPT4gSUZvbyA9IGZ1bmN0aW9uKCkgeyByZXR1cm4gZnVuY3Rpb24obikgeyByZXR1cm4gPElGb28+KHt9KSB9IH07CgovLyBDT05URVhUOiBOZXdpbmcgYSBjbGFzcwpjbGFzcyBDMTF0NSB7IGNvbnN0cnVjdG9yKGY6IChuOiBudW1iZXIpID0+IElGb28pIHsgfSB9Owp2YXIgaSA9IG5ldyBDMTF0NShmdW5jdGlvbihuKSB7IHJldHVybiA8SUZvbz4oe30pIH0pOwoKLy8gQ09OVEVYVDogVHlwZSBhbm5vdGF0ZWQgZXhwcmVzc2lvbgp2YXIgYzEydDEgPSA8KHM6IHN0cmluZykgPT4gc3RyaW5nPiAoZnVuY3Rpb24ocykgeyByZXR1cm4gcyB9KTsKdmFyIGMxMnQyID0gPElGb28+ICh7CiAgICBuOiAxCn0pOwp2YXIgYzEydDMgPSA8bnVtYmVyW10+IFtdOwp2YXIgYzEydDQgPSA8KCkgPT4gSUZvbz4gZnVuY3Rpb24oKSB7IHJldHVybiA8SUZvbz4oe30pIH07CnZhciBjMTJ0NSA9IDwobjogbnVtYmVyKSA9PiBJRm9vPiBmdW5jdGlvbihuKSB7IHJldHVybiA8SUZvbz4oe30pIH07CnZhciBjMTJ0NiA9IDwobjogbnVtYmVyLCBzOiBzdHJpbmcpID0+IElGb28+IGZ1bmN0aW9uKG4sIHMpIHsgcmV0dXJuIDxJRm9vPih7fSkgfTsKdmFyIGMxMnQ3ID0gPHsKICAgIChuOiBudW1iZXIsIHM6IHN0cmluZyk6IG51bWJlcjsgICAgCiAgICAvLyhzMTogc3RyaW5nLCBzMjogc3RyaW5nKTogbnVtYmVyOwp9PiBmdW5jdGlvbihuOm51bWJlcikgeyByZXR1cm4gbiB9OwoKdmFyIGMxMnQ4ID0gPChuOiBudW1iZXIsIHM6IHN0cmluZykgPT4gbnVtYmVyPiBmdW5jdGlvbihuKSB7IHJldHVybiBuOyB9Owp2YXIgYzEydDkgPSA8bnVtYmVyW11bXT4gW1tdLFtdXTsKdmFyIGMxMnQxMCA9IDxJRm9vW10+IFs8SUZvbz4oe30pLDxJRm9vPih7fSldOwp2YXIgYzEydDExID0gPHsobjogbnVtYmVyLCBzOiBzdHJpbmcpOiBzdHJpbmc7fVtdPiBbZnVuY3Rpb24obiwgcykgeyByZXR1cm4gczsgfV07CnZhciBjMTJ0MTIgPSA8SUJhcj4gewogICAgZm9vOiA8SUZvbz4oe30pCn0KdmFyIGMxMnQxMyA9IDxJRm9vPiAoewogICAgZjogZnVuY3Rpb24oaSwgcykgeyByZXR1cm4gczsgfQp9KQp2YXIgYzEydDE0ID0gPElGb28+ICh7CiAgICBhOiBbXQp9KQoKLy8gQ09OVEVYVDogQ29udGV4dHVhbCB0eXBpbmcgZGVjbGFyYXRpb25zCgovLyBjb250ZXh0dWFsbHkgdHlwaW5nIGZ1bmN0aW9uIGRlY2xhcmF0aW9ucwpkZWNsYXJlIGZ1bmN0aW9uIEVGMShhOm51bWJlciwgYjpudW1iZXIpOm51bWJlcjsKCmZ1bmN0aW9uIEVGMShhLGIpIHsgcmV0dXJuIGErYjsgfQoKdmFyIGVmdiA9IEVGMSgxLDIpOwoKCi8vIGNvbnRleHR1YWxseSB0eXBpbmcgZnJvbSBhbWJpZW50IGNsYXNzIGRlY2xhcmF0aW9ucwpkZWNsYXJlIGNsYXNzIFBvaW50CnsKICAgICAgY29uc3RydWN0b3IoeDogbnVtYmVyLCB5OiBudW1iZXIpOwogICAgICB4OiBudW1iZXI7CiAgICAgIHk6IG51bWJlcjsKICAgICAgYWRkKGR4OiBudW1iZXIsIGR5OiBudW1iZXIpOiBQb2ludDsKICAgICAgc3RhdGljIG9yaWdpbjogUG9pbnQ7Cgp9CgpQb2ludC5vcmlnaW4gPSBuZXcgUG9pbnQoMCwgMCk7CgpQb2ludC5wcm90b3R5cGUuYWRkID0gZnVuY3Rpb24oZHgsIGR5KSB7CiAgICByZXR1cm4gbmV3IFBvaW50KHRoaXMueCArIGR4LCB0aGlzLnkgKyBkeSk7Cn07CgpQb2ludC5wcm90b3R5cGUgPSB7CiAgICB4OiAwLAogICAgeTogMCwKICAgIGFkZDogZnVuY3Rpb24oZHgsIGR5KSB7CiAgICAgICAgcmV0dXJuIG5ldyBQb2ludCh0aGlzLnggKyBkeCwgdGhpcy55ICsgZHkpOwogICAgfQp9OwoKaW50ZXJmYWNlIEEgeyB4OiBzdHJpbmc7IH0KaW50ZXJmYWNlIEIgZXh0ZW5kcyBBIHsgfQp2YXIgeDogQiA9IHsgfTsK diff --git a/tests/baselines/reference/contextualTyping.sourcemap.txt b/tests/baselines/reference/contextualTyping.sourcemap.txt index 52f0ada5c8a32..6553f1e71cb35 100644 --- a/tests/baselines/reference/contextualTyping.sourcemap.txt +++ b/tests/baselines/reference/contextualTyping.sourcemap.txt @@ -8,6 +8,7 @@ sources: contextualTyping.ts emittedFile:contextualTyping.js sourceFile:contextualTyping.ts ------------------------------------------------------------------- +>>>"use strict"; >>>// CONTEXT: Class property declaration 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -25,8 +26,8 @@ sourceFile:contextualTyping.ts > > 2 >// CONTEXT: Class property declaration -1 >Emitted(1, 1) Source(13, 1) + SourceIndex(0) -2 >Emitted(1, 39) Source(13, 39) + SourceIndex(0) +1 >Emitted(2, 1) Source(13, 1) + SourceIndex(0) +2 >Emitted(2, 39) Source(13, 39) + SourceIndex(0) --- >>>class C1T5 { 1 > @@ -37,15 +38,15 @@ sourceFile:contextualTyping.ts > 2 >class 3 > C1T5 -1 >Emitted(2, 1) Source(14, 1) + SourceIndex(0) -2 >Emitted(2, 7) Source(14, 7) + SourceIndex(0) -3 >Emitted(2, 11) Source(14, 11) + SourceIndex(0) +1 >Emitted(3, 1) Source(14, 1) + SourceIndex(0) +2 >Emitted(3, 7) Source(14, 7) + SourceIndex(0) +3 >Emitted(3, 11) Source(14, 11) + SourceIndex(0) --- >>> constructor() { 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> -1->Emitted(3, 5) Source(14, 1) + SourceIndex(0) +1->Emitted(4, 5) Source(14, 1) + SourceIndex(0) --- >>> this.foo = function (i) { 1->^^^^^^^^ @@ -59,11 +60,11 @@ sourceFile:contextualTyping.ts 3 > : (i: number, s: string) => number = 4 > function( 5 > i -1->Emitted(4, 9) Source(15, 5) + SourceIndex(0) -2 >Emitted(4, 17) Source(15, 8) + SourceIndex(0) -3 >Emitted(4, 20) Source(15, 45) + SourceIndex(0) -4 >Emitted(4, 30) Source(15, 54) + SourceIndex(0) -5 >Emitted(4, 31) Source(15, 55) + SourceIndex(0) +1->Emitted(5, 9) Source(15, 5) + SourceIndex(0) +2 >Emitted(5, 17) Source(15, 8) + SourceIndex(0) +3 >Emitted(5, 20) Source(15, 45) + SourceIndex(0) +4 >Emitted(5, 30) Source(15, 54) + SourceIndex(0) +5 >Emitted(5, 31) Source(15, 55) + SourceIndex(0) --- >>> return i; 1 >^^^^^^^^^^^^ @@ -75,10 +76,10 @@ sourceFile:contextualTyping.ts 2 > return 3 > i 4 > ; -1 >Emitted(5, 13) Source(16, 9) + SourceIndex(0) -2 >Emitted(5, 20) Source(16, 16) + SourceIndex(0) -3 >Emitted(5, 21) Source(16, 17) + SourceIndex(0) -4 >Emitted(5, 22) Source(16, 18) + SourceIndex(0) +1 >Emitted(6, 13) Source(16, 9) + SourceIndex(0) +2 >Emitted(6, 20) Source(16, 16) + SourceIndex(0) +3 >Emitted(6, 21) Source(16, 17) + SourceIndex(0) +4 >Emitted(6, 22) Source(16, 18) + SourceIndex(0) --- >>> }; 1 >^^^^^^^^ @@ -88,9 +89,9 @@ sourceFile:contextualTyping.ts > 2 > } 3 > -1 >Emitted(6, 9) Source(17, 5) + SourceIndex(0) -2 >Emitted(6, 10) Source(17, 6) + SourceIndex(0) -3 >Emitted(6, 11) Source(17, 6) + SourceIndex(0) +1 >Emitted(7, 9) Source(17, 5) + SourceIndex(0) +2 >Emitted(7, 10) Source(17, 6) + SourceIndex(0) +3 >Emitted(7, 11) Source(17, 6) + SourceIndex(0) --- >>> } 1 >^^^^ @@ -98,14 +99,14 @@ sourceFile:contextualTyping.ts 1 > > 2 > } -1 >Emitted(7, 5) Source(18, 1) + SourceIndex(0) -2 >Emitted(7, 6) Source(18, 2) + SourceIndex(0) +1 >Emitted(8, 5) Source(18, 1) + SourceIndex(0) +2 >Emitted(8, 6) Source(18, 2) + SourceIndex(0) --- >>>} 1 >^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > -1 >Emitted(8, 2) Source(18, 2) + SourceIndex(0) +1 >Emitted(9, 2) Source(18, 2) + SourceIndex(0) --- >>>// CONTEXT: Namespace property declaration 1-> @@ -114,8 +115,8 @@ sourceFile:contextualTyping.ts > > 2 >// CONTEXT: Namespace property declaration -1->Emitted(9, 1) Source(20, 1) + SourceIndex(0) -2 >Emitted(9, 43) Source(20, 43) + SourceIndex(0) +1->Emitted(10, 1) Source(20, 1) + SourceIndex(0) +2 >Emitted(10, 43) Source(20, 43) + SourceIndex(0) --- >>>var C2T5; 1 > @@ -132,10 +133,10 @@ sourceFile:contextualTyping.ts > return i; > } > } -1 >Emitted(10, 1) Source(21, 1) + SourceIndex(0) -2 >Emitted(10, 5) Source(21, 11) + SourceIndex(0) -3 >Emitted(10, 9) Source(21, 15) + SourceIndex(0) -4 >Emitted(10, 10) Source(25, 2) + SourceIndex(0) +1 >Emitted(11, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(11, 5) Source(21, 11) + SourceIndex(0) +3 >Emitted(11, 9) Source(21, 15) + SourceIndex(0) +4 >Emitted(11, 10) Source(25, 2) + SourceIndex(0) --- >>>(function (C2T5) { 1-> @@ -145,9 +146,9 @@ sourceFile:contextualTyping.ts 1-> 2 >namespace 3 > C2T5 -1->Emitted(11, 1) Source(21, 1) + SourceIndex(0) -2 >Emitted(11, 12) Source(21, 11) + SourceIndex(0) -3 >Emitted(11, 16) Source(21, 15) + SourceIndex(0) +1->Emitted(12, 1) Source(21, 1) + SourceIndex(0) +2 >Emitted(12, 12) Source(21, 11) + SourceIndex(0) +3 >Emitted(12, 16) Source(21, 15) + SourceIndex(0) --- >>> C2T5.foo = function (i) { 1->^^^^ @@ -161,11 +162,11 @@ sourceFile:contextualTyping.ts 3 > : (i: number, s: string) => number = 4 > function( 5 > i -1->Emitted(12, 5) Source(22, 16) + SourceIndex(0) -2 >Emitted(12, 13) Source(22, 19) + SourceIndex(0) -3 >Emitted(12, 16) Source(22, 56) + SourceIndex(0) -4 >Emitted(12, 26) Source(22, 65) + SourceIndex(0) -5 >Emitted(12, 27) Source(22, 66) + SourceIndex(0) +1->Emitted(13, 5) Source(22, 16) + SourceIndex(0) +2 >Emitted(13, 13) Source(22, 19) + SourceIndex(0) +3 >Emitted(13, 16) Source(22, 56) + SourceIndex(0) +4 >Emitted(13, 26) Source(22, 65) + SourceIndex(0) +5 >Emitted(13, 27) Source(22, 66) + SourceIndex(0) --- >>> return i; 1 >^^^^^^^^ @@ -177,10 +178,10 @@ sourceFile:contextualTyping.ts 2 > return 3 > i 4 > ; -1 >Emitted(13, 9) Source(23, 9) + SourceIndex(0) -2 >Emitted(13, 16) Source(23, 16) + SourceIndex(0) -3 >Emitted(13, 17) Source(23, 17) + SourceIndex(0) -4 >Emitted(13, 18) Source(23, 18) + SourceIndex(0) +1 >Emitted(14, 9) Source(23, 9) + SourceIndex(0) +2 >Emitted(14, 16) Source(23, 16) + SourceIndex(0) +3 >Emitted(14, 17) Source(23, 17) + SourceIndex(0) +4 >Emitted(14, 18) Source(23, 18) + SourceIndex(0) --- >>> }; 1 >^^^^ @@ -191,9 +192,9 @@ sourceFile:contextualTyping.ts > 2 > } 3 > -1 >Emitted(14, 5) Source(24, 5) + SourceIndex(0) -2 >Emitted(14, 6) Source(24, 6) + SourceIndex(0) -3 >Emitted(14, 7) Source(24, 6) + SourceIndex(0) +1 >Emitted(15, 5) Source(24, 5) + SourceIndex(0) +2 >Emitted(15, 6) Source(24, 6) + SourceIndex(0) +3 >Emitted(15, 7) Source(24, 6) + SourceIndex(0) --- >>>})(C2T5 || (C2T5 = {})); 1-> @@ -216,13 +217,13 @@ sourceFile:contextualTyping.ts > return i; > } > } -1->Emitted(15, 1) Source(25, 1) + SourceIndex(0) -2 >Emitted(15, 2) Source(25, 2) + SourceIndex(0) -3 >Emitted(15, 4) Source(21, 11) + SourceIndex(0) -4 >Emitted(15, 8) Source(21, 15) + SourceIndex(0) -5 >Emitted(15, 13) Source(21, 11) + SourceIndex(0) -6 >Emitted(15, 17) Source(21, 15) + SourceIndex(0) -7 >Emitted(15, 25) Source(25, 2) + SourceIndex(0) +1->Emitted(16, 1) Source(25, 1) + SourceIndex(0) +2 >Emitted(16, 2) Source(25, 2) + SourceIndex(0) +3 >Emitted(16, 4) Source(21, 11) + SourceIndex(0) +4 >Emitted(16, 8) Source(21, 15) + SourceIndex(0) +5 >Emitted(16, 13) Source(21, 11) + SourceIndex(0) +6 >Emitted(16, 17) Source(21, 15) + SourceIndex(0) +7 >Emitted(16, 25) Source(25, 2) + SourceIndex(0) --- >>>// CONTEXT: Variable declaration 1-> @@ -232,8 +233,8 @@ sourceFile:contextualTyping.ts > > 2 >// CONTEXT: Variable declaration -1->Emitted(16, 1) Source(27, 1) + SourceIndex(0) -2 >Emitted(16, 33) Source(27, 33) + SourceIndex(0) +1->Emitted(17, 1) Source(27, 1) + SourceIndex(0) +2 >Emitted(17, 33) Source(27, 33) + SourceIndex(0) --- >>>var c3t1 = (function (s) { return s; }); 1-> @@ -267,21 +268,21 @@ sourceFile:contextualTyping.ts 13> } 14> ) 15> ; -1->Emitted(17, 1) Source(28, 1) + SourceIndex(0) -2 >Emitted(17, 5) Source(28, 5) + SourceIndex(0) -3 >Emitted(17, 9) Source(28, 9) + SourceIndex(0) -4 >Emitted(17, 12) Source(28, 35) + SourceIndex(0) -5 >Emitted(17, 13) Source(28, 36) + SourceIndex(0) -6 >Emitted(17, 23) Source(28, 45) + SourceIndex(0) -7 >Emitted(17, 24) Source(28, 46) + SourceIndex(0) -8 >Emitted(17, 28) Source(28, 50) + SourceIndex(0) -9 >Emitted(17, 35) Source(28, 57) + SourceIndex(0) -10>Emitted(17, 36) Source(28, 58) + SourceIndex(0) -11>Emitted(17, 37) Source(28, 58) + SourceIndex(0) -12>Emitted(17, 38) Source(28, 59) + SourceIndex(0) -13>Emitted(17, 39) Source(28, 60) + SourceIndex(0) -14>Emitted(17, 40) Source(28, 61) + SourceIndex(0) -15>Emitted(17, 41) Source(28, 62) + SourceIndex(0) +1->Emitted(18, 1) Source(28, 1) + SourceIndex(0) +2 >Emitted(18, 5) Source(28, 5) + SourceIndex(0) +3 >Emitted(18, 9) Source(28, 9) + SourceIndex(0) +4 >Emitted(18, 12) Source(28, 35) + SourceIndex(0) +5 >Emitted(18, 13) Source(28, 36) + SourceIndex(0) +6 >Emitted(18, 23) Source(28, 45) + SourceIndex(0) +7 >Emitted(18, 24) Source(28, 46) + SourceIndex(0) +8 >Emitted(18, 28) Source(28, 50) + SourceIndex(0) +9 >Emitted(18, 35) Source(28, 57) + SourceIndex(0) +10>Emitted(18, 36) Source(28, 58) + SourceIndex(0) +11>Emitted(18, 37) Source(28, 58) + SourceIndex(0) +12>Emitted(18, 38) Source(28, 59) + SourceIndex(0) +13>Emitted(18, 39) Source(28, 60) + SourceIndex(0) +14>Emitted(18, 40) Source(28, 61) + SourceIndex(0) +15>Emitted(18, 41) Source(28, 62) + SourceIndex(0) --- >>>var c3t2 = ({ 1 > @@ -295,11 +296,11 @@ sourceFile:contextualTyping.ts 3 > c3t2 4 > = 5 > ( -1 >Emitted(18, 1) Source(29, 1) + SourceIndex(0) -2 >Emitted(18, 5) Source(29, 5) + SourceIndex(0) -3 >Emitted(18, 9) Source(29, 9) + SourceIndex(0) -4 >Emitted(18, 12) Source(29, 18) + SourceIndex(0) -5 >Emitted(18, 13) Source(29, 19) + SourceIndex(0) +1 >Emitted(19, 1) Source(29, 1) + SourceIndex(0) +2 >Emitted(19, 5) Source(29, 5) + SourceIndex(0) +3 >Emitted(19, 9) Source(29, 9) + SourceIndex(0) +4 >Emitted(19, 12) Source(29, 18) + SourceIndex(0) +5 >Emitted(19, 13) Source(29, 19) + SourceIndex(0) --- >>> n: 1 1 >^^^^ @@ -311,10 +312,10 @@ sourceFile:contextualTyping.ts 2 > n 3 > : 4 > 1 -1 >Emitted(19, 5) Source(30, 5) + SourceIndex(0) -2 >Emitted(19, 6) Source(30, 6) + SourceIndex(0) -3 >Emitted(19, 8) Source(30, 8) + SourceIndex(0) -4 >Emitted(19, 9) Source(30, 9) + SourceIndex(0) +1 >Emitted(20, 5) Source(30, 5) + SourceIndex(0) +2 >Emitted(20, 6) Source(30, 6) + SourceIndex(0) +3 >Emitted(20, 8) Source(30, 8) + SourceIndex(0) +4 >Emitted(20, 9) Source(30, 9) + SourceIndex(0) --- >>>}); 1 >^ @@ -325,9 +326,9 @@ sourceFile:contextualTyping.ts >} 2 > ) 3 > -1 >Emitted(20, 2) Source(31, 2) + SourceIndex(0) -2 >Emitted(20, 3) Source(31, 3) + SourceIndex(0) -3 >Emitted(20, 4) Source(31, 3) + SourceIndex(0) +1 >Emitted(21, 2) Source(31, 2) + SourceIndex(0) +2 >Emitted(21, 3) Source(31, 3) + SourceIndex(0) +3 >Emitted(21, 4) Source(31, 3) + SourceIndex(0) --- >>>var c3t3 = []; 1-> @@ -344,12 +345,12 @@ sourceFile:contextualTyping.ts 4 > : number[] = 5 > [] 6 > ; -1->Emitted(21, 1) Source(32, 1) + SourceIndex(0) -2 >Emitted(21, 5) Source(32, 5) + SourceIndex(0) -3 >Emitted(21, 9) Source(32, 9) + SourceIndex(0) -4 >Emitted(21, 12) Source(32, 22) + SourceIndex(0) -5 >Emitted(21, 14) Source(32, 24) + SourceIndex(0) -6 >Emitted(21, 15) Source(32, 25) + SourceIndex(0) +1->Emitted(22, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(22, 5) Source(32, 5) + SourceIndex(0) +3 >Emitted(22, 9) Source(32, 9) + SourceIndex(0) +4 >Emitted(22, 12) Source(32, 22) + SourceIndex(0) +5 >Emitted(22, 14) Source(32, 24) + SourceIndex(0) +6 >Emitted(22, 15) Source(32, 25) + SourceIndex(0) --- >>>var c3t4 = function () { return ({}); }; 1-> @@ -380,19 +381,19 @@ sourceFile:contextualTyping.ts 11> 12> } 13> ; -1->Emitted(22, 1) Source(33, 1) + SourceIndex(0) -2 >Emitted(22, 5) Source(33, 5) + SourceIndex(0) -3 >Emitted(22, 9) Source(33, 9) + SourceIndex(0) -4 >Emitted(22, 12) Source(33, 24) + SourceIndex(0) -5 >Emitted(22, 26) Source(33, 37) + SourceIndex(0) -6 >Emitted(22, 33) Source(33, 50) + SourceIndex(0) -7 >Emitted(22, 34) Source(33, 51) + SourceIndex(0) -8 >Emitted(22, 36) Source(33, 53) + SourceIndex(0) -9 >Emitted(22, 37) Source(33, 54) + SourceIndex(0) -10>Emitted(22, 38) Source(33, 54) + SourceIndex(0) -11>Emitted(22, 39) Source(33, 55) + SourceIndex(0) -12>Emitted(22, 40) Source(33, 56) + SourceIndex(0) -13>Emitted(22, 41) Source(33, 57) + SourceIndex(0) +1->Emitted(23, 1) Source(33, 1) + SourceIndex(0) +2 >Emitted(23, 5) Source(33, 5) + SourceIndex(0) +3 >Emitted(23, 9) Source(33, 9) + SourceIndex(0) +4 >Emitted(23, 12) Source(33, 24) + SourceIndex(0) +5 >Emitted(23, 26) Source(33, 37) + SourceIndex(0) +6 >Emitted(23, 33) Source(33, 50) + SourceIndex(0) +7 >Emitted(23, 34) Source(33, 51) + SourceIndex(0) +8 >Emitted(23, 36) Source(33, 53) + SourceIndex(0) +9 >Emitted(23, 37) Source(33, 54) + SourceIndex(0) +10>Emitted(23, 38) Source(33, 54) + SourceIndex(0) +11>Emitted(23, 39) Source(33, 55) + SourceIndex(0) +12>Emitted(23, 40) Source(33, 56) + SourceIndex(0) +13>Emitted(23, 41) Source(33, 57) + SourceIndex(0) --- >>>var c3t5 = function (n) { return ({}); }; 1-> @@ -427,21 +428,21 @@ sourceFile:contextualTyping.ts 13> 14> } 15> ; -1->Emitted(23, 1) Source(34, 1) + SourceIndex(0) -2 >Emitted(23, 5) Source(34, 5) + SourceIndex(0) -3 >Emitted(23, 9) Source(34, 9) + SourceIndex(0) -4 >Emitted(23, 12) Source(34, 33) + SourceIndex(0) -5 >Emitted(23, 22) Source(34, 42) + SourceIndex(0) -6 >Emitted(23, 23) Source(34, 43) + SourceIndex(0) -7 >Emitted(23, 27) Source(34, 47) + SourceIndex(0) -8 >Emitted(23, 34) Source(34, 60) + SourceIndex(0) -9 >Emitted(23, 35) Source(34, 61) + SourceIndex(0) -10>Emitted(23, 37) Source(34, 63) + SourceIndex(0) -11>Emitted(23, 38) Source(34, 64) + SourceIndex(0) -12>Emitted(23, 39) Source(34, 64) + SourceIndex(0) -13>Emitted(23, 40) Source(34, 65) + SourceIndex(0) -14>Emitted(23, 41) Source(34, 66) + SourceIndex(0) -15>Emitted(23, 42) Source(34, 67) + SourceIndex(0) +1->Emitted(24, 1) Source(34, 1) + SourceIndex(0) +2 >Emitted(24, 5) Source(34, 5) + SourceIndex(0) +3 >Emitted(24, 9) Source(34, 9) + SourceIndex(0) +4 >Emitted(24, 12) Source(34, 33) + SourceIndex(0) +5 >Emitted(24, 22) Source(34, 42) + SourceIndex(0) +6 >Emitted(24, 23) Source(34, 43) + SourceIndex(0) +7 >Emitted(24, 27) Source(34, 47) + SourceIndex(0) +8 >Emitted(24, 34) Source(34, 60) + SourceIndex(0) +9 >Emitted(24, 35) Source(34, 61) + SourceIndex(0) +10>Emitted(24, 37) Source(34, 63) + SourceIndex(0) +11>Emitted(24, 38) Source(34, 64) + SourceIndex(0) +12>Emitted(24, 39) Source(34, 64) + SourceIndex(0) +13>Emitted(24, 40) Source(34, 65) + SourceIndex(0) +14>Emitted(24, 41) Source(34, 66) + SourceIndex(0) +15>Emitted(24, 42) Source(34, 67) + SourceIndex(0) --- >>>var c3t6 = function (n, s) { return ({}); }; 1-> @@ -479,23 +480,23 @@ sourceFile:contextualTyping.ts 15> 16> } 17> ; -1->Emitted(24, 1) Source(35, 1) + SourceIndex(0) -2 >Emitted(24, 5) Source(35, 5) + SourceIndex(0) -3 >Emitted(24, 9) Source(35, 9) + SourceIndex(0) -4 >Emitted(24, 12) Source(35, 44) + SourceIndex(0) -5 >Emitted(24, 22) Source(35, 53) + SourceIndex(0) -6 >Emitted(24, 23) Source(35, 54) + SourceIndex(0) -7 >Emitted(24, 25) Source(35, 56) + SourceIndex(0) -8 >Emitted(24, 26) Source(35, 57) + SourceIndex(0) -9 >Emitted(24, 30) Source(35, 61) + SourceIndex(0) -10>Emitted(24, 37) Source(35, 74) + SourceIndex(0) -11>Emitted(24, 38) Source(35, 75) + SourceIndex(0) -12>Emitted(24, 40) Source(35, 77) + SourceIndex(0) -13>Emitted(24, 41) Source(35, 78) + SourceIndex(0) -14>Emitted(24, 42) Source(35, 78) + SourceIndex(0) -15>Emitted(24, 43) Source(35, 79) + SourceIndex(0) -16>Emitted(24, 44) Source(35, 80) + SourceIndex(0) -17>Emitted(24, 45) Source(35, 81) + SourceIndex(0) +1->Emitted(25, 1) Source(35, 1) + SourceIndex(0) +2 >Emitted(25, 5) Source(35, 5) + SourceIndex(0) +3 >Emitted(25, 9) Source(35, 9) + SourceIndex(0) +4 >Emitted(25, 12) Source(35, 44) + SourceIndex(0) +5 >Emitted(25, 22) Source(35, 53) + SourceIndex(0) +6 >Emitted(25, 23) Source(35, 54) + SourceIndex(0) +7 >Emitted(25, 25) Source(35, 56) + SourceIndex(0) +8 >Emitted(25, 26) Source(35, 57) + SourceIndex(0) +9 >Emitted(25, 30) Source(35, 61) + SourceIndex(0) +10>Emitted(25, 37) Source(35, 74) + SourceIndex(0) +11>Emitted(25, 38) Source(35, 75) + SourceIndex(0) +12>Emitted(25, 40) Source(35, 77) + SourceIndex(0) +13>Emitted(25, 41) Source(35, 78) + SourceIndex(0) +14>Emitted(25, 42) Source(35, 78) + SourceIndex(0) +15>Emitted(25, 43) Source(35, 79) + SourceIndex(0) +16>Emitted(25, 44) Source(35, 80) + SourceIndex(0) +17>Emitted(25, 45) Source(35, 81) + SourceIndex(0) --- >>>var c3t7 = function (n) { return n; }; 1 > @@ -529,19 +530,19 @@ sourceFile:contextualTyping.ts 11> 12> } 13> ; -1 >Emitted(25, 1) Source(36, 1) + SourceIndex(0) -2 >Emitted(25, 5) Source(36, 5) + SourceIndex(0) -3 >Emitted(25, 9) Source(36, 9) + SourceIndex(0) -4 >Emitted(25, 12) Source(39, 5) + SourceIndex(0) -5 >Emitted(25, 22) Source(39, 14) + SourceIndex(0) -6 >Emitted(25, 23) Source(39, 15) + SourceIndex(0) -7 >Emitted(25, 27) Source(39, 19) + SourceIndex(0) -8 >Emitted(25, 34) Source(39, 26) + SourceIndex(0) -9 >Emitted(25, 35) Source(39, 27) + SourceIndex(0) -10>Emitted(25, 36) Source(39, 28) + SourceIndex(0) -11>Emitted(25, 37) Source(39, 29) + SourceIndex(0) -12>Emitted(25, 38) Source(39, 30) + SourceIndex(0) -13>Emitted(25, 39) Source(39, 31) + SourceIndex(0) +1 >Emitted(26, 1) Source(36, 1) + SourceIndex(0) +2 >Emitted(26, 5) Source(36, 5) + SourceIndex(0) +3 >Emitted(26, 9) Source(36, 9) + SourceIndex(0) +4 >Emitted(26, 12) Source(39, 5) + SourceIndex(0) +5 >Emitted(26, 22) Source(39, 14) + SourceIndex(0) +6 >Emitted(26, 23) Source(39, 15) + SourceIndex(0) +7 >Emitted(26, 27) Source(39, 19) + SourceIndex(0) +8 >Emitted(26, 34) Source(39, 26) + SourceIndex(0) +9 >Emitted(26, 35) Source(39, 27) + SourceIndex(0) +10>Emitted(26, 36) Source(39, 28) + SourceIndex(0) +11>Emitted(26, 37) Source(39, 29) + SourceIndex(0) +12>Emitted(26, 38) Source(39, 30) + SourceIndex(0) +13>Emitted(26, 39) Source(39, 31) + SourceIndex(0) --- >>>var c3t8 = function (n) { return n; }; 1-> @@ -572,19 +573,19 @@ sourceFile:contextualTyping.ts 11> 12> } 13> ; -1->Emitted(26, 1) Source(41, 1) + SourceIndex(0) -2 >Emitted(26, 5) Source(41, 5) + SourceIndex(0) -3 >Emitted(26, 9) Source(41, 9) + SourceIndex(0) -4 >Emitted(26, 12) Source(41, 46) + SourceIndex(0) -5 >Emitted(26, 22) Source(41, 55) + SourceIndex(0) -6 >Emitted(26, 23) Source(41, 56) + SourceIndex(0) -7 >Emitted(26, 27) Source(41, 60) + SourceIndex(0) -8 >Emitted(26, 34) Source(41, 67) + SourceIndex(0) -9 >Emitted(26, 35) Source(41, 68) + SourceIndex(0) -10>Emitted(26, 36) Source(41, 69) + SourceIndex(0) -11>Emitted(26, 37) Source(41, 70) + SourceIndex(0) -12>Emitted(26, 38) Source(41, 71) + SourceIndex(0) -13>Emitted(26, 39) Source(41, 72) + SourceIndex(0) +1->Emitted(27, 1) Source(41, 1) + SourceIndex(0) +2 >Emitted(27, 5) Source(41, 5) + SourceIndex(0) +3 >Emitted(27, 9) Source(41, 9) + SourceIndex(0) +4 >Emitted(27, 12) Source(41, 46) + SourceIndex(0) +5 >Emitted(27, 22) Source(41, 55) + SourceIndex(0) +6 >Emitted(27, 23) Source(41, 56) + SourceIndex(0) +7 >Emitted(27, 27) Source(41, 60) + SourceIndex(0) +8 >Emitted(27, 34) Source(41, 67) + SourceIndex(0) +9 >Emitted(27, 35) Source(41, 68) + SourceIndex(0) +10>Emitted(27, 36) Source(41, 69) + SourceIndex(0) +11>Emitted(27, 37) Source(41, 70) + SourceIndex(0) +12>Emitted(27, 38) Source(41, 71) + SourceIndex(0) +13>Emitted(27, 39) Source(41, 72) + SourceIndex(0) --- >>>var c3t9 = [[], []]; 1 > @@ -609,16 +610,16 @@ sourceFile:contextualTyping.ts 8 > [] 9 > ] 10> ; -1 >Emitted(27, 1) Source(42, 1) + SourceIndex(0) -2 >Emitted(27, 5) Source(42, 5) + SourceIndex(0) -3 >Emitted(27, 9) Source(42, 9) + SourceIndex(0) -4 >Emitted(27, 12) Source(42, 24) + SourceIndex(0) -5 >Emitted(27, 13) Source(42, 25) + SourceIndex(0) -6 >Emitted(27, 15) Source(42, 27) + SourceIndex(0) -7 >Emitted(27, 17) Source(42, 28) + SourceIndex(0) -8 >Emitted(27, 19) Source(42, 30) + SourceIndex(0) -9 >Emitted(27, 20) Source(42, 31) + SourceIndex(0) -10>Emitted(27, 21) Source(42, 32) + SourceIndex(0) +1 >Emitted(28, 1) Source(42, 1) + SourceIndex(0) +2 >Emitted(28, 5) Source(42, 5) + SourceIndex(0) +3 >Emitted(28, 9) Source(42, 9) + SourceIndex(0) +4 >Emitted(28, 12) Source(42, 24) + SourceIndex(0) +5 >Emitted(28, 13) Source(42, 25) + SourceIndex(0) +6 >Emitted(28, 15) Source(42, 27) + SourceIndex(0) +7 >Emitted(28, 17) Source(42, 28) + SourceIndex(0) +8 >Emitted(28, 19) Source(42, 30) + SourceIndex(0) +9 >Emitted(28, 20) Source(42, 31) + SourceIndex(0) +10>Emitted(28, 21) Source(42, 32) + SourceIndex(0) --- >>>var c3t10 = [({}), ({})]; 1-> @@ -651,20 +652,20 @@ sourceFile:contextualTyping.ts 12> ) 13> ] 14> ; -1->Emitted(28, 1) Source(43, 1) + SourceIndex(0) -2 >Emitted(28, 5) Source(43, 5) + SourceIndex(0) -3 >Emitted(28, 10) Source(43, 10) + SourceIndex(0) -4 >Emitted(28, 13) Source(43, 21) + SourceIndex(0) -5 >Emitted(28, 14) Source(43, 28) + SourceIndex(0) -6 >Emitted(28, 15) Source(43, 29) + SourceIndex(0) -7 >Emitted(28, 17) Source(43, 31) + SourceIndex(0) -8 >Emitted(28, 18) Source(43, 32) + SourceIndex(0) -9 >Emitted(28, 20) Source(43, 39) + SourceIndex(0) -10>Emitted(28, 21) Source(43, 40) + SourceIndex(0) -11>Emitted(28, 23) Source(43, 42) + SourceIndex(0) -12>Emitted(28, 24) Source(43, 43) + SourceIndex(0) -13>Emitted(28, 25) Source(43, 44) + SourceIndex(0) -14>Emitted(28, 26) Source(43, 45) + SourceIndex(0) +1->Emitted(29, 1) Source(43, 1) + SourceIndex(0) +2 >Emitted(29, 5) Source(43, 5) + SourceIndex(0) +3 >Emitted(29, 10) Source(43, 10) + SourceIndex(0) +4 >Emitted(29, 13) Source(43, 21) + SourceIndex(0) +5 >Emitted(29, 14) Source(43, 28) + SourceIndex(0) +6 >Emitted(29, 15) Source(43, 29) + SourceIndex(0) +7 >Emitted(29, 17) Source(43, 31) + SourceIndex(0) +8 >Emitted(29, 18) Source(43, 32) + SourceIndex(0) +9 >Emitted(29, 20) Source(43, 39) + SourceIndex(0) +10>Emitted(29, 21) Source(43, 40) + SourceIndex(0) +11>Emitted(29, 23) Source(43, 42) + SourceIndex(0) +12>Emitted(29, 24) Source(43, 43) + SourceIndex(0) +13>Emitted(29, 25) Source(43, 44) + SourceIndex(0) +14>Emitted(29, 26) Source(43, 45) + SourceIndex(0) --- >>>var c3t11 = [function (n, s) { return s; }]; 1-> @@ -702,23 +703,23 @@ sourceFile:contextualTyping.ts 15> } 16> ] 17> ; -1->Emitted(29, 1) Source(44, 1) + SourceIndex(0) -2 >Emitted(29, 5) Source(44, 5) + SourceIndex(0) -3 >Emitted(29, 10) Source(44, 10) + SourceIndex(0) -4 >Emitted(29, 13) Source(44, 50) + SourceIndex(0) -5 >Emitted(29, 14) Source(44, 51) + SourceIndex(0) -6 >Emitted(29, 24) Source(44, 60) + SourceIndex(0) -7 >Emitted(29, 25) Source(44, 61) + SourceIndex(0) -8 >Emitted(29, 27) Source(44, 63) + SourceIndex(0) -9 >Emitted(29, 28) Source(44, 64) + SourceIndex(0) -10>Emitted(29, 32) Source(44, 68) + SourceIndex(0) -11>Emitted(29, 39) Source(44, 75) + SourceIndex(0) -12>Emitted(29, 40) Source(44, 76) + SourceIndex(0) -13>Emitted(29, 41) Source(44, 77) + SourceIndex(0) -14>Emitted(29, 42) Source(44, 78) + SourceIndex(0) -15>Emitted(29, 43) Source(44, 79) + SourceIndex(0) -16>Emitted(29, 44) Source(44, 80) + SourceIndex(0) -17>Emitted(29, 45) Source(44, 81) + SourceIndex(0) +1->Emitted(30, 1) Source(44, 1) + SourceIndex(0) +2 >Emitted(30, 5) Source(44, 5) + SourceIndex(0) +3 >Emitted(30, 10) Source(44, 10) + SourceIndex(0) +4 >Emitted(30, 13) Source(44, 50) + SourceIndex(0) +5 >Emitted(30, 14) Source(44, 51) + SourceIndex(0) +6 >Emitted(30, 24) Source(44, 60) + SourceIndex(0) +7 >Emitted(30, 25) Source(44, 61) + SourceIndex(0) +8 >Emitted(30, 27) Source(44, 63) + SourceIndex(0) +9 >Emitted(30, 28) Source(44, 64) + SourceIndex(0) +10>Emitted(30, 32) Source(44, 68) + SourceIndex(0) +11>Emitted(30, 39) Source(44, 75) + SourceIndex(0) +12>Emitted(30, 40) Source(44, 76) + SourceIndex(0) +13>Emitted(30, 41) Source(44, 77) + SourceIndex(0) +14>Emitted(30, 42) Source(44, 78) + SourceIndex(0) +15>Emitted(30, 43) Source(44, 79) + SourceIndex(0) +16>Emitted(30, 44) Source(44, 80) + SourceIndex(0) +17>Emitted(30, 45) Source(44, 81) + SourceIndex(0) --- >>>var c3t12 = { 1 > @@ -731,10 +732,10 @@ sourceFile:contextualTyping.ts 2 >var 3 > c3t12 4 > : IBar = -1 >Emitted(30, 1) Source(45, 1) + SourceIndex(0) -2 >Emitted(30, 5) Source(45, 5) + SourceIndex(0) -3 >Emitted(30, 10) Source(45, 10) + SourceIndex(0) -4 >Emitted(30, 13) Source(45, 19) + SourceIndex(0) +1 >Emitted(31, 1) Source(45, 1) + SourceIndex(0) +2 >Emitted(31, 5) Source(45, 5) + SourceIndex(0) +3 >Emitted(31, 10) Source(45, 10) + SourceIndex(0) +4 >Emitted(31, 13) Source(45, 19) + SourceIndex(0) --- >>> foo: ({}) 1->^^^^ @@ -750,12 +751,12 @@ sourceFile:contextualTyping.ts 4 > ( 5 > {} 6 > ) -1->Emitted(31, 5) Source(46, 5) + SourceIndex(0) -2 >Emitted(31, 8) Source(46, 8) + SourceIndex(0) -3 >Emitted(31, 10) Source(46, 16) + SourceIndex(0) -4 >Emitted(31, 11) Source(46, 17) + SourceIndex(0) -5 >Emitted(31, 13) Source(46, 19) + SourceIndex(0) -6 >Emitted(31, 14) Source(46, 20) + SourceIndex(0) +1->Emitted(32, 5) Source(46, 5) + SourceIndex(0) +2 >Emitted(32, 8) Source(46, 8) + SourceIndex(0) +3 >Emitted(32, 10) Source(46, 16) + SourceIndex(0) +4 >Emitted(32, 11) Source(46, 17) + SourceIndex(0) +5 >Emitted(32, 13) Source(46, 19) + SourceIndex(0) +6 >Emitted(32, 14) Source(46, 20) + SourceIndex(0) --- >>>}; 1 >^ @@ -764,8 +765,8 @@ sourceFile:contextualTyping.ts 1 > >} 2 > -1 >Emitted(32, 2) Source(47, 2) + SourceIndex(0) -2 >Emitted(32, 3) Source(47, 2) + SourceIndex(0) +1 >Emitted(33, 2) Source(47, 2) + SourceIndex(0) +2 >Emitted(33, 3) Source(47, 2) + SourceIndex(0) --- >>>var c3t13 = ({ 1-> @@ -780,11 +781,11 @@ sourceFile:contextualTyping.ts 3 > c3t13 4 > = 5 > ( -1->Emitted(33, 1) Source(48, 1) + SourceIndex(0) -2 >Emitted(33, 5) Source(48, 5) + SourceIndex(0) -3 >Emitted(33, 10) Source(48, 10) + SourceIndex(0) -4 >Emitted(33, 13) Source(48, 19) + SourceIndex(0) -5 >Emitted(33, 14) Source(48, 20) + SourceIndex(0) +1->Emitted(34, 1) Source(48, 1) + SourceIndex(0) +2 >Emitted(34, 5) Source(48, 5) + SourceIndex(0) +3 >Emitted(34, 10) Source(48, 10) + SourceIndex(0) +4 >Emitted(34, 13) Source(48, 19) + SourceIndex(0) +5 >Emitted(34, 14) Source(48, 20) + SourceIndex(0) --- >>> f: function (i, s) { return s; } 1->^^^^ @@ -814,19 +815,19 @@ sourceFile:contextualTyping.ts 11> ; 12> 13> } -1->Emitted(34, 5) Source(49, 5) + SourceIndex(0) -2 >Emitted(34, 6) Source(49, 6) + SourceIndex(0) -3 >Emitted(34, 8) Source(49, 8) + SourceIndex(0) -4 >Emitted(34, 18) Source(49, 17) + SourceIndex(0) -5 >Emitted(34, 19) Source(49, 18) + SourceIndex(0) -6 >Emitted(34, 21) Source(49, 20) + SourceIndex(0) -7 >Emitted(34, 22) Source(49, 21) + SourceIndex(0) -8 >Emitted(34, 26) Source(49, 25) + SourceIndex(0) -9 >Emitted(34, 33) Source(49, 32) + SourceIndex(0) -10>Emitted(34, 34) Source(49, 33) + SourceIndex(0) -11>Emitted(34, 35) Source(49, 34) + SourceIndex(0) -12>Emitted(34, 36) Source(49, 35) + SourceIndex(0) -13>Emitted(34, 37) Source(49, 36) + SourceIndex(0) +1->Emitted(35, 5) Source(49, 5) + SourceIndex(0) +2 >Emitted(35, 6) Source(49, 6) + SourceIndex(0) +3 >Emitted(35, 8) Source(49, 8) + SourceIndex(0) +4 >Emitted(35, 18) Source(49, 17) + SourceIndex(0) +5 >Emitted(35, 19) Source(49, 18) + SourceIndex(0) +6 >Emitted(35, 21) Source(49, 20) + SourceIndex(0) +7 >Emitted(35, 22) Source(49, 21) + SourceIndex(0) +8 >Emitted(35, 26) Source(49, 25) + SourceIndex(0) +9 >Emitted(35, 33) Source(49, 32) + SourceIndex(0) +10>Emitted(35, 34) Source(49, 33) + SourceIndex(0) +11>Emitted(35, 35) Source(49, 34) + SourceIndex(0) +12>Emitted(35, 36) Source(49, 35) + SourceIndex(0) +13>Emitted(35, 37) Source(49, 36) + SourceIndex(0) --- >>>}); 1 >^ @@ -837,9 +838,9 @@ sourceFile:contextualTyping.ts >} 2 > ) 3 > -1 >Emitted(35, 2) Source(50, 2) + SourceIndex(0) -2 >Emitted(35, 3) Source(50, 3) + SourceIndex(0) -3 >Emitted(35, 4) Source(50, 3) + SourceIndex(0) +1 >Emitted(36, 2) Source(50, 2) + SourceIndex(0) +2 >Emitted(36, 3) Source(50, 3) + SourceIndex(0) +3 >Emitted(36, 4) Source(50, 3) + SourceIndex(0) --- >>>var c3t14 = ({ 1-> @@ -853,11 +854,11 @@ sourceFile:contextualTyping.ts 3 > c3t14 4 > = 5 > ( -1->Emitted(36, 1) Source(51, 1) + SourceIndex(0) -2 >Emitted(36, 5) Source(51, 5) + SourceIndex(0) -3 >Emitted(36, 10) Source(51, 10) + SourceIndex(0) -4 >Emitted(36, 13) Source(51, 19) + SourceIndex(0) -5 >Emitted(36, 14) Source(51, 20) + SourceIndex(0) +1->Emitted(37, 1) Source(51, 1) + SourceIndex(0) +2 >Emitted(37, 5) Source(51, 5) + SourceIndex(0) +3 >Emitted(37, 10) Source(51, 10) + SourceIndex(0) +4 >Emitted(37, 13) Source(51, 19) + SourceIndex(0) +5 >Emitted(37, 14) Source(51, 20) + SourceIndex(0) --- >>> a: [] 1 >^^^^ @@ -869,10 +870,10 @@ sourceFile:contextualTyping.ts 2 > a 3 > : 4 > [] -1 >Emitted(37, 5) Source(52, 5) + SourceIndex(0) -2 >Emitted(37, 6) Source(52, 6) + SourceIndex(0) -3 >Emitted(37, 8) Source(52, 8) + SourceIndex(0) -4 >Emitted(37, 10) Source(52, 10) + SourceIndex(0) +1 >Emitted(38, 5) Source(52, 5) + SourceIndex(0) +2 >Emitted(38, 6) Source(52, 6) + SourceIndex(0) +3 >Emitted(38, 8) Source(52, 8) + SourceIndex(0) +4 >Emitted(38, 10) Source(52, 10) + SourceIndex(0) --- >>>}); 1 >^ @@ -883,9 +884,9 @@ sourceFile:contextualTyping.ts >} 2 > ) 3 > -1 >Emitted(38, 2) Source(53, 2) + SourceIndex(0) -2 >Emitted(38, 3) Source(53, 3) + SourceIndex(0) -3 >Emitted(38, 4) Source(53, 3) + SourceIndex(0) +1 >Emitted(39, 2) Source(53, 2) + SourceIndex(0) +2 >Emitted(39, 3) Source(53, 3) + SourceIndex(0) +3 >Emitted(39, 4) Source(53, 3) + SourceIndex(0) --- >>>// CONTEXT: Class property assignment 1-> @@ -894,8 +895,8 @@ sourceFile:contextualTyping.ts > > 2 >// CONTEXT: Class property assignment -1->Emitted(39, 1) Source(55, 1) + SourceIndex(0) -2 >Emitted(39, 38) Source(55, 38) + SourceIndex(0) +1->Emitted(40, 1) Source(55, 1) + SourceIndex(0) +2 >Emitted(40, 38) Source(55, 38) + SourceIndex(0) --- >>>class C4T5 { 1 > @@ -906,9 +907,9 @@ sourceFile:contextualTyping.ts > 2 >class 3 > C4T5 -1 >Emitted(40, 1) Source(56, 1) + SourceIndex(0) -2 >Emitted(40, 7) Source(56, 7) + SourceIndex(0) -3 >Emitted(40, 11) Source(56, 11) + SourceIndex(0) +1 >Emitted(41, 1) Source(56, 1) + SourceIndex(0) +2 >Emitted(41, 7) Source(56, 7) + SourceIndex(0) +3 >Emitted(41, 11) Source(56, 11) + SourceIndex(0) --- >>> constructor() { 1->^^^^ @@ -916,7 +917,7 @@ sourceFile:contextualTyping.ts 1-> { > foo: (i: number, s: string) => string; > -1->Emitted(41, 5) Source(58, 5) + SourceIndex(0) +1->Emitted(42, 5) Source(58, 5) + SourceIndex(0) --- >>> this.foo = function (i, s) { 1->^^^^^^^^ @@ -938,15 +939,15 @@ sourceFile:contextualTyping.ts 7 > i 8 > , 9 > s -1->Emitted(42, 9) Source(59, 9) + SourceIndex(0) -2 >Emitted(42, 13) Source(59, 13) + SourceIndex(0) -3 >Emitted(42, 14) Source(59, 14) + SourceIndex(0) -4 >Emitted(42, 17) Source(59, 17) + SourceIndex(0) -5 >Emitted(42, 20) Source(59, 20) + SourceIndex(0) -6 >Emitted(42, 30) Source(59, 29) + SourceIndex(0) -7 >Emitted(42, 31) Source(59, 30) + SourceIndex(0) -8 >Emitted(42, 33) Source(59, 32) + SourceIndex(0) -9 >Emitted(42, 34) Source(59, 33) + SourceIndex(0) +1->Emitted(43, 9) Source(59, 9) + SourceIndex(0) +2 >Emitted(43, 13) Source(59, 13) + SourceIndex(0) +3 >Emitted(43, 14) Source(59, 14) + SourceIndex(0) +4 >Emitted(43, 17) Source(59, 17) + SourceIndex(0) +5 >Emitted(43, 20) Source(59, 20) + SourceIndex(0) +6 >Emitted(43, 30) Source(59, 29) + SourceIndex(0) +7 >Emitted(43, 31) Source(59, 30) + SourceIndex(0) +8 >Emitted(43, 33) Source(59, 32) + SourceIndex(0) +9 >Emitted(43, 34) Source(59, 33) + SourceIndex(0) --- >>> return s; 1 >^^^^^^^^^^^^ @@ -958,10 +959,10 @@ sourceFile:contextualTyping.ts 2 > return 3 > s 4 > ; -1 >Emitted(43, 13) Source(60, 13) + SourceIndex(0) -2 >Emitted(43, 20) Source(60, 20) + SourceIndex(0) -3 >Emitted(43, 21) Source(60, 21) + SourceIndex(0) -4 >Emitted(43, 22) Source(60, 22) + SourceIndex(0) +1 >Emitted(44, 13) Source(60, 13) + SourceIndex(0) +2 >Emitted(44, 20) Source(60, 20) + SourceIndex(0) +3 >Emitted(44, 21) Source(60, 21) + SourceIndex(0) +4 >Emitted(44, 22) Source(60, 22) + SourceIndex(0) --- >>> }; 1 >^^^^^^^^ @@ -971,9 +972,9 @@ sourceFile:contextualTyping.ts > 2 > } 3 > -1 >Emitted(44, 9) Source(61, 9) + SourceIndex(0) -2 >Emitted(44, 10) Source(61, 10) + SourceIndex(0) -3 >Emitted(44, 11) Source(61, 10) + SourceIndex(0) +1 >Emitted(45, 9) Source(61, 9) + SourceIndex(0) +2 >Emitted(45, 10) Source(61, 10) + SourceIndex(0) +3 >Emitted(45, 11) Source(61, 10) + SourceIndex(0) --- >>> } 1 >^^^^ @@ -981,15 +982,15 @@ sourceFile:contextualTyping.ts 1 > > 2 > } -1 >Emitted(45, 5) Source(62, 5) + SourceIndex(0) -2 >Emitted(45, 6) Source(62, 6) + SourceIndex(0) +1 >Emitted(46, 5) Source(62, 5) + SourceIndex(0) +2 >Emitted(46, 6) Source(62, 6) + SourceIndex(0) --- >>>} 1 >^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > >} -1 >Emitted(46, 2) Source(63, 2) + SourceIndex(0) +1 >Emitted(47, 2) Source(63, 2) + SourceIndex(0) --- >>>// CONTEXT: Namespace property assignment 1-> @@ -998,8 +999,8 @@ sourceFile:contextualTyping.ts > > 2 >// CONTEXT: Namespace property assignment -1->Emitted(47, 1) Source(65, 1) + SourceIndex(0) -2 >Emitted(47, 42) Source(65, 42) + SourceIndex(0) +1->Emitted(48, 1) Source(65, 1) + SourceIndex(0) +2 >Emitted(48, 42) Source(65, 42) + SourceIndex(0) --- >>>var C5T5; 1 > @@ -1017,10 +1018,10 @@ sourceFile:contextualTyping.ts > return s; > } > } -1 >Emitted(48, 1) Source(66, 1) + SourceIndex(0) -2 >Emitted(48, 5) Source(66, 11) + SourceIndex(0) -3 >Emitted(48, 9) Source(66, 15) + SourceIndex(0) -4 >Emitted(48, 10) Source(71, 2) + SourceIndex(0) +1 >Emitted(49, 1) Source(66, 1) + SourceIndex(0) +2 >Emitted(49, 5) Source(66, 11) + SourceIndex(0) +3 >Emitted(49, 9) Source(66, 15) + SourceIndex(0) +4 >Emitted(49, 10) Source(71, 2) + SourceIndex(0) --- >>>(function (C5T5) { 1-> @@ -1030,9 +1031,9 @@ sourceFile:contextualTyping.ts 1-> 2 >namespace 3 > C5T5 -1->Emitted(49, 1) Source(66, 1) + SourceIndex(0) -2 >Emitted(49, 12) Source(66, 11) + SourceIndex(0) -3 >Emitted(49, 16) Source(66, 15) + SourceIndex(0) +1->Emitted(50, 1) Source(66, 1) + SourceIndex(0) +2 >Emitted(50, 12) Source(66, 11) + SourceIndex(0) +3 >Emitted(50, 16) Source(66, 15) + SourceIndex(0) --- >>> C5T5.foo = function (i, s) { 1->^^^^ @@ -1053,14 +1054,14 @@ sourceFile:contextualTyping.ts 6 > i 7 > , 8 > s -1->Emitted(50, 5) Source(68, 5) + SourceIndex(0) -2 >Emitted(50, 10) Source(68, 5) + SourceIndex(0) -3 >Emitted(50, 13) Source(68, 8) + SourceIndex(0) -4 >Emitted(50, 16) Source(68, 11) + SourceIndex(0) -5 >Emitted(50, 26) Source(68, 20) + SourceIndex(0) -6 >Emitted(50, 27) Source(68, 21) + SourceIndex(0) -7 >Emitted(50, 29) Source(68, 23) + SourceIndex(0) -8 >Emitted(50, 30) Source(68, 24) + SourceIndex(0) +1->Emitted(51, 5) Source(68, 5) + SourceIndex(0) +2 >Emitted(51, 10) Source(68, 5) + SourceIndex(0) +3 >Emitted(51, 13) Source(68, 8) + SourceIndex(0) +4 >Emitted(51, 16) Source(68, 11) + SourceIndex(0) +5 >Emitted(51, 26) Source(68, 20) + SourceIndex(0) +6 >Emitted(51, 27) Source(68, 21) + SourceIndex(0) +7 >Emitted(51, 29) Source(68, 23) + SourceIndex(0) +8 >Emitted(51, 30) Source(68, 24) + SourceIndex(0) --- >>> return s; 1 >^^^^^^^^ @@ -1072,10 +1073,10 @@ sourceFile:contextualTyping.ts 2 > return 3 > s 4 > ; -1 >Emitted(51, 9) Source(69, 9) + SourceIndex(0) -2 >Emitted(51, 16) Source(69, 16) + SourceIndex(0) -3 >Emitted(51, 17) Source(69, 17) + SourceIndex(0) -4 >Emitted(51, 18) Source(69, 18) + SourceIndex(0) +1 >Emitted(52, 9) Source(69, 9) + SourceIndex(0) +2 >Emitted(52, 16) Source(69, 16) + SourceIndex(0) +3 >Emitted(52, 17) Source(69, 17) + SourceIndex(0) +4 >Emitted(52, 18) Source(69, 18) + SourceIndex(0) --- >>> }; 1 >^^^^ @@ -1086,9 +1087,9 @@ sourceFile:contextualTyping.ts > 2 > } 3 > -1 >Emitted(52, 5) Source(70, 5) + SourceIndex(0) -2 >Emitted(52, 6) Source(70, 6) + SourceIndex(0) -3 >Emitted(52, 7) Source(70, 6) + SourceIndex(0) +1 >Emitted(53, 5) Source(70, 5) + SourceIndex(0) +2 >Emitted(53, 6) Source(70, 6) + SourceIndex(0) +3 >Emitted(53, 7) Source(70, 6) + SourceIndex(0) --- >>>})(C5T5 || (C5T5 = {})); 1-> @@ -1112,13 +1113,13 @@ sourceFile:contextualTyping.ts > return s; > } > } -1->Emitted(53, 1) Source(71, 1) + SourceIndex(0) -2 >Emitted(53, 2) Source(71, 2) + SourceIndex(0) -3 >Emitted(53, 4) Source(66, 11) + SourceIndex(0) -4 >Emitted(53, 8) Source(66, 15) + SourceIndex(0) -5 >Emitted(53, 13) Source(66, 11) + SourceIndex(0) -6 >Emitted(53, 17) Source(66, 15) + SourceIndex(0) -7 >Emitted(53, 25) Source(71, 2) + SourceIndex(0) +1->Emitted(54, 1) Source(71, 1) + SourceIndex(0) +2 >Emitted(54, 2) Source(71, 2) + SourceIndex(0) +3 >Emitted(54, 4) Source(66, 11) + SourceIndex(0) +4 >Emitted(54, 8) Source(66, 15) + SourceIndex(0) +5 >Emitted(54, 13) Source(66, 11) + SourceIndex(0) +6 >Emitted(54, 17) Source(66, 15) + SourceIndex(0) +7 >Emitted(54, 25) Source(71, 2) + SourceIndex(0) --- >>>// CONTEXT: Variable assignment 1-> @@ -1127,8 +1128,8 @@ sourceFile:contextualTyping.ts > > 2 >// CONTEXT: Variable assignment -1->Emitted(54, 1) Source(73, 1) + SourceIndex(0) -2 >Emitted(54, 32) Source(73, 32) + SourceIndex(0) +1->Emitted(55, 1) Source(73, 1) + SourceIndex(0) +2 >Emitted(55, 32) Source(73, 32) + SourceIndex(0) --- >>>var c6t5; 1 > @@ -1141,10 +1142,10 @@ sourceFile:contextualTyping.ts 2 >var 3 > c6t5: (n: number) => IFoo 4 > ; -1 >Emitted(55, 1) Source(74, 1) + SourceIndex(0) -2 >Emitted(55, 5) Source(74, 5) + SourceIndex(0) -3 >Emitted(55, 9) Source(74, 30) + SourceIndex(0) -4 >Emitted(55, 10) Source(74, 31) + SourceIndex(0) +1 >Emitted(56, 1) Source(74, 1) + SourceIndex(0) +2 >Emitted(56, 5) Source(74, 5) + SourceIndex(0) +3 >Emitted(56, 9) Source(74, 30) + SourceIndex(0) +4 >Emitted(56, 10) Source(74, 31) + SourceIndex(0) --- >>>c6t5 = function (n) { return ({}); }; 1-> @@ -1176,20 +1177,20 @@ sourceFile:contextualTyping.ts 12> 13> } 14> ; -1->Emitted(56, 1) Source(75, 1) + SourceIndex(0) -2 >Emitted(56, 5) Source(75, 5) + SourceIndex(0) -3 >Emitted(56, 8) Source(75, 29) + SourceIndex(0) -4 >Emitted(56, 18) Source(75, 38) + SourceIndex(0) -5 >Emitted(56, 19) Source(75, 39) + SourceIndex(0) -6 >Emitted(56, 23) Source(75, 43) + SourceIndex(0) -7 >Emitted(56, 30) Source(75, 56) + SourceIndex(0) -8 >Emitted(56, 31) Source(75, 57) + SourceIndex(0) -9 >Emitted(56, 33) Source(75, 59) + SourceIndex(0) -10>Emitted(56, 34) Source(75, 60) + SourceIndex(0) -11>Emitted(56, 35) Source(75, 60) + SourceIndex(0) -12>Emitted(56, 36) Source(75, 61) + SourceIndex(0) -13>Emitted(56, 37) Source(75, 62) + SourceIndex(0) -14>Emitted(56, 38) Source(75, 63) + SourceIndex(0) +1->Emitted(57, 1) Source(75, 1) + SourceIndex(0) +2 >Emitted(57, 5) Source(75, 5) + SourceIndex(0) +3 >Emitted(57, 8) Source(75, 29) + SourceIndex(0) +4 >Emitted(57, 18) Source(75, 38) + SourceIndex(0) +5 >Emitted(57, 19) Source(75, 39) + SourceIndex(0) +6 >Emitted(57, 23) Source(75, 43) + SourceIndex(0) +7 >Emitted(57, 30) Source(75, 56) + SourceIndex(0) +8 >Emitted(57, 31) Source(75, 57) + SourceIndex(0) +9 >Emitted(57, 33) Source(75, 59) + SourceIndex(0) +10>Emitted(57, 34) Source(75, 60) + SourceIndex(0) +11>Emitted(57, 35) Source(75, 60) + SourceIndex(0) +12>Emitted(57, 36) Source(75, 61) + SourceIndex(0) +13>Emitted(57, 37) Source(75, 62) + SourceIndex(0) +14>Emitted(57, 38) Source(75, 63) + SourceIndex(0) --- >>>// CONTEXT: Array index assignment 1 > @@ -1198,8 +1199,8 @@ sourceFile:contextualTyping.ts > > 2 >// CONTEXT: Array index assignment -1 >Emitted(57, 1) Source(77, 1) + SourceIndex(0) -2 >Emitted(57, 35) Source(77, 35) + SourceIndex(0) +1 >Emitted(58, 1) Source(77, 1) + SourceIndex(0) +2 >Emitted(58, 35) Source(77, 35) + SourceIndex(0) --- >>>var c7t2 = []; 1 > @@ -1216,12 +1217,12 @@ sourceFile:contextualTyping.ts 4 > : IFoo[] = 5 > [] 6 > ; -1 >Emitted(58, 1) Source(78, 1) + SourceIndex(0) -2 >Emitted(58, 5) Source(78, 5) + SourceIndex(0) -3 >Emitted(58, 9) Source(78, 9) + SourceIndex(0) -4 >Emitted(58, 12) Source(78, 20) + SourceIndex(0) -5 >Emitted(58, 14) Source(78, 22) + SourceIndex(0) -6 >Emitted(58, 15) Source(78, 23) + SourceIndex(0) +1 >Emitted(59, 1) Source(78, 1) + SourceIndex(0) +2 >Emitted(59, 5) Source(78, 5) + SourceIndex(0) +3 >Emitted(59, 9) Source(78, 9) + SourceIndex(0) +4 >Emitted(59, 12) Source(78, 20) + SourceIndex(0) +5 >Emitted(59, 14) Source(78, 22) + SourceIndex(0) +6 >Emitted(59, 15) Source(78, 23) + SourceIndex(0) --- >>>c7t2[0] = ({ n: 1 }); 1-> @@ -1253,20 +1254,20 @@ sourceFile:contextualTyping.ts 12> } 13> ) 14> ; -1->Emitted(59, 1) Source(79, 1) + SourceIndex(0) -2 >Emitted(59, 5) Source(79, 5) + SourceIndex(0) -3 >Emitted(59, 6) Source(79, 6) + SourceIndex(0) -4 >Emitted(59, 7) Source(79, 7) + SourceIndex(0) -5 >Emitted(59, 8) Source(79, 8) + SourceIndex(0) -6 >Emitted(59, 11) Source(79, 17) + SourceIndex(0) -7 >Emitted(59, 12) Source(79, 18) + SourceIndex(0) -8 >Emitted(59, 14) Source(79, 19) + SourceIndex(0) -9 >Emitted(59, 15) Source(79, 20) + SourceIndex(0) -10>Emitted(59, 17) Source(79, 22) + SourceIndex(0) -11>Emitted(59, 18) Source(79, 23) + SourceIndex(0) -12>Emitted(59, 20) Source(79, 24) + SourceIndex(0) -13>Emitted(59, 21) Source(79, 25) + SourceIndex(0) -14>Emitted(59, 22) Source(79, 26) + SourceIndex(0) +1->Emitted(60, 1) Source(79, 1) + SourceIndex(0) +2 >Emitted(60, 5) Source(79, 5) + SourceIndex(0) +3 >Emitted(60, 6) Source(79, 6) + SourceIndex(0) +4 >Emitted(60, 7) Source(79, 7) + SourceIndex(0) +5 >Emitted(60, 8) Source(79, 8) + SourceIndex(0) +6 >Emitted(60, 11) Source(79, 17) + SourceIndex(0) +7 >Emitted(60, 12) Source(79, 18) + SourceIndex(0) +8 >Emitted(60, 14) Source(79, 19) + SourceIndex(0) +9 >Emitted(60, 15) Source(79, 20) + SourceIndex(0) +10>Emitted(60, 17) Source(79, 22) + SourceIndex(0) +11>Emitted(60, 18) Source(79, 23) + SourceIndex(0) +12>Emitted(60, 20) Source(79, 24) + SourceIndex(0) +13>Emitted(60, 21) Source(79, 25) + SourceIndex(0) +14>Emitted(60, 22) Source(79, 26) + SourceIndex(0) --- >>>var objc8 = ({}); 1 > @@ -1327,14 +1328,14 @@ sourceFile:contextualTyping.ts 6 > {} 7 > ) 8 > ; -1 >Emitted(60, 1) Source(102, 1) + SourceIndex(0) -2 >Emitted(60, 5) Source(102, 5) + SourceIndex(0) -3 >Emitted(60, 10) Source(102, 10) + SourceIndex(0) -4 >Emitted(60, 13) Source(120, 19) + SourceIndex(0) -5 >Emitted(60, 14) Source(120, 20) + SourceIndex(0) -6 >Emitted(60, 16) Source(120, 22) + SourceIndex(0) -7 >Emitted(60, 17) Source(120, 23) + SourceIndex(0) -8 >Emitted(60, 18) Source(120, 24) + SourceIndex(0) +1 >Emitted(61, 1) Source(102, 1) + SourceIndex(0) +2 >Emitted(61, 5) Source(102, 5) + SourceIndex(0) +3 >Emitted(61, 10) Source(102, 10) + SourceIndex(0) +4 >Emitted(61, 13) Source(120, 19) + SourceIndex(0) +5 >Emitted(61, 14) Source(120, 20) + SourceIndex(0) +6 >Emitted(61, 16) Source(120, 22) + SourceIndex(0) +7 >Emitted(61, 17) Source(120, 23) + SourceIndex(0) +8 >Emitted(61, 18) Source(120, 24) + SourceIndex(0) --- >>>objc8.t1 = (function (s) { return s; }); 1-> @@ -1371,22 +1372,22 @@ sourceFile:contextualTyping.ts 14> } 15> ) 16> ; -1->Emitted(61, 1) Source(122, 1) + SourceIndex(0) -2 >Emitted(61, 6) Source(122, 6) + SourceIndex(0) -3 >Emitted(61, 7) Source(122, 7) + SourceIndex(0) -4 >Emitted(61, 9) Source(122, 9) + SourceIndex(0) -5 >Emitted(61, 12) Source(122, 12) + SourceIndex(0) -6 >Emitted(61, 13) Source(122, 13) + SourceIndex(0) -7 >Emitted(61, 23) Source(122, 22) + SourceIndex(0) -8 >Emitted(61, 24) Source(122, 23) + SourceIndex(0) -9 >Emitted(61, 28) Source(122, 27) + SourceIndex(0) -10>Emitted(61, 35) Source(122, 34) + SourceIndex(0) -11>Emitted(61, 36) Source(122, 35) + SourceIndex(0) -12>Emitted(61, 37) Source(122, 35) + SourceIndex(0) -13>Emitted(61, 38) Source(122, 36) + SourceIndex(0) -14>Emitted(61, 39) Source(122, 37) + SourceIndex(0) -15>Emitted(61, 40) Source(122, 38) + SourceIndex(0) -16>Emitted(61, 41) Source(122, 39) + SourceIndex(0) +1->Emitted(62, 1) Source(122, 1) + SourceIndex(0) +2 >Emitted(62, 6) Source(122, 6) + SourceIndex(0) +3 >Emitted(62, 7) Source(122, 7) + SourceIndex(0) +4 >Emitted(62, 9) Source(122, 9) + SourceIndex(0) +5 >Emitted(62, 12) Source(122, 12) + SourceIndex(0) +6 >Emitted(62, 13) Source(122, 13) + SourceIndex(0) +7 >Emitted(62, 23) Source(122, 22) + SourceIndex(0) +8 >Emitted(62, 24) Source(122, 23) + SourceIndex(0) +9 >Emitted(62, 28) Source(122, 27) + SourceIndex(0) +10>Emitted(62, 35) Source(122, 34) + SourceIndex(0) +11>Emitted(62, 36) Source(122, 35) + SourceIndex(0) +12>Emitted(62, 37) Source(122, 35) + SourceIndex(0) +13>Emitted(62, 38) Source(122, 36) + SourceIndex(0) +14>Emitted(62, 39) Source(122, 37) + SourceIndex(0) +15>Emitted(62, 40) Source(122, 38) + SourceIndex(0) +16>Emitted(62, 41) Source(122, 39) + SourceIndex(0) --- >>>objc8.t2 = ({ 1 > @@ -1402,12 +1403,12 @@ sourceFile:contextualTyping.ts 4 > t2 5 > = 6 > ( -1 >Emitted(62, 1) Source(123, 1) + SourceIndex(0) -2 >Emitted(62, 6) Source(123, 6) + SourceIndex(0) -3 >Emitted(62, 7) Source(123, 7) + SourceIndex(0) -4 >Emitted(62, 9) Source(123, 9) + SourceIndex(0) -5 >Emitted(62, 12) Source(123, 18) + SourceIndex(0) -6 >Emitted(62, 13) Source(123, 19) + SourceIndex(0) +1 >Emitted(63, 1) Source(123, 1) + SourceIndex(0) +2 >Emitted(63, 6) Source(123, 6) + SourceIndex(0) +3 >Emitted(63, 7) Source(123, 7) + SourceIndex(0) +4 >Emitted(63, 9) Source(123, 9) + SourceIndex(0) +5 >Emitted(63, 12) Source(123, 18) + SourceIndex(0) +6 >Emitted(63, 13) Source(123, 19) + SourceIndex(0) --- >>> n: 1 1 >^^^^ @@ -1419,10 +1420,10 @@ sourceFile:contextualTyping.ts 2 > n 3 > : 4 > 1 -1 >Emitted(63, 5) Source(124, 5) + SourceIndex(0) -2 >Emitted(63, 6) Source(124, 6) + SourceIndex(0) -3 >Emitted(63, 8) Source(124, 8) + SourceIndex(0) -4 >Emitted(63, 9) Source(124, 9) + SourceIndex(0) +1 >Emitted(64, 5) Source(124, 5) + SourceIndex(0) +2 >Emitted(64, 6) Source(124, 6) + SourceIndex(0) +3 >Emitted(64, 8) Source(124, 8) + SourceIndex(0) +4 >Emitted(64, 9) Source(124, 9) + SourceIndex(0) --- >>>}); 1 >^ @@ -1433,9 +1434,9 @@ sourceFile:contextualTyping.ts >} 2 > ) 3 > ; -1 >Emitted(64, 2) Source(125, 2) + SourceIndex(0) -2 >Emitted(64, 3) Source(125, 3) + SourceIndex(0) -3 >Emitted(64, 4) Source(125, 4) + SourceIndex(0) +1 >Emitted(65, 2) Source(125, 2) + SourceIndex(0) +2 >Emitted(65, 3) Source(125, 3) + SourceIndex(0) +3 >Emitted(65, 4) Source(125, 4) + SourceIndex(0) --- >>>objc8.t3 = []; 1-> @@ -1454,13 +1455,13 @@ sourceFile:contextualTyping.ts 5 > = 6 > [] 7 > ; -1->Emitted(65, 1) Source(126, 1) + SourceIndex(0) -2 >Emitted(65, 6) Source(126, 6) + SourceIndex(0) -3 >Emitted(65, 7) Source(126, 7) + SourceIndex(0) -4 >Emitted(65, 9) Source(126, 9) + SourceIndex(0) -5 >Emitted(65, 12) Source(126, 12) + SourceIndex(0) -6 >Emitted(65, 14) Source(126, 14) + SourceIndex(0) -7 >Emitted(65, 15) Source(126, 15) + SourceIndex(0) +1->Emitted(66, 1) Source(126, 1) + SourceIndex(0) +2 >Emitted(66, 6) Source(126, 6) + SourceIndex(0) +3 >Emitted(66, 7) Source(126, 7) + SourceIndex(0) +4 >Emitted(66, 9) Source(126, 9) + SourceIndex(0) +5 >Emitted(66, 12) Source(126, 12) + SourceIndex(0) +6 >Emitted(66, 14) Source(126, 14) + SourceIndex(0) +7 >Emitted(66, 15) Source(126, 15) + SourceIndex(0) --- >>>objc8.t4 = function () { return ({}); }; 1-> @@ -1493,20 +1494,20 @@ sourceFile:contextualTyping.ts 12> 13> } 14> ; -1->Emitted(66, 1) Source(127, 1) + SourceIndex(0) -2 >Emitted(66, 6) Source(127, 6) + SourceIndex(0) -3 >Emitted(66, 7) Source(127, 7) + SourceIndex(0) -4 >Emitted(66, 9) Source(127, 9) + SourceIndex(0) -5 >Emitted(66, 12) Source(127, 12) + SourceIndex(0) -6 >Emitted(66, 26) Source(127, 25) + SourceIndex(0) -7 >Emitted(66, 33) Source(127, 38) + SourceIndex(0) -8 >Emitted(66, 34) Source(127, 39) + SourceIndex(0) -9 >Emitted(66, 36) Source(127, 41) + SourceIndex(0) -10>Emitted(66, 37) Source(127, 42) + SourceIndex(0) -11>Emitted(66, 38) Source(127, 42) + SourceIndex(0) -12>Emitted(66, 39) Source(127, 43) + SourceIndex(0) -13>Emitted(66, 40) Source(127, 44) + SourceIndex(0) -14>Emitted(66, 41) Source(127, 45) + SourceIndex(0) +1->Emitted(67, 1) Source(127, 1) + SourceIndex(0) +2 >Emitted(67, 6) Source(127, 6) + SourceIndex(0) +3 >Emitted(67, 7) Source(127, 7) + SourceIndex(0) +4 >Emitted(67, 9) Source(127, 9) + SourceIndex(0) +5 >Emitted(67, 12) Source(127, 12) + SourceIndex(0) +6 >Emitted(67, 26) Source(127, 25) + SourceIndex(0) +7 >Emitted(67, 33) Source(127, 38) + SourceIndex(0) +8 >Emitted(67, 34) Source(127, 39) + SourceIndex(0) +9 >Emitted(67, 36) Source(127, 41) + SourceIndex(0) +10>Emitted(67, 37) Source(127, 42) + SourceIndex(0) +11>Emitted(67, 38) Source(127, 42) + SourceIndex(0) +12>Emitted(67, 39) Source(127, 43) + SourceIndex(0) +13>Emitted(67, 40) Source(127, 44) + SourceIndex(0) +14>Emitted(67, 41) Source(127, 45) + SourceIndex(0) --- >>>objc8.t5 = function (n) { return ({}); }; 1-> @@ -1543,22 +1544,22 @@ sourceFile:contextualTyping.ts 14> 15> } 16> ; -1->Emitted(67, 1) Source(128, 1) + SourceIndex(0) -2 >Emitted(67, 6) Source(128, 6) + SourceIndex(0) -3 >Emitted(67, 7) Source(128, 7) + SourceIndex(0) -4 >Emitted(67, 9) Source(128, 9) + SourceIndex(0) -5 >Emitted(67, 12) Source(128, 12) + SourceIndex(0) -6 >Emitted(67, 22) Source(128, 21) + SourceIndex(0) -7 >Emitted(67, 23) Source(128, 22) + SourceIndex(0) -8 >Emitted(67, 27) Source(128, 26) + SourceIndex(0) -9 >Emitted(67, 34) Source(128, 39) + SourceIndex(0) -10>Emitted(67, 35) Source(128, 40) + SourceIndex(0) -11>Emitted(67, 37) Source(128, 42) + SourceIndex(0) -12>Emitted(67, 38) Source(128, 43) + SourceIndex(0) -13>Emitted(67, 39) Source(128, 43) + SourceIndex(0) -14>Emitted(67, 40) Source(128, 44) + SourceIndex(0) -15>Emitted(67, 41) Source(128, 45) + SourceIndex(0) -16>Emitted(67, 42) Source(128, 46) + SourceIndex(0) +1->Emitted(68, 1) Source(128, 1) + SourceIndex(0) +2 >Emitted(68, 6) Source(128, 6) + SourceIndex(0) +3 >Emitted(68, 7) Source(128, 7) + SourceIndex(0) +4 >Emitted(68, 9) Source(128, 9) + SourceIndex(0) +5 >Emitted(68, 12) Source(128, 12) + SourceIndex(0) +6 >Emitted(68, 22) Source(128, 21) + SourceIndex(0) +7 >Emitted(68, 23) Source(128, 22) + SourceIndex(0) +8 >Emitted(68, 27) Source(128, 26) + SourceIndex(0) +9 >Emitted(68, 34) Source(128, 39) + SourceIndex(0) +10>Emitted(68, 35) Source(128, 40) + SourceIndex(0) +11>Emitted(68, 37) Source(128, 42) + SourceIndex(0) +12>Emitted(68, 38) Source(128, 43) + SourceIndex(0) +13>Emitted(68, 39) Source(128, 43) + SourceIndex(0) +14>Emitted(68, 40) Source(128, 44) + SourceIndex(0) +15>Emitted(68, 41) Source(128, 45) + SourceIndex(0) +16>Emitted(68, 42) Source(128, 46) + SourceIndex(0) --- >>>objc8.t6 = function (n, s) { return ({}); }; 1-> @@ -1598,24 +1599,24 @@ sourceFile:contextualTyping.ts 16> 17> } 18> ; -1->Emitted(68, 1) Source(129, 1) + SourceIndex(0) -2 >Emitted(68, 6) Source(129, 6) + SourceIndex(0) -3 >Emitted(68, 7) Source(129, 7) + SourceIndex(0) -4 >Emitted(68, 9) Source(129, 9) + SourceIndex(0) -5 >Emitted(68, 12) Source(129, 12) + SourceIndex(0) -6 >Emitted(68, 22) Source(129, 21) + SourceIndex(0) -7 >Emitted(68, 23) Source(129, 22) + SourceIndex(0) -8 >Emitted(68, 25) Source(129, 24) + SourceIndex(0) -9 >Emitted(68, 26) Source(129, 25) + SourceIndex(0) -10>Emitted(68, 30) Source(129, 29) + SourceIndex(0) -11>Emitted(68, 37) Source(129, 42) + SourceIndex(0) -12>Emitted(68, 38) Source(129, 43) + SourceIndex(0) -13>Emitted(68, 40) Source(129, 45) + SourceIndex(0) -14>Emitted(68, 41) Source(129, 46) + SourceIndex(0) -15>Emitted(68, 42) Source(129, 46) + SourceIndex(0) -16>Emitted(68, 43) Source(129, 47) + SourceIndex(0) -17>Emitted(68, 44) Source(129, 48) + SourceIndex(0) -18>Emitted(68, 45) Source(129, 49) + SourceIndex(0) +1->Emitted(69, 1) Source(129, 1) + SourceIndex(0) +2 >Emitted(69, 6) Source(129, 6) + SourceIndex(0) +3 >Emitted(69, 7) Source(129, 7) + SourceIndex(0) +4 >Emitted(69, 9) Source(129, 9) + SourceIndex(0) +5 >Emitted(69, 12) Source(129, 12) + SourceIndex(0) +6 >Emitted(69, 22) Source(129, 21) + SourceIndex(0) +7 >Emitted(69, 23) Source(129, 22) + SourceIndex(0) +8 >Emitted(69, 25) Source(129, 24) + SourceIndex(0) +9 >Emitted(69, 26) Source(129, 25) + SourceIndex(0) +10>Emitted(69, 30) Source(129, 29) + SourceIndex(0) +11>Emitted(69, 37) Source(129, 42) + SourceIndex(0) +12>Emitted(69, 38) Source(129, 43) + SourceIndex(0) +13>Emitted(69, 40) Source(129, 45) + SourceIndex(0) +14>Emitted(69, 41) Source(129, 46) + SourceIndex(0) +15>Emitted(69, 42) Source(129, 46) + SourceIndex(0) +16>Emitted(69, 43) Source(129, 47) + SourceIndex(0) +17>Emitted(69, 44) Source(129, 48) + SourceIndex(0) +18>Emitted(69, 45) Source(129, 49) + SourceIndex(0) --- >>>objc8.t7 = function (n) { return n; }; 1 > @@ -1648,20 +1649,20 @@ sourceFile:contextualTyping.ts 12> 13> } 14> ; -1 >Emitted(69, 1) Source(130, 1) + SourceIndex(0) -2 >Emitted(69, 6) Source(130, 6) + SourceIndex(0) -3 >Emitted(69, 7) Source(130, 7) + SourceIndex(0) -4 >Emitted(69, 9) Source(130, 9) + SourceIndex(0) -5 >Emitted(69, 12) Source(130, 12) + SourceIndex(0) -6 >Emitted(69, 22) Source(130, 21) + SourceIndex(0) -7 >Emitted(69, 23) Source(130, 30) + SourceIndex(0) -8 >Emitted(69, 27) Source(130, 34) + SourceIndex(0) -9 >Emitted(69, 34) Source(130, 41) + SourceIndex(0) -10>Emitted(69, 35) Source(130, 42) + SourceIndex(0) -11>Emitted(69, 36) Source(130, 42) + SourceIndex(0) -12>Emitted(69, 37) Source(130, 43) + SourceIndex(0) -13>Emitted(69, 38) Source(130, 44) + SourceIndex(0) -14>Emitted(69, 39) Source(130, 45) + SourceIndex(0) +1 >Emitted(70, 1) Source(130, 1) + SourceIndex(0) +2 >Emitted(70, 6) Source(130, 6) + SourceIndex(0) +3 >Emitted(70, 7) Source(130, 7) + SourceIndex(0) +4 >Emitted(70, 9) Source(130, 9) + SourceIndex(0) +5 >Emitted(70, 12) Source(130, 12) + SourceIndex(0) +6 >Emitted(70, 22) Source(130, 21) + SourceIndex(0) +7 >Emitted(70, 23) Source(130, 30) + SourceIndex(0) +8 >Emitted(70, 27) Source(130, 34) + SourceIndex(0) +9 >Emitted(70, 34) Source(130, 41) + SourceIndex(0) +10>Emitted(70, 35) Source(130, 42) + SourceIndex(0) +11>Emitted(70, 36) Source(130, 42) + SourceIndex(0) +12>Emitted(70, 37) Source(130, 43) + SourceIndex(0) +13>Emitted(70, 38) Source(130, 44) + SourceIndex(0) +14>Emitted(70, 39) Source(130, 45) + SourceIndex(0) --- >>>objc8.t8 = function (n) { return n; }; 1-> @@ -1694,20 +1695,20 @@ sourceFile:contextualTyping.ts 12> 13> } 14> ; -1->Emitted(70, 1) Source(132, 1) + SourceIndex(0) -2 >Emitted(70, 6) Source(132, 6) + SourceIndex(0) -3 >Emitted(70, 7) Source(132, 7) + SourceIndex(0) -4 >Emitted(70, 9) Source(132, 9) + SourceIndex(0) -5 >Emitted(70, 12) Source(132, 12) + SourceIndex(0) -6 >Emitted(70, 22) Source(132, 21) + SourceIndex(0) -7 >Emitted(70, 23) Source(132, 22) + SourceIndex(0) -8 >Emitted(70, 27) Source(132, 26) + SourceIndex(0) -9 >Emitted(70, 34) Source(132, 33) + SourceIndex(0) -10>Emitted(70, 35) Source(132, 34) + SourceIndex(0) -11>Emitted(70, 36) Source(132, 35) + SourceIndex(0) -12>Emitted(70, 37) Source(132, 36) + SourceIndex(0) -13>Emitted(70, 38) Source(132, 37) + SourceIndex(0) -14>Emitted(70, 39) Source(132, 38) + SourceIndex(0) +1->Emitted(71, 1) Source(132, 1) + SourceIndex(0) +2 >Emitted(71, 6) Source(132, 6) + SourceIndex(0) +3 >Emitted(71, 7) Source(132, 7) + SourceIndex(0) +4 >Emitted(71, 9) Source(132, 9) + SourceIndex(0) +5 >Emitted(71, 12) Source(132, 12) + SourceIndex(0) +6 >Emitted(71, 22) Source(132, 21) + SourceIndex(0) +7 >Emitted(71, 23) Source(132, 22) + SourceIndex(0) +8 >Emitted(71, 27) Source(132, 26) + SourceIndex(0) +9 >Emitted(71, 34) Source(132, 33) + SourceIndex(0) +10>Emitted(71, 35) Source(132, 34) + SourceIndex(0) +11>Emitted(71, 36) Source(132, 35) + SourceIndex(0) +12>Emitted(71, 37) Source(132, 36) + SourceIndex(0) +13>Emitted(71, 38) Source(132, 37) + SourceIndex(0) +14>Emitted(71, 39) Source(132, 38) + SourceIndex(0) --- >>>objc8.t9 = [[], []]; 1 > @@ -1734,17 +1735,17 @@ sourceFile:contextualTyping.ts 9 > [] 10> ] 11> ; -1 >Emitted(71, 1) Source(133, 1) + SourceIndex(0) -2 >Emitted(71, 6) Source(133, 6) + SourceIndex(0) -3 >Emitted(71, 7) Source(133, 7) + SourceIndex(0) -4 >Emitted(71, 9) Source(133, 9) + SourceIndex(0) -5 >Emitted(71, 12) Source(133, 12) + SourceIndex(0) -6 >Emitted(71, 13) Source(133, 13) + SourceIndex(0) -7 >Emitted(71, 15) Source(133, 15) + SourceIndex(0) -8 >Emitted(71, 17) Source(133, 16) + SourceIndex(0) -9 >Emitted(71, 19) Source(133, 18) + SourceIndex(0) -10>Emitted(71, 20) Source(133, 19) + SourceIndex(0) -11>Emitted(71, 21) Source(133, 20) + SourceIndex(0) +1 >Emitted(72, 1) Source(133, 1) + SourceIndex(0) +2 >Emitted(72, 6) Source(133, 6) + SourceIndex(0) +3 >Emitted(72, 7) Source(133, 7) + SourceIndex(0) +4 >Emitted(72, 9) Source(133, 9) + SourceIndex(0) +5 >Emitted(72, 12) Source(133, 12) + SourceIndex(0) +6 >Emitted(72, 13) Source(133, 13) + SourceIndex(0) +7 >Emitted(72, 15) Source(133, 15) + SourceIndex(0) +8 >Emitted(72, 17) Source(133, 16) + SourceIndex(0) +9 >Emitted(72, 19) Source(133, 18) + SourceIndex(0) +10>Emitted(72, 20) Source(133, 19) + SourceIndex(0) +11>Emitted(72, 21) Source(133, 20) + SourceIndex(0) --- >>>objc8.t10 = [({}), ({})]; 1-> @@ -1779,21 +1780,21 @@ sourceFile:contextualTyping.ts 13> ) 14> ] 15> ; -1->Emitted(72, 1) Source(134, 1) + SourceIndex(0) -2 >Emitted(72, 6) Source(134, 6) + SourceIndex(0) -3 >Emitted(72, 7) Source(134, 7) + SourceIndex(0) -4 >Emitted(72, 10) Source(134, 10) + SourceIndex(0) -5 >Emitted(72, 13) Source(134, 13) + SourceIndex(0) -6 >Emitted(72, 14) Source(134, 20) + SourceIndex(0) -7 >Emitted(72, 15) Source(134, 21) + SourceIndex(0) -8 >Emitted(72, 17) Source(134, 23) + SourceIndex(0) -9 >Emitted(72, 18) Source(134, 24) + SourceIndex(0) -10>Emitted(72, 20) Source(134, 31) + SourceIndex(0) -11>Emitted(72, 21) Source(134, 32) + SourceIndex(0) -12>Emitted(72, 23) Source(134, 34) + SourceIndex(0) -13>Emitted(72, 24) Source(134, 35) + SourceIndex(0) -14>Emitted(72, 25) Source(134, 36) + SourceIndex(0) -15>Emitted(72, 26) Source(134, 37) + SourceIndex(0) +1->Emitted(73, 1) Source(134, 1) + SourceIndex(0) +2 >Emitted(73, 6) Source(134, 6) + SourceIndex(0) +3 >Emitted(73, 7) Source(134, 7) + SourceIndex(0) +4 >Emitted(73, 10) Source(134, 10) + SourceIndex(0) +5 >Emitted(73, 13) Source(134, 13) + SourceIndex(0) +6 >Emitted(73, 14) Source(134, 20) + SourceIndex(0) +7 >Emitted(73, 15) Source(134, 21) + SourceIndex(0) +8 >Emitted(73, 17) Source(134, 23) + SourceIndex(0) +9 >Emitted(73, 18) Source(134, 24) + SourceIndex(0) +10>Emitted(73, 20) Source(134, 31) + SourceIndex(0) +11>Emitted(73, 21) Source(134, 32) + SourceIndex(0) +12>Emitted(73, 23) Source(134, 34) + SourceIndex(0) +13>Emitted(73, 24) Source(134, 35) + SourceIndex(0) +14>Emitted(73, 25) Source(134, 36) + SourceIndex(0) +15>Emitted(73, 26) Source(134, 37) + SourceIndex(0) --- >>>objc8.t11 = [function (n, s) { return s; }]; 1-> @@ -1833,24 +1834,24 @@ sourceFile:contextualTyping.ts 16> } 17> ] 18> ; -1->Emitted(73, 1) Source(135, 1) + SourceIndex(0) -2 >Emitted(73, 6) Source(135, 6) + SourceIndex(0) -3 >Emitted(73, 7) Source(135, 7) + SourceIndex(0) -4 >Emitted(73, 10) Source(135, 10) + SourceIndex(0) -5 >Emitted(73, 13) Source(135, 13) + SourceIndex(0) -6 >Emitted(73, 14) Source(135, 14) + SourceIndex(0) -7 >Emitted(73, 24) Source(135, 23) + SourceIndex(0) -8 >Emitted(73, 25) Source(135, 24) + SourceIndex(0) -9 >Emitted(73, 27) Source(135, 26) + SourceIndex(0) -10>Emitted(73, 28) Source(135, 27) + SourceIndex(0) -11>Emitted(73, 32) Source(135, 31) + SourceIndex(0) -12>Emitted(73, 39) Source(135, 38) + SourceIndex(0) -13>Emitted(73, 40) Source(135, 39) + SourceIndex(0) -14>Emitted(73, 41) Source(135, 40) + SourceIndex(0) -15>Emitted(73, 42) Source(135, 41) + SourceIndex(0) -16>Emitted(73, 43) Source(135, 42) + SourceIndex(0) -17>Emitted(73, 44) Source(135, 43) + SourceIndex(0) -18>Emitted(73, 45) Source(135, 44) + SourceIndex(0) +1->Emitted(74, 1) Source(135, 1) + SourceIndex(0) +2 >Emitted(74, 6) Source(135, 6) + SourceIndex(0) +3 >Emitted(74, 7) Source(135, 7) + SourceIndex(0) +4 >Emitted(74, 10) Source(135, 10) + SourceIndex(0) +5 >Emitted(74, 13) Source(135, 13) + SourceIndex(0) +6 >Emitted(74, 14) Source(135, 14) + SourceIndex(0) +7 >Emitted(74, 24) Source(135, 23) + SourceIndex(0) +8 >Emitted(74, 25) Source(135, 24) + SourceIndex(0) +9 >Emitted(74, 27) Source(135, 26) + SourceIndex(0) +10>Emitted(74, 28) Source(135, 27) + SourceIndex(0) +11>Emitted(74, 32) Source(135, 31) + SourceIndex(0) +12>Emitted(74, 39) Source(135, 38) + SourceIndex(0) +13>Emitted(74, 40) Source(135, 39) + SourceIndex(0) +14>Emitted(74, 41) Source(135, 40) + SourceIndex(0) +15>Emitted(74, 42) Source(135, 41) + SourceIndex(0) +16>Emitted(74, 43) Source(135, 42) + SourceIndex(0) +17>Emitted(74, 44) Source(135, 43) + SourceIndex(0) +18>Emitted(74, 45) Source(135, 44) + SourceIndex(0) --- >>>objc8.t12 = { 1 > @@ -1865,11 +1866,11 @@ sourceFile:contextualTyping.ts 3 > . 4 > t12 5 > = -1 >Emitted(74, 1) Source(136, 1) + SourceIndex(0) -2 >Emitted(74, 6) Source(136, 6) + SourceIndex(0) -3 >Emitted(74, 7) Source(136, 7) + SourceIndex(0) -4 >Emitted(74, 10) Source(136, 10) + SourceIndex(0) -5 >Emitted(74, 13) Source(136, 13) + SourceIndex(0) +1 >Emitted(75, 1) Source(136, 1) + SourceIndex(0) +2 >Emitted(75, 6) Source(136, 6) + SourceIndex(0) +3 >Emitted(75, 7) Source(136, 7) + SourceIndex(0) +4 >Emitted(75, 10) Source(136, 10) + SourceIndex(0) +5 >Emitted(75, 13) Source(136, 13) + SourceIndex(0) --- >>> foo: ({}) 1->^^^^ @@ -1885,12 +1886,12 @@ sourceFile:contextualTyping.ts 4 > ( 5 > {} 6 > ) -1->Emitted(75, 5) Source(137, 5) + SourceIndex(0) -2 >Emitted(75, 8) Source(137, 8) + SourceIndex(0) -3 >Emitted(75, 10) Source(137, 16) + SourceIndex(0) -4 >Emitted(75, 11) Source(137, 17) + SourceIndex(0) -5 >Emitted(75, 13) Source(137, 19) + SourceIndex(0) -6 >Emitted(75, 14) Source(137, 20) + SourceIndex(0) +1->Emitted(76, 5) Source(137, 5) + SourceIndex(0) +2 >Emitted(76, 8) Source(137, 8) + SourceIndex(0) +3 >Emitted(76, 10) Source(137, 16) + SourceIndex(0) +4 >Emitted(76, 11) Source(137, 17) + SourceIndex(0) +5 >Emitted(76, 13) Source(137, 19) + SourceIndex(0) +6 >Emitted(76, 14) Source(137, 20) + SourceIndex(0) --- >>>}; 1 >^ @@ -1899,8 +1900,8 @@ sourceFile:contextualTyping.ts 1 > >} 2 > -1 >Emitted(76, 2) Source(138, 2) + SourceIndex(0) -2 >Emitted(76, 3) Source(138, 2) + SourceIndex(0) +1 >Emitted(77, 2) Source(138, 2) + SourceIndex(0) +2 >Emitted(77, 3) Source(138, 2) + SourceIndex(0) --- >>>objc8.t13 = ({ 1-> @@ -1917,12 +1918,12 @@ sourceFile:contextualTyping.ts 4 > t13 5 > = 6 > ( -1->Emitted(77, 1) Source(139, 1) + SourceIndex(0) -2 >Emitted(77, 6) Source(139, 6) + SourceIndex(0) -3 >Emitted(77, 7) Source(139, 7) + SourceIndex(0) -4 >Emitted(77, 10) Source(139, 10) + SourceIndex(0) -5 >Emitted(77, 13) Source(139, 19) + SourceIndex(0) -6 >Emitted(77, 14) Source(139, 20) + SourceIndex(0) +1->Emitted(78, 1) Source(139, 1) + SourceIndex(0) +2 >Emitted(78, 6) Source(139, 6) + SourceIndex(0) +3 >Emitted(78, 7) Source(139, 7) + SourceIndex(0) +4 >Emitted(78, 10) Source(139, 10) + SourceIndex(0) +5 >Emitted(78, 13) Source(139, 19) + SourceIndex(0) +6 >Emitted(78, 14) Source(139, 20) + SourceIndex(0) --- >>> f: function (i, s) { return s; } 1->^^^^ @@ -1952,19 +1953,19 @@ sourceFile:contextualTyping.ts 11> ; 12> 13> } -1->Emitted(78, 5) Source(140, 5) + SourceIndex(0) -2 >Emitted(78, 6) Source(140, 6) + SourceIndex(0) -3 >Emitted(78, 8) Source(140, 8) + SourceIndex(0) -4 >Emitted(78, 18) Source(140, 17) + SourceIndex(0) -5 >Emitted(78, 19) Source(140, 18) + SourceIndex(0) -6 >Emitted(78, 21) Source(140, 20) + SourceIndex(0) -7 >Emitted(78, 22) Source(140, 21) + SourceIndex(0) -8 >Emitted(78, 26) Source(140, 25) + SourceIndex(0) -9 >Emitted(78, 33) Source(140, 32) + SourceIndex(0) -10>Emitted(78, 34) Source(140, 33) + SourceIndex(0) -11>Emitted(78, 35) Source(140, 34) + SourceIndex(0) -12>Emitted(78, 36) Source(140, 35) + SourceIndex(0) -13>Emitted(78, 37) Source(140, 36) + SourceIndex(0) +1->Emitted(79, 5) Source(140, 5) + SourceIndex(0) +2 >Emitted(79, 6) Source(140, 6) + SourceIndex(0) +3 >Emitted(79, 8) Source(140, 8) + SourceIndex(0) +4 >Emitted(79, 18) Source(140, 17) + SourceIndex(0) +5 >Emitted(79, 19) Source(140, 18) + SourceIndex(0) +6 >Emitted(79, 21) Source(140, 20) + SourceIndex(0) +7 >Emitted(79, 22) Source(140, 21) + SourceIndex(0) +8 >Emitted(79, 26) Source(140, 25) + SourceIndex(0) +9 >Emitted(79, 33) Source(140, 32) + SourceIndex(0) +10>Emitted(79, 34) Source(140, 33) + SourceIndex(0) +11>Emitted(79, 35) Source(140, 34) + SourceIndex(0) +12>Emitted(79, 36) Source(140, 35) + SourceIndex(0) +13>Emitted(79, 37) Source(140, 36) + SourceIndex(0) --- >>>}); 1 >^ @@ -1975,9 +1976,9 @@ sourceFile:contextualTyping.ts >} 2 > ) 3 > -1 >Emitted(79, 2) Source(141, 2) + SourceIndex(0) -2 >Emitted(79, 3) Source(141, 3) + SourceIndex(0) -3 >Emitted(79, 4) Source(141, 3) + SourceIndex(0) +1 >Emitted(80, 2) Source(141, 2) + SourceIndex(0) +2 >Emitted(80, 3) Source(141, 3) + SourceIndex(0) +3 >Emitted(80, 4) Source(141, 3) + SourceIndex(0) --- >>>objc8.t14 = ({ 1-> @@ -1993,12 +1994,12 @@ sourceFile:contextualTyping.ts 4 > t14 5 > = 6 > ( -1->Emitted(80, 1) Source(142, 1) + SourceIndex(0) -2 >Emitted(80, 6) Source(142, 6) + SourceIndex(0) -3 >Emitted(80, 7) Source(142, 7) + SourceIndex(0) -4 >Emitted(80, 10) Source(142, 10) + SourceIndex(0) -5 >Emitted(80, 13) Source(142, 19) + SourceIndex(0) -6 >Emitted(80, 14) Source(142, 20) + SourceIndex(0) +1->Emitted(81, 1) Source(142, 1) + SourceIndex(0) +2 >Emitted(81, 6) Source(142, 6) + SourceIndex(0) +3 >Emitted(81, 7) Source(142, 7) + SourceIndex(0) +4 >Emitted(81, 10) Source(142, 10) + SourceIndex(0) +5 >Emitted(81, 13) Source(142, 19) + SourceIndex(0) +6 >Emitted(81, 14) Source(142, 20) + SourceIndex(0) --- >>> a: [] 1 >^^^^ @@ -2010,10 +2011,10 @@ sourceFile:contextualTyping.ts 2 > a 3 > : 4 > [] -1 >Emitted(81, 5) Source(143, 5) + SourceIndex(0) -2 >Emitted(81, 6) Source(143, 6) + SourceIndex(0) -3 >Emitted(81, 8) Source(143, 8) + SourceIndex(0) -4 >Emitted(81, 10) Source(143, 10) + SourceIndex(0) +1 >Emitted(82, 5) Source(143, 5) + SourceIndex(0) +2 >Emitted(82, 6) Source(143, 6) + SourceIndex(0) +3 >Emitted(82, 8) Source(143, 8) + SourceIndex(0) +4 >Emitted(82, 10) Source(143, 10) + SourceIndex(0) --- >>>}); 1 >^ @@ -2024,9 +2025,9 @@ sourceFile:contextualTyping.ts >} 2 > ) 3 > -1 >Emitted(82, 2) Source(144, 2) + SourceIndex(0) -2 >Emitted(82, 3) Source(144, 3) + SourceIndex(0) -3 >Emitted(82, 4) Source(144, 3) + SourceIndex(0) +1 >Emitted(83, 2) Source(144, 2) + SourceIndex(0) +2 >Emitted(83, 3) Source(144, 3) + SourceIndex(0) +3 >Emitted(83, 4) Source(144, 3) + SourceIndex(0) --- >>>// CONTEXT: Function call 1-> @@ -2034,8 +2035,8 @@ sourceFile:contextualTyping.ts 1-> > 2 >// CONTEXT: Function call -1->Emitted(83, 1) Source(145, 1) + SourceIndex(0) -2 >Emitted(83, 26) Source(145, 26) + SourceIndex(0) +1->Emitted(84, 1) Source(145, 1) + SourceIndex(0) +2 >Emitted(84, 26) Source(145, 26) + SourceIndex(0) --- >>>function c9t5(f) { } 1 > @@ -2053,13 +2054,13 @@ sourceFile:contextualTyping.ts 5 > f: (n: number) => IFoo 6 > ) { 7 > } -1 >Emitted(84, 1) Source(146, 1) + SourceIndex(0) -2 >Emitted(84, 10) Source(146, 10) + SourceIndex(0) -3 >Emitted(84, 14) Source(146, 14) + SourceIndex(0) -4 >Emitted(84, 15) Source(146, 15) + SourceIndex(0) -5 >Emitted(84, 16) Source(146, 37) + SourceIndex(0) -6 >Emitted(84, 20) Source(146, 40) + SourceIndex(0) -7 >Emitted(84, 21) Source(146, 41) + SourceIndex(0) +1 >Emitted(85, 1) Source(146, 1) + SourceIndex(0) +2 >Emitted(85, 10) Source(146, 10) + SourceIndex(0) +3 >Emitted(85, 14) Source(146, 14) + SourceIndex(0) +4 >Emitted(85, 15) Source(146, 15) + SourceIndex(0) +5 >Emitted(85, 16) Source(146, 37) + SourceIndex(0) +6 >Emitted(85, 20) Source(146, 40) + SourceIndex(0) +7 >Emitted(85, 21) Source(146, 41) + SourceIndex(0) --- >>>; 1 > @@ -2067,8 +2068,8 @@ sourceFile:contextualTyping.ts 3 > ^^^^^^^^^^^^^^^^^^^-> 1 > 2 >; -1 >Emitted(85, 1) Source(146, 41) + SourceIndex(0) -2 >Emitted(85, 2) Source(146, 42) + SourceIndex(0) +1 >Emitted(86, 1) Source(146, 41) + SourceIndex(0) +2 >Emitted(86, 2) Source(146, 42) + SourceIndex(0) --- >>>c9t5(function (n) { 1-> @@ -2083,11 +2084,11 @@ sourceFile:contextualTyping.ts 3 > ( 4 > function( 5 > n -1->Emitted(86, 1) Source(147, 1) + SourceIndex(0) -2 >Emitted(86, 5) Source(147, 5) + SourceIndex(0) -3 >Emitted(86, 6) Source(147, 6) + SourceIndex(0) -4 >Emitted(86, 16) Source(147, 15) + SourceIndex(0) -5 >Emitted(86, 17) Source(147, 16) + SourceIndex(0) +1->Emitted(87, 1) Source(147, 1) + SourceIndex(0) +2 >Emitted(87, 5) Source(147, 5) + SourceIndex(0) +3 >Emitted(87, 6) Source(147, 6) + SourceIndex(0) +4 >Emitted(87, 16) Source(147, 15) + SourceIndex(0) +5 >Emitted(87, 17) Source(147, 16) + SourceIndex(0) --- >>> return ({}); 1->^^^^ @@ -2103,12 +2104,12 @@ sourceFile:contextualTyping.ts 4 > {} 5 > ) 6 > ; -1->Emitted(87, 5) Source(148, 5) + SourceIndex(0) -2 >Emitted(87, 12) Source(148, 18) + SourceIndex(0) -3 >Emitted(87, 13) Source(148, 19) + SourceIndex(0) -4 >Emitted(87, 15) Source(148, 21) + SourceIndex(0) -5 >Emitted(87, 16) Source(148, 22) + SourceIndex(0) -6 >Emitted(87, 17) Source(148, 23) + SourceIndex(0) +1->Emitted(88, 5) Source(148, 5) + SourceIndex(0) +2 >Emitted(88, 12) Source(148, 18) + SourceIndex(0) +3 >Emitted(88, 13) Source(148, 19) + SourceIndex(0) +4 >Emitted(88, 15) Source(148, 21) + SourceIndex(0) +5 >Emitted(88, 16) Source(148, 22) + SourceIndex(0) +6 >Emitted(88, 17) Source(148, 23) + SourceIndex(0) --- >>>}); 1 > @@ -2121,10 +2122,10 @@ sourceFile:contextualTyping.ts 2 >} 3 > ) 4 > ; -1 >Emitted(88, 1) Source(149, 1) + SourceIndex(0) -2 >Emitted(88, 2) Source(149, 2) + SourceIndex(0) -3 >Emitted(88, 3) Source(149, 3) + SourceIndex(0) -4 >Emitted(88, 4) Source(149, 4) + SourceIndex(0) +1 >Emitted(89, 1) Source(149, 1) + SourceIndex(0) +2 >Emitted(89, 2) Source(149, 2) + SourceIndex(0) +3 >Emitted(89, 3) Source(149, 3) + SourceIndex(0) +4 >Emitted(89, 4) Source(149, 4) + SourceIndex(0) --- >>>// CONTEXT: Return statement 1-> @@ -2134,8 +2135,8 @@ sourceFile:contextualTyping.ts > > 2 >// CONTEXT: Return statement -1->Emitted(89, 1) Source(151, 1) + SourceIndex(0) -2 >Emitted(89, 29) Source(151, 29) + SourceIndex(0) +1->Emitted(90, 1) Source(151, 1) + SourceIndex(0) +2 >Emitted(90, 29) Source(151, 29) + SourceIndex(0) --- >>>var c10t5 = function () { return function (n) { return ({}); }; }; 1-> @@ -2179,26 +2180,26 @@ sourceFile:contextualTyping.ts 18> 19> } 20> ; -1->Emitted(90, 1) Source(152, 1) + SourceIndex(0) -2 >Emitted(90, 5) Source(152, 5) + SourceIndex(0) -3 >Emitted(90, 10) Source(152, 10) + SourceIndex(0) -4 >Emitted(90, 13) Source(152, 40) + SourceIndex(0) -5 >Emitted(90, 27) Source(152, 53) + SourceIndex(0) -6 >Emitted(90, 34) Source(152, 60) + SourceIndex(0) -7 >Emitted(90, 44) Source(152, 69) + SourceIndex(0) -8 >Emitted(90, 45) Source(152, 70) + SourceIndex(0) -9 >Emitted(90, 49) Source(152, 74) + SourceIndex(0) -10>Emitted(90, 56) Source(152, 87) + SourceIndex(0) -11>Emitted(90, 57) Source(152, 88) + SourceIndex(0) -12>Emitted(90, 59) Source(152, 90) + SourceIndex(0) -13>Emitted(90, 60) Source(152, 91) + SourceIndex(0) -14>Emitted(90, 61) Source(152, 91) + SourceIndex(0) -15>Emitted(90, 62) Source(152, 92) + SourceIndex(0) -16>Emitted(90, 63) Source(152, 93) + SourceIndex(0) -17>Emitted(90, 64) Source(152, 93) + SourceIndex(0) -18>Emitted(90, 65) Source(152, 94) + SourceIndex(0) -19>Emitted(90, 66) Source(152, 95) + SourceIndex(0) -20>Emitted(90, 67) Source(152, 96) + SourceIndex(0) +1->Emitted(91, 1) Source(152, 1) + SourceIndex(0) +2 >Emitted(91, 5) Source(152, 5) + SourceIndex(0) +3 >Emitted(91, 10) Source(152, 10) + SourceIndex(0) +4 >Emitted(91, 13) Source(152, 40) + SourceIndex(0) +5 >Emitted(91, 27) Source(152, 53) + SourceIndex(0) +6 >Emitted(91, 34) Source(152, 60) + SourceIndex(0) +7 >Emitted(91, 44) Source(152, 69) + SourceIndex(0) +8 >Emitted(91, 45) Source(152, 70) + SourceIndex(0) +9 >Emitted(91, 49) Source(152, 74) + SourceIndex(0) +10>Emitted(91, 56) Source(152, 87) + SourceIndex(0) +11>Emitted(91, 57) Source(152, 88) + SourceIndex(0) +12>Emitted(91, 59) Source(152, 90) + SourceIndex(0) +13>Emitted(91, 60) Source(152, 91) + SourceIndex(0) +14>Emitted(91, 61) Source(152, 91) + SourceIndex(0) +15>Emitted(91, 62) Source(152, 92) + SourceIndex(0) +16>Emitted(91, 63) Source(152, 93) + SourceIndex(0) +17>Emitted(91, 64) Source(152, 93) + SourceIndex(0) +18>Emitted(91, 65) Source(152, 94) + SourceIndex(0) +19>Emitted(91, 66) Source(152, 95) + SourceIndex(0) +20>Emitted(91, 67) Source(152, 96) + SourceIndex(0) --- >>>// CONTEXT: Newing a class 1 > @@ -2207,8 +2208,8 @@ sourceFile:contextualTyping.ts > > 2 >// CONTEXT: Newing a class -1 >Emitted(91, 1) Source(154, 1) + SourceIndex(0) -2 >Emitted(91, 27) Source(154, 27) + SourceIndex(0) +1 >Emitted(92, 1) Source(154, 1) + SourceIndex(0) +2 >Emitted(92, 27) Source(154, 27) + SourceIndex(0) --- >>>class C11t5 { 1 > @@ -2219,9 +2220,9 @@ sourceFile:contextualTyping.ts > 2 >class 3 > C11t5 -1 >Emitted(92, 1) Source(155, 1) + SourceIndex(0) -2 >Emitted(92, 7) Source(155, 7) + SourceIndex(0) -3 >Emitted(92, 12) Source(155, 12) + SourceIndex(0) +1 >Emitted(93, 1) Source(155, 1) + SourceIndex(0) +2 >Emitted(93, 7) Source(155, 7) + SourceIndex(0) +3 >Emitted(93, 12) Source(155, 12) + SourceIndex(0) --- >>> constructor(f) { } 1->^^^^ @@ -2234,17 +2235,17 @@ sourceFile:contextualTyping.ts 3 > f: (n: number) => IFoo 4 > ) { 5 > } -1->Emitted(93, 5) Source(155, 15) + SourceIndex(0) -2 >Emitted(93, 17) Source(155, 27) + SourceIndex(0) -3 >Emitted(93, 18) Source(155, 49) + SourceIndex(0) -4 >Emitted(93, 22) Source(155, 53) + SourceIndex(0) -5 >Emitted(93, 23) Source(155, 54) + SourceIndex(0) +1->Emitted(94, 5) Source(155, 15) + SourceIndex(0) +2 >Emitted(94, 17) Source(155, 27) + SourceIndex(0) +3 >Emitted(94, 18) Source(155, 49) + SourceIndex(0) +4 >Emitted(94, 22) Source(155, 53) + SourceIndex(0) +5 >Emitted(94, 23) Source(155, 54) + SourceIndex(0) --- >>>} 1 >^ 2 > ^-> 1 > } -1 >Emitted(94, 2) Source(155, 56) + SourceIndex(0) +1 >Emitted(95, 2) Source(155, 56) + SourceIndex(0) --- >>>; 1-> @@ -2252,8 +2253,8 @@ sourceFile:contextualTyping.ts 3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> 2 >; -1->Emitted(95, 1) Source(155, 56) + SourceIndex(0) -2 >Emitted(95, 2) Source(155, 57) + SourceIndex(0) +1->Emitted(96, 1) Source(155, 56) + SourceIndex(0) +2 >Emitted(96, 2) Source(155, 57) + SourceIndex(0) --- >>>var i = new C11t5(function (n) { return ({}); }); 1-> @@ -2295,25 +2296,25 @@ sourceFile:contextualTyping.ts 17> } 18> ) 19> ; -1->Emitted(96, 1) Source(156, 1) + SourceIndex(0) -2 >Emitted(96, 5) Source(156, 5) + SourceIndex(0) -3 >Emitted(96, 6) Source(156, 6) + SourceIndex(0) -4 >Emitted(96, 9) Source(156, 9) + SourceIndex(0) -5 >Emitted(96, 13) Source(156, 13) + SourceIndex(0) -6 >Emitted(96, 18) Source(156, 18) + SourceIndex(0) -7 >Emitted(96, 19) Source(156, 19) + SourceIndex(0) -8 >Emitted(96, 29) Source(156, 28) + SourceIndex(0) -9 >Emitted(96, 30) Source(156, 29) + SourceIndex(0) -10>Emitted(96, 34) Source(156, 33) + SourceIndex(0) -11>Emitted(96, 41) Source(156, 46) + SourceIndex(0) -12>Emitted(96, 42) Source(156, 47) + SourceIndex(0) -13>Emitted(96, 44) Source(156, 49) + SourceIndex(0) -14>Emitted(96, 45) Source(156, 50) + SourceIndex(0) -15>Emitted(96, 46) Source(156, 50) + SourceIndex(0) -16>Emitted(96, 47) Source(156, 51) + SourceIndex(0) -17>Emitted(96, 48) Source(156, 52) + SourceIndex(0) -18>Emitted(96, 49) Source(156, 53) + SourceIndex(0) -19>Emitted(96, 50) Source(156, 54) + SourceIndex(0) +1->Emitted(97, 1) Source(156, 1) + SourceIndex(0) +2 >Emitted(97, 5) Source(156, 5) + SourceIndex(0) +3 >Emitted(97, 6) Source(156, 6) + SourceIndex(0) +4 >Emitted(97, 9) Source(156, 9) + SourceIndex(0) +5 >Emitted(97, 13) Source(156, 13) + SourceIndex(0) +6 >Emitted(97, 18) Source(156, 18) + SourceIndex(0) +7 >Emitted(97, 19) Source(156, 19) + SourceIndex(0) +8 >Emitted(97, 29) Source(156, 28) + SourceIndex(0) +9 >Emitted(97, 30) Source(156, 29) + SourceIndex(0) +10>Emitted(97, 34) Source(156, 33) + SourceIndex(0) +11>Emitted(97, 41) Source(156, 46) + SourceIndex(0) +12>Emitted(97, 42) Source(156, 47) + SourceIndex(0) +13>Emitted(97, 44) Source(156, 49) + SourceIndex(0) +14>Emitted(97, 45) Source(156, 50) + SourceIndex(0) +15>Emitted(97, 46) Source(156, 50) + SourceIndex(0) +16>Emitted(97, 47) Source(156, 51) + SourceIndex(0) +17>Emitted(97, 48) Source(156, 52) + SourceIndex(0) +18>Emitted(97, 49) Source(156, 53) + SourceIndex(0) +19>Emitted(97, 50) Source(156, 54) + SourceIndex(0) --- >>>// CONTEXT: Type annotated expression 1 > @@ -2323,8 +2324,8 @@ sourceFile:contextualTyping.ts > > 2 >// CONTEXT: Type annotated expression -1 >Emitted(97, 1) Source(158, 1) + SourceIndex(0) -2 >Emitted(97, 38) Source(158, 38) + SourceIndex(0) +1 >Emitted(98, 1) Source(158, 1) + SourceIndex(0) +2 >Emitted(98, 38) Source(158, 38) + SourceIndex(0) --- >>>var c12t1 = (function (s) { return s; }); 1-> @@ -2358,21 +2359,21 @@ sourceFile:contextualTyping.ts 13> } 14> ) 15> ; -1->Emitted(98, 1) Source(159, 1) + SourceIndex(0) -2 >Emitted(98, 5) Source(159, 5) + SourceIndex(0) -3 >Emitted(98, 10) Source(159, 10) + SourceIndex(0) -4 >Emitted(98, 13) Source(159, 37) + SourceIndex(0) -5 >Emitted(98, 14) Source(159, 38) + SourceIndex(0) -6 >Emitted(98, 24) Source(159, 47) + SourceIndex(0) -7 >Emitted(98, 25) Source(159, 48) + SourceIndex(0) -8 >Emitted(98, 29) Source(159, 52) + SourceIndex(0) -9 >Emitted(98, 36) Source(159, 59) + SourceIndex(0) -10>Emitted(98, 37) Source(159, 60) + SourceIndex(0) -11>Emitted(98, 38) Source(159, 60) + SourceIndex(0) -12>Emitted(98, 39) Source(159, 61) + SourceIndex(0) -13>Emitted(98, 40) Source(159, 62) + SourceIndex(0) -14>Emitted(98, 41) Source(159, 63) + SourceIndex(0) -15>Emitted(98, 42) Source(159, 64) + SourceIndex(0) +1->Emitted(99, 1) Source(159, 1) + SourceIndex(0) +2 >Emitted(99, 5) Source(159, 5) + SourceIndex(0) +3 >Emitted(99, 10) Source(159, 10) + SourceIndex(0) +4 >Emitted(99, 13) Source(159, 37) + SourceIndex(0) +5 >Emitted(99, 14) Source(159, 38) + SourceIndex(0) +6 >Emitted(99, 24) Source(159, 47) + SourceIndex(0) +7 >Emitted(99, 25) Source(159, 48) + SourceIndex(0) +8 >Emitted(99, 29) Source(159, 52) + SourceIndex(0) +9 >Emitted(99, 36) Source(159, 59) + SourceIndex(0) +10>Emitted(99, 37) Source(159, 60) + SourceIndex(0) +11>Emitted(99, 38) Source(159, 60) + SourceIndex(0) +12>Emitted(99, 39) Source(159, 61) + SourceIndex(0) +13>Emitted(99, 40) Source(159, 62) + SourceIndex(0) +14>Emitted(99, 41) Source(159, 63) + SourceIndex(0) +15>Emitted(99, 42) Source(159, 64) + SourceIndex(0) --- >>>var c12t2 = ({ 1 > @@ -2386,11 +2387,11 @@ sourceFile:contextualTyping.ts 3 > c12t2 4 > = 5 > ( -1 >Emitted(99, 1) Source(160, 1) + SourceIndex(0) -2 >Emitted(99, 5) Source(160, 5) + SourceIndex(0) -3 >Emitted(99, 10) Source(160, 10) + SourceIndex(0) -4 >Emitted(99, 13) Source(160, 20) + SourceIndex(0) -5 >Emitted(99, 14) Source(160, 21) + SourceIndex(0) +1 >Emitted(100, 1) Source(160, 1) + SourceIndex(0) +2 >Emitted(100, 5) Source(160, 5) + SourceIndex(0) +3 >Emitted(100, 10) Source(160, 10) + SourceIndex(0) +4 >Emitted(100, 13) Source(160, 20) + SourceIndex(0) +5 >Emitted(100, 14) Source(160, 21) + SourceIndex(0) --- >>> n: 1 1 >^^^^ @@ -2402,10 +2403,10 @@ sourceFile:contextualTyping.ts 2 > n 3 > : 4 > 1 -1 >Emitted(100, 5) Source(161, 5) + SourceIndex(0) -2 >Emitted(100, 6) Source(161, 6) + SourceIndex(0) -3 >Emitted(100, 8) Source(161, 8) + SourceIndex(0) -4 >Emitted(100, 9) Source(161, 9) + SourceIndex(0) +1 >Emitted(101, 5) Source(161, 5) + SourceIndex(0) +2 >Emitted(101, 6) Source(161, 6) + SourceIndex(0) +3 >Emitted(101, 8) Source(161, 8) + SourceIndex(0) +4 >Emitted(101, 9) Source(161, 9) + SourceIndex(0) --- >>>}); 1 >^ @@ -2416,9 +2417,9 @@ sourceFile:contextualTyping.ts >} 2 > ) 3 > ; -1 >Emitted(101, 2) Source(162, 2) + SourceIndex(0) -2 >Emitted(101, 3) Source(162, 3) + SourceIndex(0) -3 >Emitted(101, 4) Source(162, 4) + SourceIndex(0) +1 >Emitted(102, 2) Source(162, 2) + SourceIndex(0) +2 >Emitted(102, 3) Source(162, 3) + SourceIndex(0) +3 >Emitted(102, 4) Source(162, 4) + SourceIndex(0) --- >>>var c12t3 = []; 1-> @@ -2435,12 +2436,12 @@ sourceFile:contextualTyping.ts 4 > = 5 > [] 6 > ; -1->Emitted(102, 1) Source(163, 1) + SourceIndex(0) -2 >Emitted(102, 5) Source(163, 5) + SourceIndex(0) -3 >Emitted(102, 10) Source(163, 10) + SourceIndex(0) -4 >Emitted(102, 13) Source(163, 24) + SourceIndex(0) -5 >Emitted(102, 15) Source(163, 26) + SourceIndex(0) -6 >Emitted(102, 16) Source(163, 27) + SourceIndex(0) +1->Emitted(103, 1) Source(163, 1) + SourceIndex(0) +2 >Emitted(103, 5) Source(163, 5) + SourceIndex(0) +3 >Emitted(103, 10) Source(163, 10) + SourceIndex(0) +4 >Emitted(103, 13) Source(163, 24) + SourceIndex(0) +5 >Emitted(103, 15) Source(163, 26) + SourceIndex(0) +6 >Emitted(103, 16) Source(163, 27) + SourceIndex(0) --- >>>var c12t4 = function () { return ({}); }; 1-> @@ -2471,19 +2472,19 @@ sourceFile:contextualTyping.ts 11> 12> } 13> ; -1->Emitted(103, 1) Source(164, 1) + SourceIndex(0) -2 >Emitted(103, 5) Source(164, 5) + SourceIndex(0) -3 >Emitted(103, 10) Source(164, 10) + SourceIndex(0) -4 >Emitted(103, 13) Source(164, 26) + SourceIndex(0) -5 >Emitted(103, 27) Source(164, 39) + SourceIndex(0) -6 >Emitted(103, 34) Source(164, 52) + SourceIndex(0) -7 >Emitted(103, 35) Source(164, 53) + SourceIndex(0) -8 >Emitted(103, 37) Source(164, 55) + SourceIndex(0) -9 >Emitted(103, 38) Source(164, 56) + SourceIndex(0) -10>Emitted(103, 39) Source(164, 56) + SourceIndex(0) -11>Emitted(103, 40) Source(164, 57) + SourceIndex(0) -12>Emitted(103, 41) Source(164, 58) + SourceIndex(0) -13>Emitted(103, 42) Source(164, 59) + SourceIndex(0) +1->Emitted(104, 1) Source(164, 1) + SourceIndex(0) +2 >Emitted(104, 5) Source(164, 5) + SourceIndex(0) +3 >Emitted(104, 10) Source(164, 10) + SourceIndex(0) +4 >Emitted(104, 13) Source(164, 26) + SourceIndex(0) +5 >Emitted(104, 27) Source(164, 39) + SourceIndex(0) +6 >Emitted(104, 34) Source(164, 52) + SourceIndex(0) +7 >Emitted(104, 35) Source(164, 53) + SourceIndex(0) +8 >Emitted(104, 37) Source(164, 55) + SourceIndex(0) +9 >Emitted(104, 38) Source(164, 56) + SourceIndex(0) +10>Emitted(104, 39) Source(164, 56) + SourceIndex(0) +11>Emitted(104, 40) Source(164, 57) + SourceIndex(0) +12>Emitted(104, 41) Source(164, 58) + SourceIndex(0) +13>Emitted(104, 42) Source(164, 59) + SourceIndex(0) --- >>>var c12t5 = function (n) { return ({}); }; 1-> @@ -2518,21 +2519,21 @@ sourceFile:contextualTyping.ts 13> 14> } 15> ; -1->Emitted(104, 1) Source(165, 1) + SourceIndex(0) -2 >Emitted(104, 5) Source(165, 5) + SourceIndex(0) -3 >Emitted(104, 10) Source(165, 10) + SourceIndex(0) -4 >Emitted(104, 13) Source(165, 35) + SourceIndex(0) -5 >Emitted(104, 23) Source(165, 44) + SourceIndex(0) -6 >Emitted(104, 24) Source(165, 45) + SourceIndex(0) -7 >Emitted(104, 28) Source(165, 49) + SourceIndex(0) -8 >Emitted(104, 35) Source(165, 62) + SourceIndex(0) -9 >Emitted(104, 36) Source(165, 63) + SourceIndex(0) -10>Emitted(104, 38) Source(165, 65) + SourceIndex(0) -11>Emitted(104, 39) Source(165, 66) + SourceIndex(0) -12>Emitted(104, 40) Source(165, 66) + SourceIndex(0) -13>Emitted(104, 41) Source(165, 67) + SourceIndex(0) -14>Emitted(104, 42) Source(165, 68) + SourceIndex(0) -15>Emitted(104, 43) Source(165, 69) + SourceIndex(0) +1->Emitted(105, 1) Source(165, 1) + SourceIndex(0) +2 >Emitted(105, 5) Source(165, 5) + SourceIndex(0) +3 >Emitted(105, 10) Source(165, 10) + SourceIndex(0) +4 >Emitted(105, 13) Source(165, 35) + SourceIndex(0) +5 >Emitted(105, 23) Source(165, 44) + SourceIndex(0) +6 >Emitted(105, 24) Source(165, 45) + SourceIndex(0) +7 >Emitted(105, 28) Source(165, 49) + SourceIndex(0) +8 >Emitted(105, 35) Source(165, 62) + SourceIndex(0) +9 >Emitted(105, 36) Source(165, 63) + SourceIndex(0) +10>Emitted(105, 38) Source(165, 65) + SourceIndex(0) +11>Emitted(105, 39) Source(165, 66) + SourceIndex(0) +12>Emitted(105, 40) Source(165, 66) + SourceIndex(0) +13>Emitted(105, 41) Source(165, 67) + SourceIndex(0) +14>Emitted(105, 42) Source(165, 68) + SourceIndex(0) +15>Emitted(105, 43) Source(165, 69) + SourceIndex(0) --- >>>var c12t6 = function (n, s) { return ({}); }; 1-> @@ -2570,23 +2571,23 @@ sourceFile:contextualTyping.ts 15> 16> } 17> ; -1->Emitted(105, 1) Source(166, 1) + SourceIndex(0) -2 >Emitted(105, 5) Source(166, 5) + SourceIndex(0) -3 >Emitted(105, 10) Source(166, 10) + SourceIndex(0) -4 >Emitted(105, 13) Source(166, 46) + SourceIndex(0) -5 >Emitted(105, 23) Source(166, 55) + SourceIndex(0) -6 >Emitted(105, 24) Source(166, 56) + SourceIndex(0) -7 >Emitted(105, 26) Source(166, 58) + SourceIndex(0) -8 >Emitted(105, 27) Source(166, 59) + SourceIndex(0) -9 >Emitted(105, 31) Source(166, 63) + SourceIndex(0) -10>Emitted(105, 38) Source(166, 76) + SourceIndex(0) -11>Emitted(105, 39) Source(166, 77) + SourceIndex(0) -12>Emitted(105, 41) Source(166, 79) + SourceIndex(0) -13>Emitted(105, 42) Source(166, 80) + SourceIndex(0) -14>Emitted(105, 43) Source(166, 80) + SourceIndex(0) -15>Emitted(105, 44) Source(166, 81) + SourceIndex(0) -16>Emitted(105, 45) Source(166, 82) + SourceIndex(0) -17>Emitted(105, 46) Source(166, 83) + SourceIndex(0) +1->Emitted(106, 1) Source(166, 1) + SourceIndex(0) +2 >Emitted(106, 5) Source(166, 5) + SourceIndex(0) +3 >Emitted(106, 10) Source(166, 10) + SourceIndex(0) +4 >Emitted(106, 13) Source(166, 46) + SourceIndex(0) +5 >Emitted(106, 23) Source(166, 55) + SourceIndex(0) +6 >Emitted(106, 24) Source(166, 56) + SourceIndex(0) +7 >Emitted(106, 26) Source(166, 58) + SourceIndex(0) +8 >Emitted(106, 27) Source(166, 59) + SourceIndex(0) +9 >Emitted(106, 31) Source(166, 63) + SourceIndex(0) +10>Emitted(106, 38) Source(166, 76) + SourceIndex(0) +11>Emitted(106, 39) Source(166, 77) + SourceIndex(0) +12>Emitted(106, 41) Source(166, 79) + SourceIndex(0) +13>Emitted(106, 42) Source(166, 80) + SourceIndex(0) +14>Emitted(106, 43) Source(166, 80) + SourceIndex(0) +15>Emitted(106, 44) Source(166, 81) + SourceIndex(0) +16>Emitted(106, 45) Source(166, 82) + SourceIndex(0) +17>Emitted(106, 46) Source(166, 83) + SourceIndex(0) --- >>>var c12t7 = function (n) { return n; }; 1 > @@ -2620,19 +2621,19 @@ sourceFile:contextualTyping.ts 11> 12> } 13> ; -1 >Emitted(106, 1) Source(167, 1) + SourceIndex(0) -2 >Emitted(106, 5) Source(167, 5) + SourceIndex(0) -3 >Emitted(106, 10) Source(167, 10) + SourceIndex(0) -4 >Emitted(106, 13) Source(170, 4) + SourceIndex(0) -5 >Emitted(106, 23) Source(170, 13) + SourceIndex(0) -6 >Emitted(106, 24) Source(170, 21) + SourceIndex(0) -7 >Emitted(106, 28) Source(170, 25) + SourceIndex(0) -8 >Emitted(106, 35) Source(170, 32) + SourceIndex(0) -9 >Emitted(106, 36) Source(170, 33) + SourceIndex(0) -10>Emitted(106, 37) Source(170, 33) + SourceIndex(0) -11>Emitted(106, 38) Source(170, 34) + SourceIndex(0) -12>Emitted(106, 39) Source(170, 35) + SourceIndex(0) -13>Emitted(106, 40) Source(170, 36) + SourceIndex(0) +1 >Emitted(107, 1) Source(167, 1) + SourceIndex(0) +2 >Emitted(107, 5) Source(167, 5) + SourceIndex(0) +3 >Emitted(107, 10) Source(167, 10) + SourceIndex(0) +4 >Emitted(107, 13) Source(170, 4) + SourceIndex(0) +5 >Emitted(107, 23) Source(170, 13) + SourceIndex(0) +6 >Emitted(107, 24) Source(170, 21) + SourceIndex(0) +7 >Emitted(107, 28) Source(170, 25) + SourceIndex(0) +8 >Emitted(107, 35) Source(170, 32) + SourceIndex(0) +9 >Emitted(107, 36) Source(170, 33) + SourceIndex(0) +10>Emitted(107, 37) Source(170, 33) + SourceIndex(0) +11>Emitted(107, 38) Source(170, 34) + SourceIndex(0) +12>Emitted(107, 39) Source(170, 35) + SourceIndex(0) +13>Emitted(107, 40) Source(170, 36) + SourceIndex(0) --- >>>var c12t8 = function (n) { return n; }; 1-> @@ -2663,19 +2664,19 @@ sourceFile:contextualTyping.ts 11> 12> } 13> ; -1->Emitted(107, 1) Source(172, 1) + SourceIndex(0) -2 >Emitted(107, 5) Source(172, 5) + SourceIndex(0) -3 >Emitted(107, 10) Source(172, 10) + SourceIndex(0) -4 >Emitted(107, 13) Source(172, 48) + SourceIndex(0) -5 >Emitted(107, 23) Source(172, 57) + SourceIndex(0) -6 >Emitted(107, 24) Source(172, 58) + SourceIndex(0) -7 >Emitted(107, 28) Source(172, 62) + SourceIndex(0) -8 >Emitted(107, 35) Source(172, 69) + SourceIndex(0) -9 >Emitted(107, 36) Source(172, 70) + SourceIndex(0) -10>Emitted(107, 37) Source(172, 71) + SourceIndex(0) -11>Emitted(107, 38) Source(172, 72) + SourceIndex(0) -12>Emitted(107, 39) Source(172, 73) + SourceIndex(0) -13>Emitted(107, 40) Source(172, 74) + SourceIndex(0) +1->Emitted(108, 1) Source(172, 1) + SourceIndex(0) +2 >Emitted(108, 5) Source(172, 5) + SourceIndex(0) +3 >Emitted(108, 10) Source(172, 10) + SourceIndex(0) +4 >Emitted(108, 13) Source(172, 48) + SourceIndex(0) +5 >Emitted(108, 23) Source(172, 57) + SourceIndex(0) +6 >Emitted(108, 24) Source(172, 58) + SourceIndex(0) +7 >Emitted(108, 28) Source(172, 62) + SourceIndex(0) +8 >Emitted(108, 35) Source(172, 69) + SourceIndex(0) +9 >Emitted(108, 36) Source(172, 70) + SourceIndex(0) +10>Emitted(108, 37) Source(172, 71) + SourceIndex(0) +11>Emitted(108, 38) Source(172, 72) + SourceIndex(0) +12>Emitted(108, 39) Source(172, 73) + SourceIndex(0) +13>Emitted(108, 40) Source(172, 74) + SourceIndex(0) --- >>>var c12t9 = [[], []]; 1 > @@ -2700,16 +2701,16 @@ sourceFile:contextualTyping.ts 8 > [] 9 > ] 10> ; -1 >Emitted(108, 1) Source(173, 1) + SourceIndex(0) -2 >Emitted(108, 5) Source(173, 5) + SourceIndex(0) -3 >Emitted(108, 10) Source(173, 10) + SourceIndex(0) -4 >Emitted(108, 13) Source(173, 26) + SourceIndex(0) -5 >Emitted(108, 14) Source(173, 27) + SourceIndex(0) -6 >Emitted(108, 16) Source(173, 29) + SourceIndex(0) -7 >Emitted(108, 18) Source(173, 30) + SourceIndex(0) -8 >Emitted(108, 20) Source(173, 32) + SourceIndex(0) -9 >Emitted(108, 21) Source(173, 33) + SourceIndex(0) -10>Emitted(108, 22) Source(173, 34) + SourceIndex(0) +1 >Emitted(109, 1) Source(173, 1) + SourceIndex(0) +2 >Emitted(109, 5) Source(173, 5) + SourceIndex(0) +3 >Emitted(109, 10) Source(173, 10) + SourceIndex(0) +4 >Emitted(109, 13) Source(173, 26) + SourceIndex(0) +5 >Emitted(109, 14) Source(173, 27) + SourceIndex(0) +6 >Emitted(109, 16) Source(173, 29) + SourceIndex(0) +7 >Emitted(109, 18) Source(173, 30) + SourceIndex(0) +8 >Emitted(109, 20) Source(173, 32) + SourceIndex(0) +9 >Emitted(109, 21) Source(173, 33) + SourceIndex(0) +10>Emitted(109, 22) Source(173, 34) + SourceIndex(0) --- >>>var c12t10 = [({}), ({})]; 1-> @@ -2742,20 +2743,20 @@ sourceFile:contextualTyping.ts 12> ) 13> ] 14> ; -1->Emitted(109, 1) Source(174, 1) + SourceIndex(0) -2 >Emitted(109, 5) Source(174, 5) + SourceIndex(0) -3 >Emitted(109, 11) Source(174, 11) + SourceIndex(0) -4 >Emitted(109, 14) Source(174, 23) + SourceIndex(0) -5 >Emitted(109, 15) Source(174, 30) + SourceIndex(0) -6 >Emitted(109, 16) Source(174, 31) + SourceIndex(0) -7 >Emitted(109, 18) Source(174, 33) + SourceIndex(0) -8 >Emitted(109, 19) Source(174, 34) + SourceIndex(0) -9 >Emitted(109, 21) Source(174, 41) + SourceIndex(0) -10>Emitted(109, 22) Source(174, 42) + SourceIndex(0) -11>Emitted(109, 24) Source(174, 44) + SourceIndex(0) -12>Emitted(109, 25) Source(174, 45) + SourceIndex(0) -13>Emitted(109, 26) Source(174, 46) + SourceIndex(0) -14>Emitted(109, 27) Source(174, 47) + SourceIndex(0) +1->Emitted(110, 1) Source(174, 1) + SourceIndex(0) +2 >Emitted(110, 5) Source(174, 5) + SourceIndex(0) +3 >Emitted(110, 11) Source(174, 11) + SourceIndex(0) +4 >Emitted(110, 14) Source(174, 23) + SourceIndex(0) +5 >Emitted(110, 15) Source(174, 30) + SourceIndex(0) +6 >Emitted(110, 16) Source(174, 31) + SourceIndex(0) +7 >Emitted(110, 18) Source(174, 33) + SourceIndex(0) +8 >Emitted(110, 19) Source(174, 34) + SourceIndex(0) +9 >Emitted(110, 21) Source(174, 41) + SourceIndex(0) +10>Emitted(110, 22) Source(174, 42) + SourceIndex(0) +11>Emitted(110, 24) Source(174, 44) + SourceIndex(0) +12>Emitted(110, 25) Source(174, 45) + SourceIndex(0) +13>Emitted(110, 26) Source(174, 46) + SourceIndex(0) +14>Emitted(110, 27) Source(174, 47) + SourceIndex(0) --- >>>var c12t11 = [function (n, s) { return s; }]; 1-> @@ -2793,23 +2794,23 @@ sourceFile:contextualTyping.ts 15> } 16> ] 17> ; -1->Emitted(110, 1) Source(175, 1) + SourceIndex(0) -2 >Emitted(110, 5) Source(175, 5) + SourceIndex(0) -3 >Emitted(110, 11) Source(175, 11) + SourceIndex(0) -4 >Emitted(110, 14) Source(175, 52) + SourceIndex(0) -5 >Emitted(110, 15) Source(175, 53) + SourceIndex(0) -6 >Emitted(110, 25) Source(175, 62) + SourceIndex(0) -7 >Emitted(110, 26) Source(175, 63) + SourceIndex(0) -8 >Emitted(110, 28) Source(175, 65) + SourceIndex(0) -9 >Emitted(110, 29) Source(175, 66) + SourceIndex(0) -10>Emitted(110, 33) Source(175, 70) + SourceIndex(0) -11>Emitted(110, 40) Source(175, 77) + SourceIndex(0) -12>Emitted(110, 41) Source(175, 78) + SourceIndex(0) -13>Emitted(110, 42) Source(175, 79) + SourceIndex(0) -14>Emitted(110, 43) Source(175, 80) + SourceIndex(0) -15>Emitted(110, 44) Source(175, 81) + SourceIndex(0) -16>Emitted(110, 45) Source(175, 82) + SourceIndex(0) -17>Emitted(110, 46) Source(175, 83) + SourceIndex(0) +1->Emitted(111, 1) Source(175, 1) + SourceIndex(0) +2 >Emitted(111, 5) Source(175, 5) + SourceIndex(0) +3 >Emitted(111, 11) Source(175, 11) + SourceIndex(0) +4 >Emitted(111, 14) Source(175, 52) + SourceIndex(0) +5 >Emitted(111, 15) Source(175, 53) + SourceIndex(0) +6 >Emitted(111, 25) Source(175, 62) + SourceIndex(0) +7 >Emitted(111, 26) Source(175, 63) + SourceIndex(0) +8 >Emitted(111, 28) Source(175, 65) + SourceIndex(0) +9 >Emitted(111, 29) Source(175, 66) + SourceIndex(0) +10>Emitted(111, 33) Source(175, 70) + SourceIndex(0) +11>Emitted(111, 40) Source(175, 77) + SourceIndex(0) +12>Emitted(111, 41) Source(175, 78) + SourceIndex(0) +13>Emitted(111, 42) Source(175, 79) + SourceIndex(0) +14>Emitted(111, 43) Source(175, 80) + SourceIndex(0) +15>Emitted(111, 44) Source(175, 81) + SourceIndex(0) +16>Emitted(111, 45) Source(175, 82) + SourceIndex(0) +17>Emitted(111, 46) Source(175, 83) + SourceIndex(0) --- >>>var c12t12 = { 1 > @@ -2822,10 +2823,10 @@ sourceFile:contextualTyping.ts 2 >var 3 > c12t12 4 > = -1 >Emitted(111, 1) Source(176, 1) + SourceIndex(0) -2 >Emitted(111, 5) Source(176, 5) + SourceIndex(0) -3 >Emitted(111, 11) Source(176, 11) + SourceIndex(0) -4 >Emitted(111, 14) Source(176, 21) + SourceIndex(0) +1 >Emitted(112, 1) Source(176, 1) + SourceIndex(0) +2 >Emitted(112, 5) Source(176, 5) + SourceIndex(0) +3 >Emitted(112, 11) Source(176, 11) + SourceIndex(0) +4 >Emitted(112, 14) Source(176, 21) + SourceIndex(0) --- >>> foo: ({}) 1->^^^^ @@ -2841,12 +2842,12 @@ sourceFile:contextualTyping.ts 4 > ( 5 > {} 6 > ) -1->Emitted(112, 5) Source(177, 5) + SourceIndex(0) -2 >Emitted(112, 8) Source(177, 8) + SourceIndex(0) -3 >Emitted(112, 10) Source(177, 16) + SourceIndex(0) -4 >Emitted(112, 11) Source(177, 17) + SourceIndex(0) -5 >Emitted(112, 13) Source(177, 19) + SourceIndex(0) -6 >Emitted(112, 14) Source(177, 20) + SourceIndex(0) +1->Emitted(113, 5) Source(177, 5) + SourceIndex(0) +2 >Emitted(113, 8) Source(177, 8) + SourceIndex(0) +3 >Emitted(113, 10) Source(177, 16) + SourceIndex(0) +4 >Emitted(113, 11) Source(177, 17) + SourceIndex(0) +5 >Emitted(113, 13) Source(177, 19) + SourceIndex(0) +6 >Emitted(113, 14) Source(177, 20) + SourceIndex(0) --- >>>}; 1 >^ @@ -2855,8 +2856,8 @@ sourceFile:contextualTyping.ts 1 > >} 2 > -1 >Emitted(113, 2) Source(178, 2) + SourceIndex(0) -2 >Emitted(113, 3) Source(178, 2) + SourceIndex(0) +1 >Emitted(114, 2) Source(178, 2) + SourceIndex(0) +2 >Emitted(114, 3) Source(178, 2) + SourceIndex(0) --- >>>var c12t13 = ({ 1-> @@ -2871,11 +2872,11 @@ sourceFile:contextualTyping.ts 3 > c12t13 4 > = 5 > ( -1->Emitted(114, 1) Source(179, 1) + SourceIndex(0) -2 >Emitted(114, 5) Source(179, 5) + SourceIndex(0) -3 >Emitted(114, 11) Source(179, 11) + SourceIndex(0) -4 >Emitted(114, 14) Source(179, 21) + SourceIndex(0) -5 >Emitted(114, 15) Source(179, 22) + SourceIndex(0) +1->Emitted(115, 1) Source(179, 1) + SourceIndex(0) +2 >Emitted(115, 5) Source(179, 5) + SourceIndex(0) +3 >Emitted(115, 11) Source(179, 11) + SourceIndex(0) +4 >Emitted(115, 14) Source(179, 21) + SourceIndex(0) +5 >Emitted(115, 15) Source(179, 22) + SourceIndex(0) --- >>> f: function (i, s) { return s; } 1->^^^^ @@ -2905,19 +2906,19 @@ sourceFile:contextualTyping.ts 11> ; 12> 13> } -1->Emitted(115, 5) Source(180, 5) + SourceIndex(0) -2 >Emitted(115, 6) Source(180, 6) + SourceIndex(0) -3 >Emitted(115, 8) Source(180, 8) + SourceIndex(0) -4 >Emitted(115, 18) Source(180, 17) + SourceIndex(0) -5 >Emitted(115, 19) Source(180, 18) + SourceIndex(0) -6 >Emitted(115, 21) Source(180, 20) + SourceIndex(0) -7 >Emitted(115, 22) Source(180, 21) + SourceIndex(0) -8 >Emitted(115, 26) Source(180, 25) + SourceIndex(0) -9 >Emitted(115, 33) Source(180, 32) + SourceIndex(0) -10>Emitted(115, 34) Source(180, 33) + SourceIndex(0) -11>Emitted(115, 35) Source(180, 34) + SourceIndex(0) -12>Emitted(115, 36) Source(180, 35) + SourceIndex(0) -13>Emitted(115, 37) Source(180, 36) + SourceIndex(0) +1->Emitted(116, 5) Source(180, 5) + SourceIndex(0) +2 >Emitted(116, 6) Source(180, 6) + SourceIndex(0) +3 >Emitted(116, 8) Source(180, 8) + SourceIndex(0) +4 >Emitted(116, 18) Source(180, 17) + SourceIndex(0) +5 >Emitted(116, 19) Source(180, 18) + SourceIndex(0) +6 >Emitted(116, 21) Source(180, 20) + SourceIndex(0) +7 >Emitted(116, 22) Source(180, 21) + SourceIndex(0) +8 >Emitted(116, 26) Source(180, 25) + SourceIndex(0) +9 >Emitted(116, 33) Source(180, 32) + SourceIndex(0) +10>Emitted(116, 34) Source(180, 33) + SourceIndex(0) +11>Emitted(116, 35) Source(180, 34) + SourceIndex(0) +12>Emitted(116, 36) Source(180, 35) + SourceIndex(0) +13>Emitted(116, 37) Source(180, 36) + SourceIndex(0) --- >>>}); 1 >^ @@ -2928,9 +2929,9 @@ sourceFile:contextualTyping.ts >} 2 > ) 3 > -1 >Emitted(116, 2) Source(181, 2) + SourceIndex(0) -2 >Emitted(116, 3) Source(181, 3) + SourceIndex(0) -3 >Emitted(116, 4) Source(181, 3) + SourceIndex(0) +1 >Emitted(117, 2) Source(181, 2) + SourceIndex(0) +2 >Emitted(117, 3) Source(181, 3) + SourceIndex(0) +3 >Emitted(117, 4) Source(181, 3) + SourceIndex(0) --- >>>var c12t14 = ({ 1-> @@ -2944,11 +2945,11 @@ sourceFile:contextualTyping.ts 3 > c12t14 4 > = 5 > ( -1->Emitted(117, 1) Source(182, 1) + SourceIndex(0) -2 >Emitted(117, 5) Source(182, 5) + SourceIndex(0) -3 >Emitted(117, 11) Source(182, 11) + SourceIndex(0) -4 >Emitted(117, 14) Source(182, 21) + SourceIndex(0) -5 >Emitted(117, 15) Source(182, 22) + SourceIndex(0) +1->Emitted(118, 1) Source(182, 1) + SourceIndex(0) +2 >Emitted(118, 5) Source(182, 5) + SourceIndex(0) +3 >Emitted(118, 11) Source(182, 11) + SourceIndex(0) +4 >Emitted(118, 14) Source(182, 21) + SourceIndex(0) +5 >Emitted(118, 15) Source(182, 22) + SourceIndex(0) --- >>> a: [] 1 >^^^^ @@ -2960,10 +2961,10 @@ sourceFile:contextualTyping.ts 2 > a 3 > : 4 > [] -1 >Emitted(118, 5) Source(183, 5) + SourceIndex(0) -2 >Emitted(118, 6) Source(183, 6) + SourceIndex(0) -3 >Emitted(118, 8) Source(183, 8) + SourceIndex(0) -4 >Emitted(118, 10) Source(183, 10) + SourceIndex(0) +1 >Emitted(119, 5) Source(183, 5) + SourceIndex(0) +2 >Emitted(119, 6) Source(183, 6) + SourceIndex(0) +3 >Emitted(119, 8) Source(183, 8) + SourceIndex(0) +4 >Emitted(119, 10) Source(183, 10) + SourceIndex(0) --- >>>}); 1 >^ @@ -2974,9 +2975,9 @@ sourceFile:contextualTyping.ts >} 2 > ) 3 > -1 >Emitted(119, 2) Source(184, 2) + SourceIndex(0) -2 >Emitted(119, 3) Source(184, 3) + SourceIndex(0) -3 >Emitted(119, 4) Source(184, 3) + SourceIndex(0) +1 >Emitted(120, 2) Source(184, 2) + SourceIndex(0) +2 >Emitted(120, 3) Source(184, 3) + SourceIndex(0) +3 >Emitted(120, 4) Source(184, 3) + SourceIndex(0) --- >>>function EF1(a, b) { return a + b; } 1-> @@ -3016,21 +3017,21 @@ sourceFile:contextualTyping.ts 13> ; 14> 15> } -1->Emitted(120, 1) Source(191, 1) + SourceIndex(0) -2 >Emitted(120, 10) Source(191, 10) + SourceIndex(0) -3 >Emitted(120, 13) Source(191, 13) + SourceIndex(0) -4 >Emitted(120, 14) Source(191, 14) + SourceIndex(0) -5 >Emitted(120, 15) Source(191, 15) + SourceIndex(0) -6 >Emitted(120, 17) Source(191, 16) + SourceIndex(0) -7 >Emitted(120, 18) Source(191, 17) + SourceIndex(0) -8 >Emitted(120, 22) Source(191, 21) + SourceIndex(0) -9 >Emitted(120, 29) Source(191, 28) + SourceIndex(0) -10>Emitted(120, 30) Source(191, 29) + SourceIndex(0) -11>Emitted(120, 33) Source(191, 30) + SourceIndex(0) -12>Emitted(120, 34) Source(191, 31) + SourceIndex(0) -13>Emitted(120, 35) Source(191, 32) + SourceIndex(0) -14>Emitted(120, 36) Source(191, 33) + SourceIndex(0) -15>Emitted(120, 37) Source(191, 34) + SourceIndex(0) +1->Emitted(121, 1) Source(191, 1) + SourceIndex(0) +2 >Emitted(121, 10) Source(191, 10) + SourceIndex(0) +3 >Emitted(121, 13) Source(191, 13) + SourceIndex(0) +4 >Emitted(121, 14) Source(191, 14) + SourceIndex(0) +5 >Emitted(121, 15) Source(191, 15) + SourceIndex(0) +6 >Emitted(121, 17) Source(191, 16) + SourceIndex(0) +7 >Emitted(121, 18) Source(191, 17) + SourceIndex(0) +8 >Emitted(121, 22) Source(191, 21) + SourceIndex(0) +9 >Emitted(121, 29) Source(191, 28) + SourceIndex(0) +10>Emitted(121, 30) Source(191, 29) + SourceIndex(0) +11>Emitted(121, 33) Source(191, 30) + SourceIndex(0) +12>Emitted(121, 34) Source(191, 31) + SourceIndex(0) +13>Emitted(121, 35) Source(191, 32) + SourceIndex(0) +14>Emitted(121, 36) Source(191, 33) + SourceIndex(0) +15>Emitted(121, 37) Source(191, 34) + SourceIndex(0) --- >>>var efv = EF1(1, 2); 1 > @@ -3058,17 +3059,17 @@ sourceFile:contextualTyping.ts 9 > 2 10> ) 11> ; -1 >Emitted(121, 1) Source(193, 1) + SourceIndex(0) -2 >Emitted(121, 5) Source(193, 5) + SourceIndex(0) -3 >Emitted(121, 8) Source(193, 8) + SourceIndex(0) -4 >Emitted(121, 11) Source(193, 11) + SourceIndex(0) -5 >Emitted(121, 14) Source(193, 14) + SourceIndex(0) -6 >Emitted(121, 15) Source(193, 15) + SourceIndex(0) -7 >Emitted(121, 16) Source(193, 16) + SourceIndex(0) -8 >Emitted(121, 18) Source(193, 17) + SourceIndex(0) -9 >Emitted(121, 19) Source(193, 18) + SourceIndex(0) -10>Emitted(121, 20) Source(193, 19) + SourceIndex(0) -11>Emitted(121, 21) Source(193, 20) + SourceIndex(0) +1 >Emitted(122, 1) Source(193, 1) + SourceIndex(0) +2 >Emitted(122, 5) Source(193, 5) + SourceIndex(0) +3 >Emitted(122, 8) Source(193, 8) + SourceIndex(0) +4 >Emitted(122, 11) Source(193, 11) + SourceIndex(0) +5 >Emitted(122, 14) Source(193, 14) + SourceIndex(0) +6 >Emitted(122, 15) Source(193, 15) + SourceIndex(0) +7 >Emitted(122, 16) Source(193, 16) + SourceIndex(0) +8 >Emitted(122, 18) Source(193, 17) + SourceIndex(0) +9 >Emitted(122, 19) Source(193, 18) + SourceIndex(0) +10>Emitted(122, 20) Source(193, 19) + SourceIndex(0) +11>Emitted(122, 21) Source(193, 20) + SourceIndex(0) --- >>>Point.origin = new Point(0, 0); 1-> @@ -3112,19 +3113,19 @@ sourceFile:contextualTyping.ts 11> 0 12> ) 13> ; -1->Emitted(122, 1) Source(207, 1) + SourceIndex(0) -2 >Emitted(122, 6) Source(207, 6) + SourceIndex(0) -3 >Emitted(122, 7) Source(207, 7) + SourceIndex(0) -4 >Emitted(122, 13) Source(207, 13) + SourceIndex(0) -5 >Emitted(122, 16) Source(207, 16) + SourceIndex(0) -6 >Emitted(122, 20) Source(207, 20) + SourceIndex(0) -7 >Emitted(122, 25) Source(207, 25) + SourceIndex(0) -8 >Emitted(122, 26) Source(207, 26) + SourceIndex(0) -9 >Emitted(122, 27) Source(207, 27) + SourceIndex(0) -10>Emitted(122, 29) Source(207, 29) + SourceIndex(0) -11>Emitted(122, 30) Source(207, 30) + SourceIndex(0) -12>Emitted(122, 31) Source(207, 31) + SourceIndex(0) -13>Emitted(122, 32) Source(207, 32) + SourceIndex(0) +1->Emitted(123, 1) Source(207, 1) + SourceIndex(0) +2 >Emitted(123, 6) Source(207, 6) + SourceIndex(0) +3 >Emitted(123, 7) Source(207, 7) + SourceIndex(0) +4 >Emitted(123, 13) Source(207, 13) + SourceIndex(0) +5 >Emitted(123, 16) Source(207, 16) + SourceIndex(0) +6 >Emitted(123, 20) Source(207, 20) + SourceIndex(0) +7 >Emitted(123, 25) Source(207, 25) + SourceIndex(0) +8 >Emitted(123, 26) Source(207, 26) + SourceIndex(0) +9 >Emitted(123, 27) Source(207, 27) + SourceIndex(0) +10>Emitted(123, 29) Source(207, 29) + SourceIndex(0) +11>Emitted(123, 30) Source(207, 30) + SourceIndex(0) +12>Emitted(123, 31) Source(207, 31) + SourceIndex(0) +13>Emitted(123, 32) Source(207, 32) + SourceIndex(0) --- >>>Point.prototype.add = function (dx, dy) { 1-> @@ -3152,17 +3153,17 @@ sourceFile:contextualTyping.ts 9 > dx 10> , 11> dy -1->Emitted(123, 1) Source(209, 1) + SourceIndex(0) -2 >Emitted(123, 6) Source(209, 6) + SourceIndex(0) -3 >Emitted(123, 7) Source(209, 7) + SourceIndex(0) -4 >Emitted(123, 16) Source(209, 16) + SourceIndex(0) -5 >Emitted(123, 17) Source(209, 17) + SourceIndex(0) -6 >Emitted(123, 20) Source(209, 20) + SourceIndex(0) -7 >Emitted(123, 23) Source(209, 23) + SourceIndex(0) -8 >Emitted(123, 33) Source(209, 32) + SourceIndex(0) -9 >Emitted(123, 35) Source(209, 34) + SourceIndex(0) -10>Emitted(123, 37) Source(209, 36) + SourceIndex(0) -11>Emitted(123, 39) Source(209, 38) + SourceIndex(0) +1->Emitted(124, 1) Source(209, 1) + SourceIndex(0) +2 >Emitted(124, 6) Source(209, 6) + SourceIndex(0) +3 >Emitted(124, 7) Source(209, 7) + SourceIndex(0) +4 >Emitted(124, 16) Source(209, 16) + SourceIndex(0) +5 >Emitted(124, 17) Source(209, 17) + SourceIndex(0) +6 >Emitted(124, 20) Source(209, 20) + SourceIndex(0) +7 >Emitted(124, 23) Source(209, 23) + SourceIndex(0) +8 >Emitted(124, 33) Source(209, 32) + SourceIndex(0) +9 >Emitted(124, 35) Source(209, 34) + SourceIndex(0) +10>Emitted(124, 37) Source(209, 36) + SourceIndex(0) +11>Emitted(124, 39) Source(209, 38) + SourceIndex(0) --- >>> return new Point(this.x + dx, this.y + dy); 1->^^^^ @@ -3202,24 +3203,24 @@ sourceFile:contextualTyping.ts 16> dy 17> ) 18> ; -1->Emitted(124, 5) Source(210, 5) + SourceIndex(0) -2 >Emitted(124, 12) Source(210, 12) + SourceIndex(0) -3 >Emitted(124, 16) Source(210, 16) + SourceIndex(0) -4 >Emitted(124, 21) Source(210, 21) + SourceIndex(0) -5 >Emitted(124, 22) Source(210, 22) + SourceIndex(0) -6 >Emitted(124, 26) Source(210, 26) + SourceIndex(0) -7 >Emitted(124, 27) Source(210, 27) + SourceIndex(0) -8 >Emitted(124, 28) Source(210, 28) + SourceIndex(0) -9 >Emitted(124, 31) Source(210, 31) + SourceIndex(0) -10>Emitted(124, 33) Source(210, 33) + SourceIndex(0) -11>Emitted(124, 35) Source(210, 35) + SourceIndex(0) -12>Emitted(124, 39) Source(210, 39) + SourceIndex(0) -13>Emitted(124, 40) Source(210, 40) + SourceIndex(0) -14>Emitted(124, 41) Source(210, 41) + SourceIndex(0) -15>Emitted(124, 44) Source(210, 44) + SourceIndex(0) -16>Emitted(124, 46) Source(210, 46) + SourceIndex(0) -17>Emitted(124, 47) Source(210, 47) + SourceIndex(0) -18>Emitted(124, 48) Source(210, 48) + SourceIndex(0) +1->Emitted(125, 5) Source(210, 5) + SourceIndex(0) +2 >Emitted(125, 12) Source(210, 12) + SourceIndex(0) +3 >Emitted(125, 16) Source(210, 16) + SourceIndex(0) +4 >Emitted(125, 21) Source(210, 21) + SourceIndex(0) +5 >Emitted(125, 22) Source(210, 22) + SourceIndex(0) +6 >Emitted(125, 26) Source(210, 26) + SourceIndex(0) +7 >Emitted(125, 27) Source(210, 27) + SourceIndex(0) +8 >Emitted(125, 28) Source(210, 28) + SourceIndex(0) +9 >Emitted(125, 31) Source(210, 31) + SourceIndex(0) +10>Emitted(125, 33) Source(210, 33) + SourceIndex(0) +11>Emitted(125, 35) Source(210, 35) + SourceIndex(0) +12>Emitted(125, 39) Source(210, 39) + SourceIndex(0) +13>Emitted(125, 40) Source(210, 40) + SourceIndex(0) +14>Emitted(125, 41) Source(210, 41) + SourceIndex(0) +15>Emitted(125, 44) Source(210, 44) + SourceIndex(0) +16>Emitted(125, 46) Source(210, 46) + SourceIndex(0) +17>Emitted(125, 47) Source(210, 47) + SourceIndex(0) +18>Emitted(125, 48) Source(210, 48) + SourceIndex(0) --- >>>}; 1 > @@ -3230,9 +3231,9 @@ sourceFile:contextualTyping.ts > 2 >} 3 > ; -1 >Emitted(125, 1) Source(211, 1) + SourceIndex(0) -2 >Emitted(125, 2) Source(211, 2) + SourceIndex(0) -3 >Emitted(125, 3) Source(211, 3) + SourceIndex(0) +1 >Emitted(126, 1) Source(211, 1) + SourceIndex(0) +2 >Emitted(126, 2) Source(211, 2) + SourceIndex(0) +3 >Emitted(126, 3) Source(211, 3) + SourceIndex(0) --- >>>Point.prototype = { 1-> @@ -3247,11 +3248,11 @@ sourceFile:contextualTyping.ts 3 > . 4 > prototype 5 > = -1->Emitted(126, 1) Source(213, 1) + SourceIndex(0) -2 >Emitted(126, 6) Source(213, 6) + SourceIndex(0) -3 >Emitted(126, 7) Source(213, 7) + SourceIndex(0) -4 >Emitted(126, 16) Source(213, 16) + SourceIndex(0) -5 >Emitted(126, 19) Source(213, 19) + SourceIndex(0) +1->Emitted(127, 1) Source(213, 1) + SourceIndex(0) +2 >Emitted(127, 6) Source(213, 6) + SourceIndex(0) +3 >Emitted(127, 7) Source(213, 7) + SourceIndex(0) +4 >Emitted(127, 16) Source(213, 16) + SourceIndex(0) +5 >Emitted(127, 19) Source(213, 19) + SourceIndex(0) --- >>> x: 0, 1 >^^^^ @@ -3264,10 +3265,10 @@ sourceFile:contextualTyping.ts 2 > x 3 > : 4 > 0 -1 >Emitted(127, 5) Source(214, 5) + SourceIndex(0) -2 >Emitted(127, 6) Source(214, 6) + SourceIndex(0) -3 >Emitted(127, 8) Source(214, 8) + SourceIndex(0) -4 >Emitted(127, 9) Source(214, 9) + SourceIndex(0) +1 >Emitted(128, 5) Source(214, 5) + SourceIndex(0) +2 >Emitted(128, 6) Source(214, 6) + SourceIndex(0) +3 >Emitted(128, 8) Source(214, 8) + SourceIndex(0) +4 >Emitted(128, 9) Source(214, 9) + SourceIndex(0) --- >>> y: 0, 1->^^^^ @@ -3280,10 +3281,10 @@ sourceFile:contextualTyping.ts 2 > y 3 > : 4 > 0 -1->Emitted(128, 5) Source(215, 5) + SourceIndex(0) -2 >Emitted(128, 6) Source(215, 6) + SourceIndex(0) -3 >Emitted(128, 8) Source(215, 8) + SourceIndex(0) -4 >Emitted(128, 9) Source(215, 9) + SourceIndex(0) +1->Emitted(129, 5) Source(215, 5) + SourceIndex(0) +2 >Emitted(129, 6) Source(215, 6) + SourceIndex(0) +3 >Emitted(129, 8) Source(215, 8) + SourceIndex(0) +4 >Emitted(129, 9) Source(215, 9) + SourceIndex(0) --- >>> add: function (dx, dy) { 1->^^^^ @@ -3302,13 +3303,13 @@ sourceFile:contextualTyping.ts 5 > dx 6 > , 7 > dy -1->Emitted(129, 5) Source(216, 5) + SourceIndex(0) -2 >Emitted(129, 8) Source(216, 8) + SourceIndex(0) -3 >Emitted(129, 10) Source(216, 10) + SourceIndex(0) -4 >Emitted(129, 20) Source(216, 19) + SourceIndex(0) -5 >Emitted(129, 22) Source(216, 21) + SourceIndex(0) -6 >Emitted(129, 24) Source(216, 23) + SourceIndex(0) -7 >Emitted(129, 26) Source(216, 25) + SourceIndex(0) +1->Emitted(130, 5) Source(216, 5) + SourceIndex(0) +2 >Emitted(130, 8) Source(216, 8) + SourceIndex(0) +3 >Emitted(130, 10) Source(216, 10) + SourceIndex(0) +4 >Emitted(130, 20) Source(216, 19) + SourceIndex(0) +5 >Emitted(130, 22) Source(216, 21) + SourceIndex(0) +6 >Emitted(130, 24) Source(216, 23) + SourceIndex(0) +7 >Emitted(130, 26) Source(216, 25) + SourceIndex(0) --- >>> return new Point(this.x + dx, this.y + dy); 1->^^^^^^^^ @@ -3348,24 +3349,24 @@ sourceFile:contextualTyping.ts 16> dy 17> ) 18> ; -1->Emitted(130, 9) Source(217, 9) + SourceIndex(0) -2 >Emitted(130, 16) Source(217, 16) + SourceIndex(0) -3 >Emitted(130, 20) Source(217, 20) + SourceIndex(0) -4 >Emitted(130, 25) Source(217, 25) + SourceIndex(0) -5 >Emitted(130, 26) Source(217, 26) + SourceIndex(0) -6 >Emitted(130, 30) Source(217, 30) + SourceIndex(0) -7 >Emitted(130, 31) Source(217, 31) + SourceIndex(0) -8 >Emitted(130, 32) Source(217, 32) + SourceIndex(0) -9 >Emitted(130, 35) Source(217, 35) + SourceIndex(0) -10>Emitted(130, 37) Source(217, 37) + SourceIndex(0) -11>Emitted(130, 39) Source(217, 39) + SourceIndex(0) -12>Emitted(130, 43) Source(217, 43) + SourceIndex(0) -13>Emitted(130, 44) Source(217, 44) + SourceIndex(0) -14>Emitted(130, 45) Source(217, 45) + SourceIndex(0) -15>Emitted(130, 48) Source(217, 48) + SourceIndex(0) -16>Emitted(130, 50) Source(217, 50) + SourceIndex(0) -17>Emitted(130, 51) Source(217, 51) + SourceIndex(0) -18>Emitted(130, 52) Source(217, 52) + SourceIndex(0) +1->Emitted(131, 9) Source(217, 9) + SourceIndex(0) +2 >Emitted(131, 16) Source(217, 16) + SourceIndex(0) +3 >Emitted(131, 20) Source(217, 20) + SourceIndex(0) +4 >Emitted(131, 25) Source(217, 25) + SourceIndex(0) +5 >Emitted(131, 26) Source(217, 26) + SourceIndex(0) +6 >Emitted(131, 30) Source(217, 30) + SourceIndex(0) +7 >Emitted(131, 31) Source(217, 31) + SourceIndex(0) +8 >Emitted(131, 32) Source(217, 32) + SourceIndex(0) +9 >Emitted(131, 35) Source(217, 35) + SourceIndex(0) +10>Emitted(131, 37) Source(217, 37) + SourceIndex(0) +11>Emitted(131, 39) Source(217, 39) + SourceIndex(0) +12>Emitted(131, 43) Source(217, 43) + SourceIndex(0) +13>Emitted(131, 44) Source(217, 44) + SourceIndex(0) +14>Emitted(131, 45) Source(217, 45) + SourceIndex(0) +15>Emitted(131, 48) Source(217, 48) + SourceIndex(0) +16>Emitted(131, 50) Source(217, 50) + SourceIndex(0) +17>Emitted(131, 51) Source(217, 51) + SourceIndex(0) +18>Emitted(131, 52) Source(217, 52) + SourceIndex(0) --- >>> } 1 >^^^^ @@ -3373,8 +3374,8 @@ sourceFile:contextualTyping.ts 1 > > 2 > } -1 >Emitted(131, 5) Source(218, 5) + SourceIndex(0) -2 >Emitted(131, 6) Source(218, 6) + SourceIndex(0) +1 >Emitted(132, 5) Source(218, 5) + SourceIndex(0) +2 >Emitted(132, 6) Source(218, 6) + SourceIndex(0) --- >>>}; 1 >^ @@ -3383,8 +3384,8 @@ sourceFile:contextualTyping.ts 1 > >} 2 > ; -1 >Emitted(132, 2) Source(219, 2) + SourceIndex(0) -2 >Emitted(132, 3) Source(219, 3) + SourceIndex(0) +1 >Emitted(133, 2) Source(219, 2) + SourceIndex(0) +2 >Emitted(133, 3) Source(219, 3) + SourceIndex(0) --- >>>var x = {}; 1-> @@ -3404,11 +3405,11 @@ sourceFile:contextualTyping.ts 4 > : B = 5 > { } 6 > ; -1->Emitted(133, 1) Source(223, 1) + SourceIndex(0) -2 >Emitted(133, 5) Source(223, 5) + SourceIndex(0) -3 >Emitted(133, 6) Source(223, 6) + SourceIndex(0) -4 >Emitted(133, 9) Source(223, 12) + SourceIndex(0) -5 >Emitted(133, 11) Source(223, 15) + SourceIndex(0) -6 >Emitted(133, 12) Source(223, 16) + SourceIndex(0) +1->Emitted(134, 1) Source(223, 1) + SourceIndex(0) +2 >Emitted(134, 5) Source(223, 5) + SourceIndex(0) +3 >Emitted(134, 6) Source(223, 6) + SourceIndex(0) +4 >Emitted(134, 9) Source(223, 12) + SourceIndex(0) +5 >Emitted(134, 11) Source(223, 15) + SourceIndex(0) +6 >Emitted(134, 12) Source(223, 16) + SourceIndex(0) --- >>>//# sourceMappingURL=contextualTyping.js.map \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping1.js b/tests/baselines/reference/contextualTyping1.js index 75d3d042a3a27..2edaff0533c5a 100644 --- a/tests/baselines/reference/contextualTyping1.js +++ b/tests/baselines/reference/contextualTyping1.js @@ -4,4 +4,5 @@ var foo: {id:number;} = {id:4}; //// [contextualTyping1.js] +"use strict"; var foo = { id: 4 }; diff --git a/tests/baselines/reference/contextualTyping10.js b/tests/baselines/reference/contextualTyping10.js index b2082b978512a..1b230ccea8c6f 100644 --- a/tests/baselines/reference/contextualTyping10.js +++ b/tests/baselines/reference/contextualTyping10.js @@ -4,6 +4,7 @@ class foo { public bar:{id:number;}[] = [{id:1}, {id:2}]; } //// [contextualTyping10.js] +"use strict"; class foo { constructor() { this.bar = [{ id: 1 }, { id: 2 }]; diff --git a/tests/baselines/reference/contextualTyping11.js b/tests/baselines/reference/contextualTyping11.js index 28e8aa3390bd1..0c40c58feeab0 100644 --- a/tests/baselines/reference/contextualTyping11.js +++ b/tests/baselines/reference/contextualTyping11.js @@ -4,6 +4,7 @@ class foo { public bar:{id:number;}[] = [({})]; } //// [contextualTyping11.js] +"use strict"; class foo { constructor() { this.bar = [({})]; diff --git a/tests/baselines/reference/contextualTyping12.js b/tests/baselines/reference/contextualTyping12.js index f6ab119c8884a..ae808f79d6a73 100644 --- a/tests/baselines/reference/contextualTyping12.js +++ b/tests/baselines/reference/contextualTyping12.js @@ -4,6 +4,7 @@ class foo { public bar:{id:number;}[] = [{id:1}, {id:2, name:"foo"}]; } //// [contextualTyping12.js] +"use strict"; class foo { constructor() { this.bar = [{ id: 1 }, { id: 2, name: "foo" }]; diff --git a/tests/baselines/reference/contextualTyping13.js b/tests/baselines/reference/contextualTyping13.js index f1768e528aafb..d8503582dd94c 100644 --- a/tests/baselines/reference/contextualTyping13.js +++ b/tests/baselines/reference/contextualTyping13.js @@ -4,4 +4,5 @@ var foo:(a:number)=>number = function(a){return a}; //// [contextualTyping13.js] +"use strict"; var foo = function (a) { return a; }; diff --git a/tests/baselines/reference/contextualTyping14.js b/tests/baselines/reference/contextualTyping14.js index 4dc7c9100763c..bbc2668ce06a7 100644 --- a/tests/baselines/reference/contextualTyping14.js +++ b/tests/baselines/reference/contextualTyping14.js @@ -4,6 +4,7 @@ class foo { public bar:(a:number)=>number = function(a){return a}; } //// [contextualTyping14.js] +"use strict"; class foo { constructor() { this.bar = function (a) { return a; }; diff --git a/tests/baselines/reference/contextualTyping15.js b/tests/baselines/reference/contextualTyping15.js index a18b9f3255d75..16957c930277b 100644 --- a/tests/baselines/reference/contextualTyping15.js +++ b/tests/baselines/reference/contextualTyping15.js @@ -4,6 +4,7 @@ class foo { public bar: { (): number; (i: number): number; } = function() { return 1 }; } //// [contextualTyping15.js] +"use strict"; class foo { constructor() { this.bar = function () { return 1; }; diff --git a/tests/baselines/reference/contextualTyping16.js b/tests/baselines/reference/contextualTyping16.js index 691ff3c30e0e0..f3d0103d6d914 100644 --- a/tests/baselines/reference/contextualTyping16.js +++ b/tests/baselines/reference/contextualTyping16.js @@ -4,5 +4,6 @@ var foo: {id:number;} = {id:4}; foo = {id:5}; //// [contextualTyping16.js] +"use strict"; var foo = { id: 4 }; foo = { id: 5 }; diff --git a/tests/baselines/reference/contextualTyping17.js b/tests/baselines/reference/contextualTyping17.js index 202c2d3fd7f2d..f773b15d51d0d 100644 --- a/tests/baselines/reference/contextualTyping17.js +++ b/tests/baselines/reference/contextualTyping17.js @@ -4,5 +4,6 @@ var foo: {id:number;} = {id:4}; foo = {id: 5, name:"foo"}; //// [contextualTyping17.js] +"use strict"; var foo = { id: 4 }; foo = { id: 5, name: "foo" }; diff --git a/tests/baselines/reference/contextualTyping18.js b/tests/baselines/reference/contextualTyping18.js index 9a8c2725db0cf..8a101ee6ccb89 100644 --- a/tests/baselines/reference/contextualTyping18.js +++ b/tests/baselines/reference/contextualTyping18.js @@ -4,5 +4,6 @@ var foo: {id:number;} = <{id:number;}>({ }); foo = {id: 5}; //// [contextualTyping18.js] +"use strict"; var foo = ({}); foo = { id: 5 }; diff --git a/tests/baselines/reference/contextualTyping19.js b/tests/baselines/reference/contextualTyping19.js index 82c0b786829fe..97f3558113c5a 100644 --- a/tests/baselines/reference/contextualTyping19.js +++ b/tests/baselines/reference/contextualTyping19.js @@ -4,5 +4,6 @@ var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, {id:2}]; //// [contextualTyping19.js] +"use strict"; var foo = [{ id: 1 }]; foo = [{ id: 1 }, { id: 2 }]; diff --git a/tests/baselines/reference/contextualTyping2.js b/tests/baselines/reference/contextualTyping2.js index c6a0003c3ccb1..6c466c83d17d1 100644 --- a/tests/baselines/reference/contextualTyping2.js +++ b/tests/baselines/reference/contextualTyping2.js @@ -4,4 +4,5 @@ var foo: {id:number;} = {id:4, name:"foo"}; //// [contextualTyping2.js] +"use strict"; var foo = { id: 4, name: "foo" }; diff --git a/tests/baselines/reference/contextualTyping20.js b/tests/baselines/reference/contextualTyping20.js index 06ee1dd94eb2a..9a47060070981 100644 --- a/tests/baselines/reference/contextualTyping20.js +++ b/tests/baselines/reference/contextualTyping20.js @@ -4,5 +4,6 @@ var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, {id:2, name:"foo"}]; //// [contextualTyping20.js] +"use strict"; var foo = [{ id: 1 }]; foo = [{ id: 1 }, { id: 2, name: "foo" }]; diff --git a/tests/baselines/reference/contextualTyping21.js b/tests/baselines/reference/contextualTyping21.js index a8cb3288ea39a..4bb23ee906094 100644 --- a/tests/baselines/reference/contextualTyping21.js +++ b/tests/baselines/reference/contextualTyping21.js @@ -4,5 +4,6 @@ var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, 1]; //// [contextualTyping21.js] +"use strict"; var foo = [{ id: 1 }]; foo = [{ id: 1 }, 1]; diff --git a/tests/baselines/reference/contextualTyping22.js b/tests/baselines/reference/contextualTyping22.js index 3bb2c755581d5..941569aac9c37 100644 --- a/tests/baselines/reference/contextualTyping22.js +++ b/tests/baselines/reference/contextualTyping22.js @@ -4,5 +4,6 @@ var foo:(a:number)=>number = function(a){return a}; foo = function(b){return b}; //// [contextualTyping22.js] +"use strict"; var foo = function (a) { return a; }; foo = function (b) { return b; }; diff --git a/tests/baselines/reference/contextualTyping23.js b/tests/baselines/reference/contextualTyping23.js index e247c0bf4ad28..a3aa0bb3617ab 100644 --- a/tests/baselines/reference/contextualTyping23.js +++ b/tests/baselines/reference/contextualTyping23.js @@ -4,5 +4,6 @@ var foo:(a:{():number; (i:number):number; })=>number; foo = function(a){return 5}; //// [contextualTyping23.js] +"use strict"; var foo; foo = function (a) { return 5; }; diff --git a/tests/baselines/reference/contextualTyping24.js b/tests/baselines/reference/contextualTyping24.js index 6350be7978120..f114df537204d 100644 --- a/tests/baselines/reference/contextualTyping24.js +++ b/tests/baselines/reference/contextualTyping24.js @@ -4,5 +4,6 @@ var foo:(a:{():number; (i:number):number; })=>number; foo = function(this: void, a:string){return 5}; //// [contextualTyping24.js] +"use strict"; var foo; foo = function (a) { return 5; }; diff --git a/tests/baselines/reference/contextualTyping25.js b/tests/baselines/reference/contextualTyping25.js index 79f504444aff1..70ede98e384e3 100644 --- a/tests/baselines/reference/contextualTyping25.js +++ b/tests/baselines/reference/contextualTyping25.js @@ -4,6 +4,7 @@ function foo(param:{id:number;}){}; foo(<{id:number;}>({})); //// [contextualTyping25.js] +"use strict"; function foo(param) { } ; foo(({})); diff --git a/tests/baselines/reference/contextualTyping26.js b/tests/baselines/reference/contextualTyping26.js index b7ec3ce1027c3..5face883709ee 100644 --- a/tests/baselines/reference/contextualTyping26.js +++ b/tests/baselines/reference/contextualTyping26.js @@ -4,6 +4,7 @@ function foo(param:{id:number;}){}; foo(<{id:number;}>({})); //// [contextualTyping26.js] +"use strict"; function foo(param) { } ; foo(({})); diff --git a/tests/baselines/reference/contextualTyping27.js b/tests/baselines/reference/contextualTyping27.js index a4ed00f85eedd..abb867a0b96fa 100644 --- a/tests/baselines/reference/contextualTyping27.js +++ b/tests/baselines/reference/contextualTyping27.js @@ -4,6 +4,7 @@ function foo(param:{id:number;}){}; foo(<{id:number;}>({})); //// [contextualTyping27.js] +"use strict"; function foo(param) { } ; foo(({})); diff --git a/tests/baselines/reference/contextualTyping28.js b/tests/baselines/reference/contextualTyping28.js index eaed903b3e476..94ca131543697 100644 --- a/tests/baselines/reference/contextualTyping28.js +++ b/tests/baselines/reference/contextualTyping28.js @@ -4,6 +4,7 @@ function foo(param:number[]){}; foo([1]); //// [contextualTyping28.js] +"use strict"; function foo(param) { } ; foo([1]); diff --git a/tests/baselines/reference/contextualTyping29.js b/tests/baselines/reference/contextualTyping29.js index 9f7bbb70e8a3a..9d755e134ebe3 100644 --- a/tests/baselines/reference/contextualTyping29.js +++ b/tests/baselines/reference/contextualTyping29.js @@ -4,6 +4,7 @@ function foo(param:number[]){}; foo([1, 3]); //// [contextualTyping29.js] +"use strict"; function foo(param) { } ; foo([1, 3]); diff --git a/tests/baselines/reference/contextualTyping3.js b/tests/baselines/reference/contextualTyping3.js index caca10767badc..a033a84fd855b 100644 --- a/tests/baselines/reference/contextualTyping3.js +++ b/tests/baselines/reference/contextualTyping3.js @@ -4,6 +4,7 @@ class foo { public bar:{id:number;} = {id:5}; } //// [contextualTyping3.js] +"use strict"; class foo { constructor() { this.bar = { id: 5 }; diff --git a/tests/baselines/reference/contextualTyping30.js b/tests/baselines/reference/contextualTyping30.js index 58e469e65b77c..b82fd5c182681 100644 --- a/tests/baselines/reference/contextualTyping30.js +++ b/tests/baselines/reference/contextualTyping30.js @@ -4,6 +4,7 @@ function foo(param:number[]){}; foo([1, "a"]); //// [contextualTyping30.js] +"use strict"; function foo(param) { } ; foo([1, "a"]); diff --git a/tests/baselines/reference/contextualTyping31.js b/tests/baselines/reference/contextualTyping31.js index 3b767146b07e2..aa43f1ac67d89 100644 --- a/tests/baselines/reference/contextualTyping31.js +++ b/tests/baselines/reference/contextualTyping31.js @@ -4,6 +4,7 @@ function foo(param:number[]){}; foo([1]); //// [contextualTyping31.js] +"use strict"; function foo(param) { } ; foo([1]); diff --git a/tests/baselines/reference/contextualTyping32.js b/tests/baselines/reference/contextualTyping32.js index 0c309bbbac4f3..8a23dd3b1e8fb 100644 --- a/tests/baselines/reference/contextualTyping32.js +++ b/tests/baselines/reference/contextualTyping32.js @@ -4,6 +4,7 @@ function foo(param: {():number; (i:number):number; }[]) { }; foo([function(){return 1;}, function(){return 4}]); //// [contextualTyping32.js] +"use strict"; function foo(param) { } ; foo([function () { return 1; }, function () { return 4; }]); diff --git a/tests/baselines/reference/contextualTyping33.js b/tests/baselines/reference/contextualTyping33.js index acb80b58fb56d..4c14baeac837d 100644 --- a/tests/baselines/reference/contextualTyping33.js +++ b/tests/baselines/reference/contextualTyping33.js @@ -4,6 +4,7 @@ function foo(param: {():number; (i:number):number; }[]) { }; foo([function(){return 1;}, function(){return "foo"}]); //// [contextualTyping33.js] +"use strict"; function foo(param) { } ; foo([function () { return 1; }, function () { return "foo"; }]); diff --git a/tests/baselines/reference/contextualTyping34.js b/tests/baselines/reference/contextualTyping34.js index b2b2d8e56c934..fb2b3151bfcde 100644 --- a/tests/baselines/reference/contextualTyping34.js +++ b/tests/baselines/reference/contextualTyping34.js @@ -4,4 +4,5 @@ var foo = <{ id: number;}> ({id:4}); //// [contextualTyping34.js] +"use strict"; var foo = ({ id: 4 }); diff --git a/tests/baselines/reference/contextualTyping35.js b/tests/baselines/reference/contextualTyping35.js index 9efda06db03ec..d68a6c7cd9e15 100644 --- a/tests/baselines/reference/contextualTyping35.js +++ b/tests/baselines/reference/contextualTyping35.js @@ -4,4 +4,5 @@ var foo = <{ id: number;}> {id:4, name: "as"}; //// [contextualTyping35.js] +"use strict"; var foo = { id: 4, name: "as" }; diff --git a/tests/baselines/reference/contextualTyping36.js b/tests/baselines/reference/contextualTyping36.js index 34ba2af4e9d9f..6e97aace4c02f 100644 --- a/tests/baselines/reference/contextualTyping36.js +++ b/tests/baselines/reference/contextualTyping36.js @@ -4,4 +4,5 @@ var foo = <{ id: number; }[]>[{ id: 4 }, <{ id: number; }>({ })]; //// [contextualTyping36.js] +"use strict"; var foo = [{ id: 4 }, ({})]; diff --git a/tests/baselines/reference/contextualTyping37.js b/tests/baselines/reference/contextualTyping37.js index a3ead718ce689..955b0944f2bdb 100644 --- a/tests/baselines/reference/contextualTyping37.js +++ b/tests/baselines/reference/contextualTyping37.js @@ -4,4 +4,5 @@ var foo = <{ id: number; }[]>[{ foo: "s" }, { }]; //// [contextualTyping37.js] +"use strict"; var foo = [{ foo: "s" }, {}]; diff --git a/tests/baselines/reference/contextualTyping38.errors.txt b/tests/baselines/reference/contextualTyping38.errors.txt new file mode 100644 index 0000000000000..7494ec680dea9 --- /dev/null +++ b/tests/baselines/reference/contextualTyping38.errors.txt @@ -0,0 +1,7 @@ +contextualTyping38.ts(1,38): error TS7006: Parameter 'a' implicitly has an 'any' type. + + +==== contextualTyping38.ts (1 errors) ==== + var foo = <{ (): number; }> function(a) { return a }; + ~ +!!! error TS7006: Parameter 'a' implicitly has an 'any' type. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping38.js b/tests/baselines/reference/contextualTyping38.js index 75ccd652f3df8..d639110ba887e 100644 --- a/tests/baselines/reference/contextualTyping38.js +++ b/tests/baselines/reference/contextualTyping38.js @@ -4,4 +4,5 @@ var foo = <{ (): number; }> function(a) { return a }; //// [contextualTyping38.js] +"use strict"; var foo = function (a) { return a; }; diff --git a/tests/baselines/reference/contextualTyping38.types b/tests/baselines/reference/contextualTyping38.types index c16ab3d09cbcd..907d9bb48cc40 100644 --- a/tests/baselines/reference/contextualTyping38.types +++ b/tests/baselines/reference/contextualTyping38.types @@ -9,5 +9,7 @@ var foo = <{ (): number; }> function(a) { return a }; >function(a) { return a } : (a: any) => any > : ^ ^^^^^^^^^^^^^ >a : any +> : ^^^ >a : any +> : ^^^ diff --git a/tests/baselines/reference/contextualTyping39.js b/tests/baselines/reference/contextualTyping39.js index 52cf17e1cf826..b94409567777a 100644 --- a/tests/baselines/reference/contextualTyping39.js +++ b/tests/baselines/reference/contextualTyping39.js @@ -4,4 +4,5 @@ var foo = <{ (): number; }> function() { return "err"; }; //// [contextualTyping39.js] +"use strict"; var foo = function () { return "err"; }; diff --git a/tests/baselines/reference/contextualTyping4.js b/tests/baselines/reference/contextualTyping4.js index 6add39bbae5e9..e14b75e3e564a 100644 --- a/tests/baselines/reference/contextualTyping4.js +++ b/tests/baselines/reference/contextualTyping4.js @@ -4,6 +4,7 @@ class foo { public bar:{id:number;} = {id:5, name:"foo"}; } //// [contextualTyping4.js] +"use strict"; class foo { constructor() { this.bar = { id: 5, name: "foo" }; diff --git a/tests/baselines/reference/contextualTyping40.js b/tests/baselines/reference/contextualTyping40.js index 7f94eeea3267b..4598da5f428c0 100644 --- a/tests/baselines/reference/contextualTyping40.js +++ b/tests/baselines/reference/contextualTyping40.js @@ -4,4 +4,5 @@ var foo = <{():number; (i:number):number; }> function(){return 1;}; //// [contextualTyping40.js] +"use strict"; var foo = function () { return 1; }; diff --git a/tests/baselines/reference/contextualTyping41.js b/tests/baselines/reference/contextualTyping41.js index d121c2a138c48..10b23d8b66314 100644 --- a/tests/baselines/reference/contextualTyping41.js +++ b/tests/baselines/reference/contextualTyping41.js @@ -4,4 +4,5 @@ var foo = <{():number; (i:number):number; }> (function(){return "err";}); //// [contextualTyping41.js] +"use strict"; var foo = (function () { return "err"; }); diff --git a/tests/baselines/reference/contextualTyping5.js b/tests/baselines/reference/contextualTyping5.js index 263fcb8fdcfcf..fda498e1e1d4b 100644 --- a/tests/baselines/reference/contextualTyping5.js +++ b/tests/baselines/reference/contextualTyping5.js @@ -4,6 +4,7 @@ class foo { public bar:{id:number;} = { }; } //// [contextualTyping5.js] +"use strict"; class foo { constructor() { this.bar = {}; diff --git a/tests/baselines/reference/contextualTyping6.js b/tests/baselines/reference/contextualTyping6.js index 16187e69945d5..e71df896a087f 100644 --- a/tests/baselines/reference/contextualTyping6.js +++ b/tests/baselines/reference/contextualTyping6.js @@ -4,4 +4,5 @@ var foo:{id:number;}[] = [{id:1}, {id:2}]; //// [contextualTyping6.js] +"use strict"; var foo = [{ id: 1 }, { id: 2 }]; diff --git a/tests/baselines/reference/contextualTyping7.js b/tests/baselines/reference/contextualTyping7.js index 6084beefc0cea..16822ba3024d4 100644 --- a/tests/baselines/reference/contextualTyping7.js +++ b/tests/baselines/reference/contextualTyping7.js @@ -4,4 +4,5 @@ var foo:{id:number;}[] = [<{id:number;}>({})]; //// [contextualTyping7.js] +"use strict"; var foo = [({})]; diff --git a/tests/baselines/reference/contextualTyping8.js b/tests/baselines/reference/contextualTyping8.js index ed900ce404a5a..81e97ddae9615 100644 --- a/tests/baselines/reference/contextualTyping8.js +++ b/tests/baselines/reference/contextualTyping8.js @@ -4,4 +4,5 @@ var foo:{id:number;}[] = [<{id:number;}>({})]; //// [contextualTyping8.js] +"use strict"; var foo = [({})]; diff --git a/tests/baselines/reference/contextualTyping9.js b/tests/baselines/reference/contextualTyping9.js index 33b33d8dc7c7b..bea3ffdb5d71c 100644 --- a/tests/baselines/reference/contextualTyping9.js +++ b/tests/baselines/reference/contextualTyping9.js @@ -4,4 +4,5 @@ var foo:{id:number;}[] = [{id:1}, {id:2, name:"foo"}]; //// [contextualTyping9.js] +"use strict"; var foo = [{ id: 1 }, { id: 2, name: "foo" }]; diff --git a/tests/baselines/reference/contextualTypingArrayDestructuringWithDefaults.js b/tests/baselines/reference/contextualTypingArrayDestructuringWithDefaults.js index 72ac904059dc9..5f0af4ac0ffce 100644 --- a/tests/baselines/reference/contextualTypingArrayDestructuringWithDefaults.js +++ b/tests/baselines/reference/contextualTypingArrayDestructuringWithDefaults.js @@ -14,6 +14,7 @@ function foo() { //// [contextualTypingArrayDestructuringWithDefaults.js] +"use strict"; let [c0 = { a: "a" }] = []; let [x1, c1 = { a: "a" }] = [1]; let [c_ = { a: "a" }] = []; diff --git a/tests/baselines/reference/contextualTypingArrayOfLambdas.js b/tests/baselines/reference/contextualTypingArrayOfLambdas.js index 83aadf77a898f..c26171d5f89ec 100644 --- a/tests/baselines/reference/contextualTypingArrayOfLambdas.js +++ b/tests/baselines/reference/contextualTypingArrayOfLambdas.js @@ -17,6 +17,7 @@ var xs = [(x: A) => { }, (x: B) => { }, (x: C) => { }]; //// [contextualTypingArrayOfLambdas.js] +"use strict"; class A { } class B extends A { diff --git a/tests/baselines/reference/contextualTypingFunctionReturningFunction.js b/tests/baselines/reference/contextualTypingFunctionReturningFunction.js index 3dbed6a04b3e0..ff151cb60f7a7 100644 --- a/tests/baselines/reference/contextualTypingFunctionReturningFunction.js +++ b/tests/baselines/reference/contextualTypingFunctionReturningFunction.js @@ -15,6 +15,7 @@ f({ //// [contextualTypingFunctionReturningFunction.js] +"use strict"; f({ a: s => { }, b: () => n => { }, diff --git a/tests/baselines/reference/contextualTypingFunctionReturningFunction2.js b/tests/baselines/reference/contextualTypingFunctionReturningFunction2.js index 9a5aea3688971..b5c2ab2a02735 100644 --- a/tests/baselines/reference/contextualTypingFunctionReturningFunction2.js +++ b/tests/baselines/reference/contextualTypingFunctionReturningFunction2.js @@ -8,4 +8,5 @@ f(() => n => n); //// [contextualTypingFunctionReturningFunction2.js] +"use strict"; f(() => n => n); diff --git a/tests/baselines/reference/contextualTypingOfAccessors.js b/tests/baselines/reference/contextualTypingOfAccessors.js index b24ae1ff3e47c..ba5d2d596df8f 100644 --- a/tests/baselines/reference/contextualTypingOfAccessors.js +++ b/tests/baselines/reference/contextualTypingOfAccessors.js @@ -16,6 +16,7 @@ x = { //// [contextualTypingOfAccessors.js] +"use strict"; // not contextually typing accessors var x; x = { diff --git a/tests/baselines/reference/contextualTypingOfArrayLiterals1.js b/tests/baselines/reference/contextualTypingOfArrayLiterals1.js index 2b416b8d4d568..838eb6d007d4f 100644 --- a/tests/baselines/reference/contextualTypingOfArrayLiterals1.js +++ b/tests/baselines/reference/contextualTypingOfArrayLiterals1.js @@ -11,6 +11,7 @@ r2.getDate(); //// [contextualTypingOfArrayLiterals1.js] +"use strict"; var x3 = [new Date(), 1]; var r2 = x3[1]; r2.getDate(); diff --git a/tests/baselines/reference/contextualTypingOfConditionalExpression.js b/tests/baselines/reference/contextualTypingOfConditionalExpression.js index b42116639ce3b..2d914a2530b44 100644 --- a/tests/baselines/reference/contextualTypingOfConditionalExpression.js +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression.js @@ -17,6 +17,7 @@ var x2: (a: A) => void = true ? (a) => a.foo : (b) => b.foo; //// [contextualTypingOfConditionalExpression.js] +"use strict"; var x = true ? (a) => a.toExponential() : (b) => b.toFixed(); class A { } diff --git a/tests/baselines/reference/contextualTypingOfConditionalExpression2.js b/tests/baselines/reference/contextualTypingOfConditionalExpression2.js index 2ba72d3490358..23b61bf908086 100644 --- a/tests/baselines/reference/contextualTypingOfConditionalExpression2.js +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression2.js @@ -15,6 +15,7 @@ var x2: (a: A) => void = true ? (a: C) => a.foo : (b: number) => { }; //// [contextualTypingOfConditionalExpression2.js] +"use strict"; class A { } class B extends A { diff --git a/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.js b/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.js index c2654930399bf..9e4b907119f3d 100644 --- a/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.js +++ b/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.js @@ -21,6 +21,7 @@ var r6 = _.forEach(c2, (x) => { return x.toFixed() }); //// [contextualTypingOfGenericFunctionTypedArguments1.js] +"use strict"; // errors on all 3 lines, bug was that r5 was the only line with errors var f = (x) => { return x.toFixed(); }; var r5 = _.forEach(c2, f); diff --git a/tests/baselines/reference/contextualTypingOfLambdaReturnExpression.js b/tests/baselines/reference/contextualTypingOfLambdaReturnExpression.js index a89c2747f4bd8..fc89ec21d8820 100644 --- a/tests/baselines/reference/contextualTypingOfLambdaReturnExpression.js +++ b/tests/baselines/reference/contextualTypingOfLambdaReturnExpression.js @@ -9,6 +9,7 @@ callb((a) => a.length); // Ok, we choose the second overload because the first o callb((a) => { a.length; }); // Error, we picked the first overload and errored when type checking the lambda body //// [contextualTypingOfLambdaReturnExpression.js] +"use strict"; function callb(a) { } callb((a) => a.length); // Ok, we choose the second overload because the first one gave us an error when trying to resolve the lambda return type callb((a) => { a.length; }); // Error, we picked the first overload and errored when type checking the lambda body diff --git a/tests/baselines/reference/contextualTypingOfLambdaWithMultipleSignatures.js b/tests/baselines/reference/contextualTypingOfLambdaWithMultipleSignatures.js index 28dba3086e09c..e218f17f2f086 100644 --- a/tests/baselines/reference/contextualTypingOfLambdaWithMultipleSignatures.js +++ b/tests/baselines/reference/contextualTypingOfLambdaWithMultipleSignatures.js @@ -10,5 +10,6 @@ var foo: Foo; foo.getFoo = bar => { }; //// [contextualTypingOfLambdaWithMultipleSignatures.js] +"use strict"; var foo; foo.getFoo = bar => { }; diff --git a/tests/baselines/reference/contextualTypingOfLambdaWithMultipleSignatures2.js b/tests/baselines/reference/contextualTypingOfLambdaWithMultipleSignatures2.js index 4b9e303df39f7..852c0b0e7c97c 100644 --- a/tests/baselines/reference/contextualTypingOfLambdaWithMultipleSignatures2.js +++ b/tests/baselines/reference/contextualTypingOfLambdaWithMultipleSignatures2.js @@ -9,5 +9,6 @@ var f: { f = (a) => { return a.asdf } //// [contextualTypingOfLambdaWithMultipleSignatures2.js] +"use strict"; var f; f = (a) => { return a.asdf; }; diff --git a/tests/baselines/reference/contextualTypingOfObjectLiterals.js b/tests/baselines/reference/contextualTypingOfObjectLiterals.js index f7894b4958263..e8b9bb6244b5e 100644 --- a/tests/baselines/reference/contextualTypingOfObjectLiterals.js +++ b/tests/baselines/reference/contextualTypingOfObjectLiterals.js @@ -13,6 +13,7 @@ f(obj1); // Ok f(obj2); // Error - indexer doesn't match //// [contextualTypingOfObjectLiterals.js] +"use strict"; var obj1; var obj2 = { x: "" }; obj1 = {}; // Ok diff --git a/tests/baselines/reference/contextualTypingOfObjectLiterals2.js b/tests/baselines/reference/contextualTypingOfObjectLiterals2.js index 1334d82ae44b2..491d1bccaa05f 100644 --- a/tests/baselines/reference/contextualTypingOfObjectLiterals2.js +++ b/tests/baselines/reference/contextualTypingOfObjectLiterals2.js @@ -8,5 +8,6 @@ function f2(args: Foo) { } f2({ foo: s => s.hmm }) // 's' should be 'string', so this should be an error //// [contextualTypingOfObjectLiterals2.js] +"use strict"; function f2(args) { } f2({ foo: s => s.hmm }); // 's' should be 'string', so this should be an error diff --git a/tests/baselines/reference/contextualTypingOfOptionalMembers.js b/tests/baselines/reference/contextualTypingOfOptionalMembers.js index 6390869fcc7c8..3b3a86b66d34a 100644 --- a/tests/baselines/reference/contextualTypingOfOptionalMembers.js +++ b/tests/baselines/reference/contextualTypingOfOptionalMembers.js @@ -77,6 +77,7 @@ const a = s} />; // TODO: should be number => number //// [index.jsx] +"use strict"; app({ state: 100, actions: { diff --git a/tests/baselines/reference/contextualTypingOfTooShortOverloads.js b/tests/baselines/reference/contextualTypingOfTooShortOverloads.js index 952c628201c9f..569698b7701f1 100644 --- a/tests/baselines/reference/contextualTypingOfTooShortOverloads.js +++ b/tests/baselines/reference/contextualTypingOfTooShortOverloads.js @@ -53,6 +53,7 @@ interface NextFunction { //// [contextualTypingOfTooShortOverloads.js] +"use strict"; // small repro from #11875 var use; use((req, res) => { }); diff --git a/tests/baselines/reference/contextualTypingTwoInstancesOfSameTypeParameter.js b/tests/baselines/reference/contextualTypingTwoInstancesOfSameTypeParameter.js index 35b173ddba6ae..d908cf5b85980 100644 --- a/tests/baselines/reference/contextualTypingTwoInstancesOfSameTypeParameter.js +++ b/tests/baselines/reference/contextualTypingTwoInstancesOfSameTypeParameter.js @@ -7,6 +7,7 @@ function f6(x: (a: T) => T) { f6(x => f6(y => x = y)); //// [contextualTypingTwoInstancesOfSameTypeParameter.js] +"use strict"; function f6(x) { return null; } diff --git a/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.js b/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.js index 4435fed448104..fc7175b2e0c57 100644 --- a/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.js +++ b/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.js @@ -6,5 +6,6 @@ f10('', () => a => a.foo, ''); // a is "" var r9 = f10('', () => (a => a.foo), 1); // error //// [contextualTypingWithFixedTypeParameters1.js] +"use strict"; f10('', () => a => a.foo, ''); // a is "" var r9 = f10('', () => (a => a.foo), 1); // error diff --git a/tests/baselines/reference/contextualTypingWithGenericAndNonGenericSignature.errors.txt b/tests/baselines/reference/contextualTypingWithGenericAndNonGenericSignature.errors.txt new file mode 100644 index 0000000000000..bff1354699b40 --- /dev/null +++ b/tests/baselines/reference/contextualTypingWithGenericAndNonGenericSignature.errors.txt @@ -0,0 +1,31 @@ +contextualTypingWithGenericAndNonGenericSignature.ts(8,7): error TS7006: Parameter 'x' implicitly has an 'any' type. +contextualTypingWithGenericAndNonGenericSignature.ts(8,10): error TS7006: Parameter 'y' implicitly has an 'any' type. +contextualTypingWithGenericAndNonGenericSignature.ts(15,7): error TS7006: Parameter 'x' implicitly has an 'any' type. +contextualTypingWithGenericAndNonGenericSignature.ts(15,10): error TS7006: Parameter 'y' implicitly has an 'any' type. + + +==== contextualTypingWithGenericAndNonGenericSignature.ts (4 errors) ==== + //• 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: { + (x: string, y: number): string; + (x: T, y: U): T + }; + + f2 = (x, y) => { return x } + ~ +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. + ~ +!!! error TS7006: Parameter 'y' implicitly has an 'any' type. + + var f3: { + (x: T, y: U): T + (x: string, y: number): string; + }; + + f3 = (x, y) => { return x } + ~ +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. + ~ +!!! error TS7006: Parameter 'y' implicitly has an 'any' type. + \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingWithGenericAndNonGenericSignature.js b/tests/baselines/reference/contextualTypingWithGenericAndNonGenericSignature.js index d53131cef126f..39ccca8892c44 100644 --- a/tests/baselines/reference/contextualTypingWithGenericAndNonGenericSignature.js +++ b/tests/baselines/reference/contextualTypingWithGenericAndNonGenericSignature.js @@ -19,6 +19,7 @@ f3 = (x, y) => { return x } //// [contextualTypingWithGenericAndNonGenericSignature.js] +"use strict"; //• 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 = (x, y) => { return x; }; diff --git a/tests/baselines/reference/contextualTypingWithGenericAndNonGenericSignature.types b/tests/baselines/reference/contextualTypingWithGenericAndNonGenericSignature.types index a70b54e69ccb4..c80fd73d7a1b4 100644 --- a/tests/baselines/reference/contextualTypingWithGenericAndNonGenericSignature.types +++ b/tests/baselines/reference/contextualTypingWithGenericAndNonGenericSignature.types @@ -29,8 +29,11 @@ f2 = (x, y) => { return x } >(x, y) => { return x } : (x: any, y: any) => any > : ^ ^^^^^^^ ^^^^^^^^^^^^^ >x : any +> : ^^^ >y : any +> : ^^^ >x : any +> : ^^^ var f3: { >f3 : { (x: T, y: U): T; (x: string, y: number): string; } @@ -58,6 +61,9 @@ f3 = (x, y) => { return x } >(x, y) => { return x } : (x: any, y: any) => any > : ^ ^^^^^^^ ^^^^^^^^^^^^^ >x : any +> : ^^^ >y : any +> : ^^^ >x : any +> : ^^^ diff --git a/tests/baselines/reference/contextualTypingWithGenericSignature.js b/tests/baselines/reference/contextualTypingWithGenericSignature.js index 57ca10c56f3c7..c37e898fba3a3 100644 --- a/tests/baselines/reference/contextualTypingWithGenericSignature.js +++ b/tests/baselines/reference/contextualTypingWithGenericSignature.js @@ -10,6 +10,7 @@ var f2: { f2 = (x, y) => { return x } //// [contextualTypingWithGenericSignature.js] +"use strict"; // 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 = (x, y) => { return x; }; diff --git a/tests/baselines/reference/contextuallyTypeAsyncFunctionReturnType.types b/tests/baselines/reference/contextuallyTypeAsyncFunctionReturnType.types index 5d8df0c417280..b8b91163e66c6 100644 --- a/tests/baselines/reference/contextuallyTypeAsyncFunctionReturnType.types +++ b/tests/baselines/reference/contextuallyTypeAsyncFunctionReturnType.types @@ -131,14 +131,14 @@ interface TestFunction { (title: string, fn?: Func): void; >title : string > : ^^^^^^ ->fn : Func -> : ^^^^ +>fn : Func | undefined +> : ^^^^^^^^^^^^^^^^ (title: string, fn?: AsyncFunc): void; >title : string > : ^^^^^^ ->fn : AsyncFunc -> : ^^^^^^^^^ +>fn : AsyncFunc | undefined +> : ^^^^^^^^^^^^^^^^^^^^^ } declare const test: TestFunction; @@ -155,12 +155,12 @@ interface ProcessTreeNode { > : ^^^^^^ memory?: number; ->memory : number -> : ^^^^^^ +>memory : number | undefined +> : ^^^^^^^^^^^^^^^^^^ commandLine?: string; ->commandLine : string -> : ^^^^^^ +>commandLine : string | undefined +> : ^^^^^^^^^^^^^^^^^^ children: ProcessTreeNode[]; >children : ProcessTreeNode[] @@ -250,8 +250,8 @@ interface ILocalExtension { > : ^^^^^^^ publisherId: string | null; ->publisherId : string -> : ^^^^^^ +>publisherId : string | null +> : ^^^^^^^^^^^^^ } type Metadata = { >Metadata : Metadata @@ -282,14 +282,14 @@ async function copyExtensions( ): Promise { const extensions: [ILocalExtension, Metadata | undefined][] = ->extensions : [ILocalExtension, Metadata][] -> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>extensions : [ILocalExtension, Metadata | undefined][] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ await Promise.all( ->await Promise.all( fromExtensions .filter((e) => !e.isApplicationScoped) .map(async (e) => [e, await scanMetadata(e)]) ) : [ILocalExtension, Metadata][] -> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->Promise.all( fromExtensions .filter((e) => !e.isApplicationScoped) .map(async (e) => [e, await scanMetadata(e)]) ) : Promise<[ILocalExtension, Metadata][]> -> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>await Promise.all( fromExtensions .filter((e) => !e.isApplicationScoped) .map(async (e) => [e, await scanMetadata(e)]) ) : [ILocalExtension, Metadata | undefined][] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Promise.all( fromExtensions .filter((e) => !e.isApplicationScoped) .map(async (e) => [e, await scanMetadata(e)]) ) : Promise<[ILocalExtension, Metadata | undefined][]> +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >Promise.all : { (values: Iterable>): Promise[]>; (values: T): Promise<{ -readonly [P in keyof T]: Awaited; }>; } > : ^^^ ^^ ^^ ^^^ ^^^ ^^^^^^^^^ ^^ ^^ ^^^ ^^^ >Promise : PromiseConstructor @@ -298,8 +298,8 @@ async function copyExtensions( > : ^^^ ^^ ^^ ^^^ ^^^ ^^^^^^^^^ ^^ ^^ ^^^ ^^^ fromExtensions ->fromExtensions .filter((e) => !e.isApplicationScoped) .map(async (e) => [e, await scanMetadata(e)]) : Promise<[ILocalExtension, Metadata]>[] -> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>fromExtensions .filter((e) => !e.isApplicationScoped) .map(async (e) => [e, await scanMetadata(e)]) : Promise<[ILocalExtension, Metadata | undefined]>[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >fromExtensions .filter((e) => !e.isApplicationScoped) .map : (callbackfn: (value: ILocalExtension, index: number, array: ILocalExtension[]) => U, thisArg?: any) => U[] > : ^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ >fromExtensions .filter((e) => !e.isApplicationScoped) : ILocalExtension[] @@ -328,18 +328,18 @@ async function copyExtensions( .map(async (e) => [e, await scanMetadata(e)]) >map : (callbackfn: (value: ILocalExtension, index: number, array: ILocalExtension[]) => U, thisArg?: any) => U[] > : ^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ ->async (e) => [e, await scanMetadata(e)] : (e: ILocalExtension) => Promise<[ILocalExtension, Metadata]> -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>async (e) => [e, await scanMetadata(e)] : (e: ILocalExtension) => Promise<[ILocalExtension, Metadata | undefined]> +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >e : ILocalExtension > : ^^^^^^^^^^^^^^^ ->[e, await scanMetadata(e)] : [ILocalExtension, Metadata] -> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>[e, await scanMetadata(e)] : [ILocalExtension, Metadata | undefined] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >e : ILocalExtension > : ^^^^^^^^^^^^^^^ ->await scanMetadata(e) : Metadata -> : ^^^^^^^^ ->scanMetadata(e) : Promise -> : ^^^^^^^^^^^^^^^^^ +>await scanMetadata(e) : Metadata | undefined +> : ^^^^^^^^^^^^^^^^^^^^ +>scanMetadata(e) : Promise +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >scanMetadata : (local: ILocalExtension) => Promise > : ^ ^^ ^^^^^ >e : ILocalExtension diff --git a/tests/baselines/reference/contextuallyTypeCommaOperator01.js b/tests/baselines/reference/contextuallyTypeCommaOperator01.js index ea6406e4b4ab2..fcd3b85ded3fe 100644 --- a/tests/baselines/reference/contextuallyTypeCommaOperator01.js +++ b/tests/baselines/reference/contextuallyTypeCommaOperator01.js @@ -6,5 +6,6 @@ let x: (a: string) => string; x = (100, a => a); //// [contextuallyTypeCommaOperator01.js] +"use strict"; let x; x = (100, a => a); diff --git a/tests/baselines/reference/contextuallyTypeCommaOperator02.js b/tests/baselines/reference/contextuallyTypeCommaOperator02.js index 8c1c7b4d6b763..e9bbc06cb6917 100644 --- a/tests/baselines/reference/contextuallyTypeCommaOperator02.js +++ b/tests/baselines/reference/contextuallyTypeCommaOperator02.js @@ -9,6 +9,7 @@ x = (100, a => { }); //// [contextuallyTypeCommaOperator02.js] +"use strict"; let x; x = (100, a => { const b = a; diff --git a/tests/baselines/reference/contextuallyTypeCommaOperator03.js b/tests/baselines/reference/contextuallyTypeCommaOperator03.js index 87b6980fabc61..27db95d2dac14 100644 --- a/tests/baselines/reference/contextuallyTypeCommaOperator03.js +++ b/tests/baselines/reference/contextuallyTypeCommaOperator03.js @@ -6,5 +6,6 @@ let x: (a: string) => string; x = (a => a, b => b); //// [contextuallyTypeCommaOperator03.js] +"use strict"; let x; x = (a => a, b => b); diff --git a/tests/baselines/reference/contextuallyTypeLogicalAnd01.js b/tests/baselines/reference/contextuallyTypeLogicalAnd01.js index a50ca99ae270a..e3ccda2b23d04 100644 --- a/tests/baselines/reference/contextuallyTypeLogicalAnd01.js +++ b/tests/baselines/reference/contextuallyTypeLogicalAnd01.js @@ -7,6 +7,7 @@ let y = true; x = y && (a => a); //// [contextuallyTypeLogicalAnd01.js] +"use strict"; let x; let y = true; x = y && (a => a); diff --git a/tests/baselines/reference/contextuallyTypeLogicalAnd02.js b/tests/baselines/reference/contextuallyTypeLogicalAnd02.js index 1e66fbff6801e..f921e080c30cf 100644 --- a/tests/baselines/reference/contextuallyTypeLogicalAnd02.js +++ b/tests/baselines/reference/contextuallyTypeLogicalAnd02.js @@ -10,6 +10,7 @@ x = y && (a => { }); //// [contextuallyTypeLogicalAnd02.js] +"use strict"; let x; let y = true; x = y && (a => { diff --git a/tests/baselines/reference/contextuallyTypeLogicalAnd03.js b/tests/baselines/reference/contextuallyTypeLogicalAnd03.js index bd882c4121f2c..23fbd81e3a03d 100644 --- a/tests/baselines/reference/contextuallyTypeLogicalAnd03.js +++ b/tests/baselines/reference/contextuallyTypeLogicalAnd03.js @@ -7,6 +7,7 @@ let y = true; x = (a => a) && (b => b); //// [contextuallyTypeLogicalAnd03.js] +"use strict"; let x; let y = true; x = (a => a) && (b => b); diff --git a/tests/baselines/reference/contextuallyTypedBindingInitializer.js b/tests/baselines/reference/contextuallyTypedBindingInitializer.js index 58d264c9f5a5b..1884e1ac544c0 100644 --- a/tests/baselines/reference/contextuallyTypedBindingInitializer.js +++ b/tests/baselines/reference/contextuallyTypedBindingInitializer.js @@ -32,6 +32,7 @@ let { stringIdentity: id = arg => arg }: StringIdentity = { stringIdentity: x => //// [contextuallyTypedBindingInitializer.js] +"use strict"; function f({ show = v => v.toString() }) { } function f2({ "show": showRename = v => v.toString() }) { } function f3({ ["show"]: showRename = v => v.toString() }) { } diff --git a/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.js b/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.js index 1fdc24f73f6f6..512e42d67742c 100644 --- a/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.js +++ b/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.js @@ -30,6 +30,7 @@ function h({ prop = "baz" }: StringUnion) {} //// [contextuallyTypedBindingInitializerNegative.js] +"use strict"; function f({ show: showRename = v => v }) { } function f2({ "show": showRename = v => v }) { } function f3({ ["show"]: showRename = v => v }) { } diff --git a/tests/baselines/reference/contextuallyTypedByDiscriminableUnion.js b/tests/baselines/reference/contextuallyTypedByDiscriminableUnion.js index ce4831611c8c0..1836f07262316 100644 --- a/tests/baselines/reference/contextuallyTypedByDiscriminableUnion.js +++ b/tests/baselines/reference/contextuallyTypedByDiscriminableUnion.js @@ -36,6 +36,7 @@ invoke({ //// [contextuallyTypedByDiscriminableUnion.js] +"use strict"; function invoke(item) { if (item.kind === "a") { item.method(""); diff --git a/tests/baselines/reference/contextuallyTypedClassExpressionMethodDeclaration01.js b/tests/baselines/reference/contextuallyTypedClassExpressionMethodDeclaration01.js index 69ee1e16d4703..e577946935a45 100644 --- a/tests/baselines/reference/contextuallyTypedClassExpressionMethodDeclaration01.js +++ b/tests/baselines/reference/contextuallyTypedClassExpressionMethodDeclaration01.js @@ -48,6 +48,7 @@ function getFoo3(): Foo { } //// [contextuallyTypedClassExpressionMethodDeclaration01.js] +"use strict"; function getFoo1() { return class { static method1(arg) { diff --git a/tests/baselines/reference/contextuallyTypedClassExpressionMethodDeclaration02.js b/tests/baselines/reference/contextuallyTypedClassExpressionMethodDeclaration02.js index f4b90a49e6c84..38d1f4616f99c 100644 --- a/tests/baselines/reference/contextuallyTypedClassExpressionMethodDeclaration02.js +++ b/tests/baselines/reference/contextuallyTypedClassExpressionMethodDeclaration02.js @@ -52,6 +52,7 @@ function getFoo3(): Foo { } //// [contextuallyTypedClassExpressionMethodDeclaration02.js] +"use strict"; function getFoo1() { return class { method1(arg) { diff --git a/tests/baselines/reference/contextuallyTypedFunctionExpressionsAndReturnAnnotations.js b/tests/baselines/reference/contextuallyTypedFunctionExpressionsAndReturnAnnotations.js index 3a8abf0da50c4..9729ab8e66c9d 100644 --- a/tests/baselines/reference/contextuallyTypedFunctionExpressionsAndReturnAnnotations.js +++ b/tests/baselines/reference/contextuallyTypedFunctionExpressionsAndReturnAnnotations.js @@ -17,6 +17,7 @@ foo((y: string) => { }); //// [contextuallyTypedFunctionExpressionsAndReturnAnnotations.js] +"use strict"; // Contextually type the parameter even if there is a return annotation foo((y) => { var z = y.charAt(0); // Should be string diff --git a/tests/baselines/reference/contextuallyTypedGenericAssignment.js b/tests/baselines/reference/contextuallyTypedGenericAssignment.js index f7d6538138140..af400a890537d 100644 --- a/tests/baselines/reference/contextuallyTypedGenericAssignment.js +++ b/tests/baselines/reference/contextuallyTypedGenericAssignment.js @@ -8,5 +8,6 @@ function foo( foo((t, u: number) => t.a) //// [contextuallyTypedGenericAssignment.js] +"use strict"; function foo(arg) { } foo((t, u) => t.a); diff --git a/tests/baselines/reference/contextuallyTypedIife.js b/tests/baselines/reference/contextuallyTypedIife.js index e62c2fb85cbb1..1600afc79c29a 100644 --- a/tests/baselines/reference/contextuallyTypedIife.js +++ b/tests/baselines/reference/contextuallyTypedIife.js @@ -36,6 +36,7 @@ let eleven = (o => o.a(11))({ a: function(n) { return n; } }); //// [contextuallyTypedIife.js] +"use strict"; // arrow (jake => { })("build"); // function expression diff --git a/tests/baselines/reference/contextuallyTypedIifeStrict.errors.txt b/tests/baselines/reference/contextuallyTypedIifeStrict.errors.txt index 4f16f08ec2144..d1d1e3f056bfa 100644 --- a/tests/baselines/reference/contextuallyTypedIifeStrict.errors.txt +++ b/tests/baselines/reference/contextuallyTypedIifeStrict.errors.txt @@ -1,9 +1,11 @@ contextuallyTypedIifeStrict.ts(14,10): error TS18048: 'j' is possibly 'undefined'. contextuallyTypedIifeStrict.ts(15,10): error TS18048: 'k' is possibly 'undefined'. contextuallyTypedIifeStrict.ts(16,17): error TS18048: 'o' is possibly 'undefined'. +contextuallyTypedIifeStrict.ts(28,27): error TS7006: Parameter 'i' implicitly has an 'any' type. +contextuallyTypedIifeStrict.ts(29,43): error TS7006: Parameter 'n' implicitly has an 'any' type. -==== contextuallyTypedIifeStrict.ts (3 errors) ==== +==== contextuallyTypedIifeStrict.ts (5 errors) ==== // arrow (jake => { })("build"); // function expression @@ -38,7 +40,11 @@ contextuallyTypedIifeStrict.ts(16,17): error TS18048: 'o' is possibly 'undefined (({ u = 22 } = { u: 23 }) => u)(); // contextually typed parameters. let twelve = (f => f(12))(i => i); + ~ +!!! error TS7006: Parameter 'i' implicitly has an 'any' type. let eleven = (o => o.a(11))({ a: function(n) { return n; } }); + ~ +!!! error TS7006: Parameter 'n' implicitly has an 'any' type. // missing arguments (function(x, undefined) { return x; })(42); ((x, y, z) => 42)(); diff --git a/tests/baselines/reference/contextuallyTypedIifeStrict.js b/tests/baselines/reference/contextuallyTypedIifeStrict.js index b924a38606429..1b9ddc55fdb9a 100644 --- a/tests/baselines/reference/contextuallyTypedIifeStrict.js +++ b/tests/baselines/reference/contextuallyTypedIifeStrict.js @@ -36,6 +36,7 @@ let eleven = (o => o.a(11))({ a: function(n) { return n; } }); //// [contextuallyTypedIifeStrict.js] +"use strict"; // arrow (jake => { })("build"); // function expression diff --git a/tests/baselines/reference/contextuallyTypedJsxAttribute.js b/tests/baselines/reference/contextuallyTypedJsxAttribute.js index 4bf492cf17f6a..e65289f5b12a1 100644 --- a/tests/baselines/reference/contextuallyTypedJsxAttribute.js +++ b/tests/baselines/reference/contextuallyTypedJsxAttribute.js @@ -26,6 +26,7 @@ Test({ //// [index.jsx] +"use strict"; { }}/>; Test({ as: "bar", diff --git a/tests/baselines/reference/contextuallyTypedJsxAttribute.types b/tests/baselines/reference/contextuallyTypedJsxAttribute.types index 1abe776c0796d..f72f0d069ce5a 100644 --- a/tests/baselines/reference/contextuallyTypedJsxAttribute.types +++ b/tests/baselines/reference/contextuallyTypedJsxAttribute.types @@ -5,16 +5,16 @@ interface Elements { foo: { callback?: (value: number) => void }; >foo : { callback?: (value: number) => void; } > : ^^^^^^^^^^^^^ ^^^ ->callback : (value: number) => void -> : ^ ^^ ^^^^^ +>callback : ((value: number) => void) | undefined +> : ^^ ^^ ^^^^^ ^^^^^^^^^^^^^ >value : number > : ^^^^^^ bar: { callback?: (value: string) => void }; >bar : { callback?: (value: string) => void; } > : ^^^^^^^^^^^^^ ^^^ ->callback : (value: string) => void -> : ^ ^^ ^^^^^ +>callback : ((value: string) => void) | undefined +> : ^^ ^^ ^^^^^ ^^^^^^^^^^^^^ >value : string > : ^^^^^^ } @@ -22,8 +22,8 @@ interface Elements { type Props = { as?: C } & Elements[C]; >Props : Props > : ^^^^^^^^ ->as : C -> : ^ +>as : C | undefined +> : ^^^^^^^^^^^^^ declare function Test(props: Props): null; >Test : (props: Props) => null diff --git a/tests/baselines/reference/contextuallyTypedObjectLiteralMethodDeclaration01.js b/tests/baselines/reference/contextuallyTypedObjectLiteralMethodDeclaration01.js index e4d78a3716a37..cf85b46b883f9 100644 --- a/tests/baselines/reference/contextuallyTypedObjectLiteralMethodDeclaration01.js +++ b/tests/baselines/reference/contextuallyTypedObjectLiteralMethodDeclaration01.js @@ -48,6 +48,7 @@ function getFoo3(): Foo { } //// [contextuallyTypedObjectLiteralMethodDeclaration01.js] +"use strict"; function getFoo1() { return { method1(arg) { diff --git a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes01.js b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes01.js index 69a8bb39c51c9..02a150fb6a04c 100644 --- a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes01.js +++ b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes01.js @@ -19,6 +19,7 @@ const FooComponent = (props: { foo: "A" | "B" | "C" }) => {props.foo}; //// [contextuallyTypedStringLiteralsInJsxAttributes01.jsx] +"use strict"; const FooComponent = (props) => {props.foo}; ; ; diff --git a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt index 1e772a07b3bc7..f036b8ba53fc9 100644 --- a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt +++ b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt @@ -1,3 +1,5 @@ +file.tsx(25,16): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. +file.tsx(28,12): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. file.tsx(31,56): error TS2769: No overload matches this call. Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. @@ -26,13 +28,15 @@ file.tsx(34,13): error TS2769: No overload matches this call. Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. +file.tsx(36,69): error TS2322: Type 'undefined' is not assignable to type 'Element'. file.tsx(37,57): error TS2322: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. +file.tsx(39,66): error TS2322: Type 'undefined' is not assignable to type 'Element'. file.tsx(40,44): error TS2322: Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. -==== file.tsx (6 errors) ==== +==== file.tsx (10 errors) ==== /// import React = require('react') @@ -58,9 +62,15 @@ file.tsx(40,44): error TS2322: Type '{ extra: true; goTo: "home"; }' is not assi const linkProps = props as LinkProps; if(linkProps.goTo) { return this._buildMainLink(props); + ~~~~ +!!! error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. +!!! related TS2738 file.tsx:22:17: An outer value of 'this' is shadowed by this container. } return this._buildMainButton(props); + ~~~~ +!!! error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. +!!! related TS2738 file.tsx:22:17: An outer value of 'this' is shadowed by this container. } const b0 = {log(k)}}} extra />; // k has type "left" | "right" @@ -101,12 +111,16 @@ file.tsx(40,44): error TS2322: Type '{ extra: true; goTo: "home"; }' is not assi !!! error TS2769: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. export function NoOverload(buttonProps: ButtonProps): JSX.Element { return undefined } + ~~~~~~ +!!! error TS2322: Type 'undefined' is not assignable to type 'Element'. const c1 = {log(k)}}} extra />; // k has type any ~~~~~ !!! error TS2322: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. !!! error TS2322: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. export function NoOverload1(linkProps: LinkProps): JSX.Element { return undefined } + ~~~~~~ +!!! error TS2322: Type 'undefined' is not assignable to type 'Element'. const d1 = ; // goTo has type "home" | "contact" ~~~~~ !!! error TS2322: Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. diff --git a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.types b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.types index 82fa667abe5e8..6a9a1f2941299 100644 --- a/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.types +++ b/tests/baselines/reference/contextuallyTypedStringLiteralsInJsxAttributes02.types @@ -15,12 +15,12 @@ declare function log(...args: any[]): void; export interface ClickableProps { children?: string; ->children : string -> : ^^^^^^ +>children : string | undefined +> : ^^^^^^^^^^^^^^^^^^ className?: string; ->className : string -> : ^^^^^^ +>className : string | undefined +> : ^^^^^^^^^^^^^^^^^^ } export interface ButtonProps extends ClickableProps { diff --git a/tests/baselines/reference/contextuallyTypingOrOperator.js b/tests/baselines/reference/contextuallyTypingOrOperator.js index a568a48b4483f..a2530fae9ecab 100644 --- a/tests/baselines/reference/contextuallyTypingOrOperator.js +++ b/tests/baselines/reference/contextuallyTypingOrOperator.js @@ -9,6 +9,7 @@ var v3 = (s: string) => s.length || function (s: number) { return 1 }; var v4 = (s: number) => 1 || function (s: string) { return s.length }; //// [contextuallyTypingOrOperator.js] +"use strict"; var v = { a: s => s.length } || { a: s => 1 }; var v2 = (s) => s.length || function (s) { s.length; }; var v3 = (s) => s.length || function (s) { return 1; }; diff --git a/tests/baselines/reference/contextuallyTypingOrOperator2.js b/tests/baselines/reference/contextuallyTypingOrOperator2.js index 635b4548ba654..bf398e56fb24f 100644 --- a/tests/baselines/reference/contextuallyTypingOrOperator2.js +++ b/tests/baselines/reference/contextuallyTypingOrOperator2.js @@ -6,5 +6,6 @@ var v: { a: (_: string) => number } = { a: s => s.length } || { a: s => 1 }; var v2 = (s: string) => s.length || function (s) { s.aaa }; //// [contextuallyTypingOrOperator2.js] +"use strict"; var v = { a: s => s.length } || { a: s => 1 }; var v2 = (s) => s.length || function (s) { s.aaa; }; diff --git a/tests/baselines/reference/contextuallyTypingOrOperator3.js b/tests/baselines/reference/contextuallyTypingOrOperator3.js index 172de1b180492..561fc01f0612e 100644 --- a/tests/baselines/reference/contextuallyTypingOrOperator3.js +++ b/tests/baselines/reference/contextuallyTypingOrOperator3.js @@ -6,6 +6,7 @@ function foo(u: U) { } //// [contextuallyTypingOrOperator3.js] +"use strict"; function foo(u) { var x3 = u || u; } diff --git a/tests/baselines/reference/contextuallyTypingRestParameters.js b/tests/baselines/reference/contextuallyTypingRestParameters.js index 84eaccb5654c6..796f78431b9d4 100644 --- a/tests/baselines/reference/contextuallyTypingRestParameters.js +++ b/tests/baselines/reference/contextuallyTypingRestParameters.js @@ -10,6 +10,7 @@ var x: (...y: string[]) => void = function (.../*3*/y) { }; //// [contextuallyTypingRestParameters.js] +"use strict"; var x = function (... /*3*/y) { var t = y; var x2 = t; // This should be error diff --git a/tests/baselines/reference/continueInIterationStatement1.js b/tests/baselines/reference/continueInIterationStatement1.js index e20209775c79c..c15f0ccd0e1a2 100644 --- a/tests/baselines/reference/continueInIterationStatement1.js +++ b/tests/baselines/reference/continueInIterationStatement1.js @@ -6,6 +6,7 @@ while (true) { } //// [continueInIterationStatement1.js] +"use strict"; while (true) { continue; } diff --git a/tests/baselines/reference/continueInIterationStatement2.js b/tests/baselines/reference/continueInIterationStatement2.js index 2a0fbacef8653..2e47720f92805 100644 --- a/tests/baselines/reference/continueInIterationStatement2.js +++ b/tests/baselines/reference/continueInIterationStatement2.js @@ -7,6 +7,7 @@ do { while (true); //// [continueInIterationStatement2.js] +"use strict"; do { continue; } while (true); diff --git a/tests/baselines/reference/continueInIterationStatement3.js b/tests/baselines/reference/continueInIterationStatement3.js index 73c963da1f540..dcd0576c522b2 100644 --- a/tests/baselines/reference/continueInIterationStatement3.js +++ b/tests/baselines/reference/continueInIterationStatement3.js @@ -6,6 +6,7 @@ for (;;) { } //// [continueInIterationStatement3.js] +"use strict"; for (;;) { continue; } diff --git a/tests/baselines/reference/continueInIterationStatement4.js b/tests/baselines/reference/continueInIterationStatement4.js index 92c83ab1fe930..a05ee9de2ce6e 100644 --- a/tests/baselines/reference/continueInIterationStatement4.js +++ b/tests/baselines/reference/continueInIterationStatement4.js @@ -6,6 +6,7 @@ for (var i in something) { } //// [continueInIterationStatement4.js] +"use strict"; for (var i in something) { continue; } diff --git a/tests/baselines/reference/continueInLoopsWithCapturedBlockScopedBindings1(target=es2015).js b/tests/baselines/reference/continueInLoopsWithCapturedBlockScopedBindings1(target=es2015).js index 230b631027c90..d37b3197933bd 100644 --- a/tests/baselines/reference/continueInLoopsWithCapturedBlockScopedBindings1(target=es2015).js +++ b/tests/baselines/reference/continueInLoopsWithCapturedBlockScopedBindings1(target=es2015).js @@ -15,6 +15,7 @@ function foo() { } //// [continueInLoopsWithCapturedBlockScopedBindings1.js] +"use strict"; function foo() { for (const i of [0, 1]) { if (i === 0) { diff --git a/tests/baselines/reference/continueInLoopsWithCapturedBlockScopedBindings1(target=es5).js b/tests/baselines/reference/continueInLoopsWithCapturedBlockScopedBindings1(target=es5).js index 438c0e460400b..391ef3d3b15e1 100644 --- a/tests/baselines/reference/continueInLoopsWithCapturedBlockScopedBindings1(target=es5).js +++ b/tests/baselines/reference/continueInLoopsWithCapturedBlockScopedBindings1(target=es5).js @@ -15,6 +15,7 @@ function foo() { } //// [continueInLoopsWithCapturedBlockScopedBindings1.js] +"use strict"; function foo() { var _loop_1 = function (i) { if (i === 0) { diff --git a/tests/baselines/reference/continueLabel.js b/tests/baselines/reference/continueLabel.js index c3547801980e3..d324817ba58c5 100644 --- a/tests/baselines/reference/continueLabel.js +++ b/tests/baselines/reference/continueLabel.js @@ -6,6 +6,7 @@ label1: for(var i = 0; i < 1; i++) { } //// [continueLabel.js] +"use strict"; label1: for (var i = 0; i < 1; i++) { continue label1; } diff --git a/tests/baselines/reference/continueNotInIterationStatement1.js b/tests/baselines/reference/continueNotInIterationStatement1.js index 34438d25adc7f..dc761755bbf45 100644 --- a/tests/baselines/reference/continueNotInIterationStatement1.js +++ b/tests/baselines/reference/continueNotInIterationStatement1.js @@ -4,4 +4,5 @@ continue; //// [continueNotInIterationStatement1.js] +"use strict"; continue; diff --git a/tests/baselines/reference/continueNotInIterationStatement2.js b/tests/baselines/reference/continueNotInIterationStatement2.js index f3e458aca1686..28b6f74049afe 100644 --- a/tests/baselines/reference/continueNotInIterationStatement2.js +++ b/tests/baselines/reference/continueNotInIterationStatement2.js @@ -8,6 +8,7 @@ while (true) { } //// [continueNotInIterationStatement2.js] +"use strict"; while (true) { function f() { continue; diff --git a/tests/baselines/reference/continueNotInIterationStatement3.js b/tests/baselines/reference/continueNotInIterationStatement3.js index 58f035e9b8f0d..bf97dfc318782 100644 --- a/tests/baselines/reference/continueNotInIterationStatement3.js +++ b/tests/baselines/reference/continueNotInIterationStatement3.js @@ -7,6 +7,7 @@ switch (0) { } //// [continueNotInIterationStatement3.js] +"use strict"; switch (0) { default: continue; diff --git a/tests/baselines/reference/continueNotInIterationStatement4.js b/tests/baselines/reference/continueNotInIterationStatement4.js index b2c94a0fe579e..ca8a0045f339b 100644 --- a/tests/baselines/reference/continueNotInIterationStatement4.js +++ b/tests/baselines/reference/continueNotInIterationStatement4.js @@ -10,6 +10,7 @@ while (true){ //// [continueNotInIterationStatement4.js] +"use strict"; TWO: while (true) { var x = () => { continue TWO; diff --git a/tests/baselines/reference/continueStatementInternalComments.js b/tests/baselines/reference/continueStatementInternalComments.js index a47bf6e104c8e..37a179b5b292b 100644 --- a/tests/baselines/reference/continueStatementInternalComments.js +++ b/tests/baselines/reference/continueStatementInternalComments.js @@ -6,6 +6,7 @@ foo: for (;;) { } //// [continueStatementInternalComments.js] +"use strict"; foo: for (;;) { /*1*/ continue /*2*/ foo /*3*/; } diff --git a/tests/baselines/reference/continueTarget1.js b/tests/baselines/reference/continueTarget1.js index fefd57e8595db..3ec60bab40c6c 100644 --- a/tests/baselines/reference/continueTarget1.js +++ b/tests/baselines/reference/continueTarget1.js @@ -5,4 +5,5 @@ target: continue target; //// [continueTarget1.js] +"use strict"; target: continue target; diff --git a/tests/baselines/reference/continueTarget2.js b/tests/baselines/reference/continueTarget2.js index ae0f2a34aca2f..a54bfeed25dbf 100644 --- a/tests/baselines/reference/continueTarget2.js +++ b/tests/baselines/reference/continueTarget2.js @@ -7,6 +7,7 @@ while (true) { } //// [continueTarget2.js] +"use strict"; target: while (true) { continue target; } diff --git a/tests/baselines/reference/continueTarget3.js b/tests/baselines/reference/continueTarget3.js index a0872980415c6..00593d90411bf 100644 --- a/tests/baselines/reference/continueTarget3.js +++ b/tests/baselines/reference/continueTarget3.js @@ -8,6 +8,7 @@ while (true) { } //// [continueTarget3.js] +"use strict"; target1: target2: while (true) { continue target1; } diff --git a/tests/baselines/reference/continueTarget4.js b/tests/baselines/reference/continueTarget4.js index a93256fda4b64..b142efc1d7156 100644 --- a/tests/baselines/reference/continueTarget4.js +++ b/tests/baselines/reference/continueTarget4.js @@ -8,6 +8,7 @@ while (true) { } //// [continueTarget4.js] +"use strict"; target1: target2: while (true) { continue target2; } diff --git a/tests/baselines/reference/continueTarget5.js b/tests/baselines/reference/continueTarget5.js index 211bcded69e76..c8cf8bd2666a7 100644 --- a/tests/baselines/reference/continueTarget5.js +++ b/tests/baselines/reference/continueTarget5.js @@ -11,6 +11,7 @@ while (true) { } //// [continueTarget5.js] +"use strict"; target: while (true) { function f() { while (true) { diff --git a/tests/baselines/reference/continueTarget6.js b/tests/baselines/reference/continueTarget6.js index 1fb4aedf4b460..da7c31e38c175 100644 --- a/tests/baselines/reference/continueTarget6.js +++ b/tests/baselines/reference/continueTarget6.js @@ -6,6 +6,7 @@ while (true) { } //// [continueTarget6.js] +"use strict"; while (true) { continue target; } diff --git a/tests/baselines/reference/controlFlowAliasingCatchVariables(useunknownincatchvariables=false).js b/tests/baselines/reference/controlFlowAliasingCatchVariables(useunknownincatchvariables=false).js index b423d1e3ff536..ed47625540d47 100644 --- a/tests/baselines/reference/controlFlowAliasingCatchVariables(useunknownincatchvariables=false).js +++ b/tests/baselines/reference/controlFlowAliasingCatchVariables(useunknownincatchvariables=false).js @@ -30,6 +30,7 @@ catch (e) { //// [controlFlowAliasingCatchVariables.js] +"use strict"; try { } catch (e) { const isString = typeof e === 'string'; diff --git a/tests/baselines/reference/controlFlowAliasingCatchVariables(useunknownincatchvariables=true).errors.txt b/tests/baselines/reference/controlFlowAliasingCatchVariables(useunknownincatchvariables=true).errors.txt index 9d08d237be093..62381c6725245 100644 --- a/tests/baselines/reference/controlFlowAliasingCatchVariables(useunknownincatchvariables=true).errors.txt +++ b/tests/baselines/reference/controlFlowAliasingCatchVariables(useunknownincatchvariables=true).errors.txt @@ -1,4 +1,4 @@ -controlFlowAliasingCatchVariables.ts(20,11): error TS2339: Property 'toUpperCase' does not exist on type 'unknown'. +controlFlowAliasingCatchVariables.ts(20,9): error TS18046: 'e' is of type 'unknown'. ==== controlFlowAliasingCatchVariables.ts (1 errors) ==== @@ -22,8 +22,8 @@ controlFlowAliasingCatchVariables.ts(20,11): error TS2339: Property 'toUpperCase if (isString) { e.toUpperCase(); // e any/unknown - ~~~~~~~~~~~ -!!! error TS2339: Property 'toUpperCase' does not exist on type 'unknown'. + ~ +!!! error TS18046: 'e' is of type 'unknown'. } if (typeof e === 'string') { diff --git a/tests/baselines/reference/controlFlowAliasingCatchVariables(useunknownincatchvariables=true).js b/tests/baselines/reference/controlFlowAliasingCatchVariables(useunknownincatchvariables=true).js index b423d1e3ff536..ed47625540d47 100644 --- a/tests/baselines/reference/controlFlowAliasingCatchVariables(useunknownincatchvariables=true).js +++ b/tests/baselines/reference/controlFlowAliasingCatchVariables(useunknownincatchvariables=true).js @@ -30,6 +30,7 @@ catch (e) { //// [controlFlowAliasingCatchVariables.js] +"use strict"; try { } catch (e) { const isString = typeof e === 'string'; diff --git a/tests/baselines/reference/controlFlowArrayErrors.js b/tests/baselines/reference/controlFlowArrayErrors.js index 3708ef234157b..641ea84310d7b 100644 --- a/tests/baselines/reference/controlFlowArrayErrors.js +++ b/tests/baselines/reference/controlFlowArrayErrors.js @@ -68,6 +68,7 @@ function f8() { } //// [controlFlowArrayErrors.js] +"use strict"; function f1() { let x = []; // Implicit any[] error in some locations let y = x; // Implicit any[] error diff --git a/tests/baselines/reference/controlFlowArrayErrors.types b/tests/baselines/reference/controlFlowArrayErrors.types index 67db9264a78a6..46647cfcc2bcc 100644 --- a/tests/baselines/reference/controlFlowArrayErrors.types +++ b/tests/baselines/reference/controlFlowArrayErrors.types @@ -12,8 +12,8 @@ function f1() { let x = []; // Implicit any[] error in some locations >x : any[] > : ^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ let y = x; // Implicit any[] error >y : any[] @@ -49,12 +49,12 @@ function f2() { > : ^^^ x = []; ->x = [] : undefined[] -> : ^^^^^^^^^^^ +>x = [] : never[] +> : ^^^^^^^ >x : any > : ^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ let y = x; // Implicit any[] error >y : any[] @@ -88,8 +88,8 @@ function f3() { let x = []; // Implicit any[] error in some locations >x : any[] > : ^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ x.push(5); >x.push(5) : number @@ -188,12 +188,12 @@ function f6() { > : ^^^^^^ x = []; ->x = [] : undefined[] -> : ^^^^^^^^^^^ +>x = [] : never[] +> : ^^^^^^^ >x : any > : ^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ x.push(5); >x.push(5) : number @@ -254,8 +254,8 @@ function f7() { let x = []; // x has evolving array value >x : any[] > : ^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ x.push(5); >x.push(5) : number @@ -307,8 +307,8 @@ function f8() { const x = []; // Implicit any[] error in some locations >x : any[] > : ^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ x.push(5); >x.push(5) : number diff --git a/tests/baselines/reference/controlFlowArrays.js b/tests/baselines/reference/controlFlowArrays.js index 84e16f33d40b7..cf19714e560ec 100644 --- a/tests/baselines/reference/controlFlowArrays.js +++ b/tests/baselines/reference/controlFlowArrays.js @@ -190,6 +190,7 @@ foo(arr); //// [controlFlowArrays.js] +"use strict"; function f1() { let x = []; x[0] = 5; diff --git a/tests/baselines/reference/controlFlowAssignmentExpression.js b/tests/baselines/reference/controlFlowAssignmentExpression.js index 2a8c8bad15931..f5d3e0c23b4f5 100644 --- a/tests/baselines/reference/controlFlowAssignmentExpression.js +++ b/tests/baselines/reference/controlFlowAssignmentExpression.js @@ -21,6 +21,7 @@ if ((o = fn()).done) { } //// [controlFlowAssignmentExpression.js] +"use strict"; let x; let obj; x = ""; diff --git a/tests/baselines/reference/controlFlowBinaryAndExpression.errors.txt b/tests/baselines/reference/controlFlowBinaryAndExpression.errors.txt new file mode 100644 index 0000000000000..d3d95910caf09 --- /dev/null +++ b/tests/baselines/reference/controlFlowBinaryAndExpression.errors.txt @@ -0,0 +1,16 @@ +controlFlowBinaryAndExpression.ts(8,1): error TS2454: Variable 'cond' is used before being assigned. + + +==== controlFlowBinaryAndExpression.ts (1 errors) ==== + let x: string | number | boolean; + let cond: boolean; + + (x = "") && (x = 0); + x; // string | number + + x = ""; + cond && (x = 0); + ~~~~ +!!! error TS2454: Variable 'cond' is used before being assigned. + x; // string | number + \ No newline at end of file diff --git a/tests/baselines/reference/controlFlowBinaryAndExpression.js b/tests/baselines/reference/controlFlowBinaryAndExpression.js index 2c0b188a10bfa..05a3587529741 100644 --- a/tests/baselines/reference/controlFlowBinaryAndExpression.js +++ b/tests/baselines/reference/controlFlowBinaryAndExpression.js @@ -13,6 +13,7 @@ x; // string | number //// [controlFlowBinaryAndExpression.js] +"use strict"; let x; let cond; (x = "") && (x = 0); diff --git a/tests/baselines/reference/controlFlowBinaryAndExpression.types b/tests/baselines/reference/controlFlowBinaryAndExpression.types index 79a0e5789e5dc..a28d3ef67342b 100644 --- a/tests/baselines/reference/controlFlowBinaryAndExpression.types +++ b/tests/baselines/reference/controlFlowBinaryAndExpression.types @@ -42,8 +42,8 @@ x = ""; > : ^^ cond && (x = 0); ->cond && (x = 0) : 0 -> : ^ +>cond && (x = 0) : false | 0 +> : ^^^^^^^^^ >cond : boolean > : ^^^^^^^ >(x = 0) : 0 diff --git a/tests/baselines/reference/controlFlowBinaryOrExpression.errors.txt b/tests/baselines/reference/controlFlowBinaryOrExpression.errors.txt new file mode 100644 index 0000000000000..dbbbc995f1e67 --- /dev/null +++ b/tests/baselines/reference/controlFlowBinaryOrExpression.errors.txt @@ -0,0 +1,42 @@ +controlFlowBinaryOrExpression.ts(8,1): error TS2454: Variable 'cond' is used before being assigned. + + +==== controlFlowBinaryOrExpression.ts (1 errors) ==== + let x: string | number | boolean; + let cond: boolean; + + (x = "") || (x = 0); + x; // string | number + + x = ""; + cond || (x = 0); + ~~~~ +!!! error TS2454: Variable 'cond' is used before being assigned. + x; // string | number + + export interface NodeList { + length: number; + } + + export interface HTMLCollection { + length: number; + } + + declare function isNodeList(sourceObj: any): sourceObj is NodeList; + declare function isHTMLCollection(sourceObj: any): sourceObj is HTMLCollection; + + type EventTargetLike = {a: string} | HTMLCollection | NodeList; + + var sourceObj: EventTargetLike = undefined; + if (isNodeList(sourceObj)) { + sourceObj.length; + } + + if (isHTMLCollection(sourceObj)) { + sourceObj.length; + } + + if (isNodeList(sourceObj) || isHTMLCollection(sourceObj)) { + sourceObj.length; + } + \ No newline at end of file diff --git a/tests/baselines/reference/controlFlowBinaryOrExpression.types b/tests/baselines/reference/controlFlowBinaryOrExpression.types index f55bbee8f7936..5adf56fed9413 100644 --- a/tests/baselines/reference/controlFlowBinaryOrExpression.types +++ b/tests/baselines/reference/controlFlowBinaryOrExpression.types @@ -75,11 +75,13 @@ declare function isNodeList(sourceObj: any): sourceObj is NodeList; >isNodeList : (sourceObj: any) => sourceObj is NodeList > : ^ ^^ ^^^^^ >sourceObj : any +> : ^^^ declare function isHTMLCollection(sourceObj: any): sourceObj is HTMLCollection; >isHTMLCollection : (sourceObj: any) => sourceObj is HTMLCollection > : ^ ^^ ^^^^^ >sourceObj : any +> : ^^^ type EventTargetLike = {a: string} | HTMLCollection | NodeList; >EventTargetLike : EventTargetLike @@ -91,6 +93,7 @@ var sourceObj: EventTargetLike = undefined; >sourceObj : EventTargetLike > : ^^^^^^^^^^^^^^^ >undefined : any +> : ^^^ >undefined : undefined > : ^^^^^^^^^ diff --git a/tests/baselines/reference/controlFlowBindingElement.js b/tests/baselines/reference/controlFlowBindingElement.js index 5213b1c10d841..70627f81f3027 100644 --- a/tests/baselines/reference/controlFlowBindingElement.js +++ b/tests/baselines/reference/controlFlowBindingElement.js @@ -92,6 +92,7 @@ //// [controlFlowBindingElement.js] +"use strict"; { const data = { param: 'value' }; const { param = (() => { throw new Error('param is not defined'); })(), } = data; diff --git a/tests/baselines/reference/controlFlowCaching.js b/tests/baselines/reference/controlFlowCaching.js index c6e523456ca4b..0cba7b0289b4b 100644 --- a/tests/baselines/reference/controlFlowCaching.js +++ b/tests/baselines/reference/controlFlowCaching.js @@ -70,6 +70,7 @@ function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { //// [controlFlowCaching.js] +"use strict"; // Repro for #8401 function f(dim, offsets, arr, acommon, centerAnchorLimit, g, has, lin) { var isRtl = this._isRtl(); // chart mirroring diff --git a/tests/baselines/reference/controlFlowCommaExpressionAssertionMultiple.js b/tests/baselines/reference/controlFlowCommaExpressionAssertionMultiple.js index bec208faba042..3307d11a5d8d1 100644 --- a/tests/baselines/reference/controlFlowCommaExpressionAssertionMultiple.js +++ b/tests/baselines/reference/controlFlowCommaExpressionAssertionMultiple.js @@ -18,6 +18,7 @@ function func2(foo: any, bar: any, baz: any) { //// [controlFlowCommaExpressionAssertionMultiple.js] +"use strict"; function Narrow(value) { } function func(foo, bar) { Narrow(foo), Narrow(bar); diff --git a/tests/baselines/reference/controlFlowCommaExpressionFunctionCall.js b/tests/baselines/reference/controlFlowCommaExpressionFunctionCall.js index 5faaa4c6f358a..fcab0dcdca214 100644 --- a/tests/baselines/reference/controlFlowCommaExpressionFunctionCall.js +++ b/tests/baselines/reference/controlFlowCommaExpressionFunctionCall.js @@ -14,6 +14,7 @@ if (isNumber((otherValue(), value))) { } //// [controlFlowCommaExpressionFunctionCall.js] +"use strict"; const otherValue = () => true; const value = null; function isNumber(obj) { diff --git a/tests/baselines/reference/controlFlowCommaOperator.js b/tests/baselines/reference/controlFlowCommaOperator.js index 74aa2b8a09783..9dacd230b2c64 100644 --- a/tests/baselines/reference/controlFlowCommaOperator.js +++ b/tests/baselines/reference/controlFlowCommaOperator.js @@ -26,6 +26,7 @@ function f(x: string | number | boolean) { //// [controlFlowCommaOperator.js] +"use strict"; function f(x) { let y = false; let z = false; diff --git a/tests/baselines/reference/controlFlowConditionalExpression.errors.txt b/tests/baselines/reference/controlFlowConditionalExpression.errors.txt new file mode 100644 index 0000000000000..49defe6d84100 --- /dev/null +++ b/tests/baselines/reference/controlFlowConditionalExpression.errors.txt @@ -0,0 +1,12 @@ +controlFlowConditionalExpression.ts(4,1): error TS2454: Variable 'cond' is used before being assigned. + + +==== controlFlowConditionalExpression.ts (1 errors) ==== + let x: string | number | boolean; + let cond: boolean; + + cond ? x = "" : x = 3; + ~~~~ +!!! error TS2454: Variable 'cond' is used before being assigned. + x; // string | number + \ No newline at end of file diff --git a/tests/baselines/reference/controlFlowConditionalExpression.js b/tests/baselines/reference/controlFlowConditionalExpression.js index ba7dd3669f0df..1cb491e8e1b6c 100644 --- a/tests/baselines/reference/controlFlowConditionalExpression.js +++ b/tests/baselines/reference/controlFlowConditionalExpression.js @@ -9,6 +9,7 @@ x; // string | number //// [controlFlowConditionalExpression.js] +"use strict"; let x; let cond; cond ? x = "" : x = 3; diff --git a/tests/baselines/reference/controlFlowDeleteOperator.errors.txt b/tests/baselines/reference/controlFlowDeleteOperator.errors.txt index 61f5f1df52263..5bdb63f7a6957 100644 --- a/tests/baselines/reference/controlFlowDeleteOperator.errors.txt +++ b/tests/baselines/reference/controlFlowDeleteOperator.errors.txt @@ -1,8 +1,9 @@ controlFlowDeleteOperator.ts(10,12): error TS2790: The operand of a 'delete' operator must be optional. +controlFlowDeleteOperator.ts(14,12): error TS1102: 'delete' cannot be called on an identifier in strict mode. controlFlowDeleteOperator.ts(14,12): error TS2703: The operand of a 'delete' operator must be a property reference. -==== controlFlowDeleteOperator.ts (2 errors) ==== +==== controlFlowDeleteOperator.ts (3 errors) ==== function f() { let x: { a?: number | string, b: number | string } = { b: 1 }; x.a; @@ -20,6 +21,8 @@ controlFlowDeleteOperator.ts(14,12): error TS2703: The operand of a 'delete' ope x; delete x; // No effect ~ +!!! error TS1102: 'delete' cannot be called on an identifier in strict mode. + ~ !!! error TS2703: The operand of a 'delete' operator must be a property reference. x; } \ No newline at end of file diff --git a/tests/baselines/reference/controlFlowDeleteOperator.js b/tests/baselines/reference/controlFlowDeleteOperator.js index 1bdf1dc8012a7..d584aeea42e0e 100644 --- a/tests/baselines/reference/controlFlowDeleteOperator.js +++ b/tests/baselines/reference/controlFlowDeleteOperator.js @@ -19,6 +19,7 @@ function f() { } //// [controlFlowDeleteOperator.js] +"use strict"; function f() { let x = { b: 1 }; x.a; diff --git a/tests/baselines/reference/controlFlowDestructuringDeclaration.js b/tests/baselines/reference/controlFlowDestructuringDeclaration.js index 3ea186b5430ab..d63f8b4b399dd 100644 --- a/tests/baselines/reference/controlFlowDestructuringDeclaration.js +++ b/tests/baselines/reference/controlFlowDestructuringDeclaration.js @@ -61,6 +61,7 @@ function f7() { //// [controlFlowDestructuringDeclaration.js] +"use strict"; function f1() { let x = 1; x; diff --git a/tests/baselines/reference/controlFlowDestructuringParameters.js b/tests/baselines/reference/controlFlowDestructuringParameters.js index ff59ca1d7c45f..4e126c5bfff20 100644 --- a/tests/baselines/reference/controlFlowDestructuringParameters.js +++ b/tests/baselines/reference/controlFlowDestructuringParameters.js @@ -10,5 +10,6 @@ //// [controlFlowDestructuringParameters.js] +"use strict"; // Repro for #8376 [{ x: 1 }].map(({ x }) => x); diff --git a/tests/baselines/reference/controlFlowDoWhileStatement.errors.txt b/tests/baselines/reference/controlFlowDoWhileStatement.errors.txt new file mode 100644 index 0000000000000..d780ddfcd8cd6 --- /dev/null +++ b/tests/baselines/reference/controlFlowDoWhileStatement.errors.txt @@ -0,0 +1,83 @@ +controlFlowDoWhileStatement.ts(23,9): error TS2322: Type 'undefined' is not assignable to type 'string | number'. + + +==== controlFlowDoWhileStatement.ts (1 errors) ==== + let cond: boolean; + function a() { + let x: string | number; + x = ""; + do { + x; // string + } while (cond) + } + function b() { + let x: string | number; + x = ""; + do { + x; // string + x = 42; + break; + } while (cond) + } + function c() { + let x: string | number; + x = ""; + do { + x; // string + x = undefined; + ~ +!!! error TS2322: Type 'undefined' is not assignable to type 'string | number'. + if (typeof x === "string") continue; + break; + } while (cond) + } + function d() { + let x: string | number; + x = 1000; + do { + x; // number + x = ""; + } while (x = x.length) + x; // number + } + function e() { + let x: string | number; + x = ""; + do { + x = 42; + } while (cond) + x; // number + } + function f() { + let x: string | number | boolean | RegExp | Function; + x = ""; + do { + if (cond) { + x = 42; + break; + } + if (cond) { + x = true; + continue; + } + x = /a/; + } while (cond) + x; // number | boolean | RegExp + } + function g() { + let x: string | number | boolean | RegExp | Function; + x = ""; + do { + if (cond) { + x = 42; + break; + } + if (cond) { + x = true; + continue; + } + x = /a/; + } while (true) + x; // number + } + \ No newline at end of file diff --git a/tests/baselines/reference/controlFlowDoWhileStatement.js b/tests/baselines/reference/controlFlowDoWhileStatement.js index a653f185ce6e1..ac3cf75422bb3 100644 --- a/tests/baselines/reference/controlFlowDoWhileStatement.js +++ b/tests/baselines/reference/controlFlowDoWhileStatement.js @@ -80,6 +80,7 @@ function g() { //// [controlFlowDoWhileStatement.js] +"use strict"; let cond; function a() { let x; diff --git a/tests/baselines/reference/controlFlowDoWhileStatement.types b/tests/baselines/reference/controlFlowDoWhileStatement.types index baa781f6bba5b..3456001c3fac0 100644 --- a/tests/baselines/reference/controlFlowDoWhileStatement.types +++ b/tests/baselines/reference/controlFlowDoWhileStatement.types @@ -218,8 +218,8 @@ function f() { break; } if (cond) { ->cond : boolean -> : ^^^^^^^ +>cond : false +> : ^^^^^ x = true; >x = true : true @@ -240,8 +240,8 @@ function f() { > : ^^^^^^ } while (cond) ->cond : boolean -> : ^^^^^^^ +>cond : false +> : ^^^^^ x; // number | boolean | RegExp >x : number | true | RegExp @@ -279,8 +279,8 @@ function g() { break; } if (cond) { ->cond : boolean -> : ^^^^^^^ +>cond : false +> : ^^^^^ x = true; >x = true : true diff --git a/tests/baselines/reference/controlFlowElementAccess.js b/tests/baselines/reference/controlFlowElementAccess.js index 45acac0b680af..1c3275a93626e 100644 --- a/tests/baselines/reference/controlFlowElementAccess.js +++ b/tests/baselines/reference/controlFlowElementAccess.js @@ -13,6 +13,7 @@ if (y[0] === 0) { //// [controlFlowElementAccess.js] +"use strict"; let x = { o: false }; if (x['o'] === false) { x['o'] = true; diff --git a/tests/baselines/reference/controlFlowForCompoundAssignmentToThisMember.js b/tests/baselines/reference/controlFlowForCompoundAssignmentToThisMember.js index 35bdc2be08be2..e01ed60dc51df 100644 --- a/tests/baselines/reference/controlFlowForCompoundAssignmentToThisMember.js +++ b/tests/baselines/reference/controlFlowForCompoundAssignmentToThisMember.js @@ -21,6 +21,7 @@ class DatasourceCommandWidgetElement { } //// [controlFlowForCompoundAssignmentToThisMember.js] +"use strict"; class DatasourceCommandWidgetElement { constructor(target) { if (target instanceof DatasourceCommandWidgetElement) { diff --git a/tests/baselines/reference/controlFlowForInStatement.errors.txt b/tests/baselines/reference/controlFlowForInStatement.errors.txt new file mode 100644 index 0000000000000..e9c1b5aaddc99 --- /dev/null +++ b/tests/baselines/reference/controlFlowForInStatement.errors.txt @@ -0,0 +1,27 @@ +controlFlowForInStatement.ts(8,9): error TS2454: Variable 'cond' is used before being assigned. +controlFlowForInStatement.ts(12,9): error TS2454: Variable 'cond' is used before being assigned. + + +==== controlFlowForInStatement.ts (2 errors) ==== + let x: string | number | boolean | RegExp | Function; + let obj: any; + let cond: boolean; + + x = /a/; + for (let y in obj) { + x = y; + if (cond) { + ~~~~ +!!! error TS2454: Variable 'cond' is used before being assigned. + x = 42; + continue; + } + if (cond) { + ~~~~ +!!! error TS2454: Variable 'cond' is used before being assigned. + x = true; + break; + } + } + x; // RegExp | string | number | boolean + \ No newline at end of file diff --git a/tests/baselines/reference/controlFlowForInStatement.js b/tests/baselines/reference/controlFlowForInStatement.js index b1bd28cd32db3..a38d2f8a2fb81 100644 --- a/tests/baselines/reference/controlFlowForInStatement.js +++ b/tests/baselines/reference/controlFlowForInStatement.js @@ -21,6 +21,7 @@ x; // RegExp | string | number | boolean //// [controlFlowForInStatement.js] +"use strict"; let x; let obj; let cond; diff --git a/tests/baselines/reference/controlFlowForInStatement.types b/tests/baselines/reference/controlFlowForInStatement.types index 2b67fb6b35866..ec4e6108dbf13 100644 --- a/tests/baselines/reference/controlFlowForInStatement.types +++ b/tests/baselines/reference/controlFlowForInStatement.types @@ -7,6 +7,7 @@ let x: string | number | boolean | RegExp | Function; let obj: any; >obj : any +> : ^^^ let cond: boolean; >cond : boolean @@ -24,6 +25,7 @@ for (let y in obj) { >y : string > : ^^^^^^ >obj : any +> : ^^^ x = y; >x = y : string diff --git a/tests/baselines/reference/controlFlowForInStatement2.js b/tests/baselines/reference/controlFlowForInStatement2.js index 9f17a8358bbd3..dccd74382f7dc 100644 --- a/tests/baselines/reference/controlFlowForInStatement2.js +++ b/tests/baselines/reference/controlFlowForInStatement2.js @@ -28,6 +28,7 @@ if ((stringB as ('a' | 'b')) in c) { } //// [controlFlowForInStatement2.js] +"use strict"; const keywordA = 'a'; const keywordB = 'b'; if ('a' in c) { diff --git a/tests/baselines/reference/controlFlowForIndexSignatures.js b/tests/baselines/reference/controlFlowForIndexSignatures.js index ed2819509b77c..6e2e57e299077 100644 --- a/tests/baselines/reference/controlFlowForIndexSignatures.js +++ b/tests/baselines/reference/controlFlowForIndexSignatures.js @@ -25,6 +25,7 @@ if (typeof c === 'string') { //// [controlFlowForIndexSignatures.js] +"use strict"; const boo = { bar: 'bar' }; function a(aboo1) { if (!aboo1) diff --git a/tests/baselines/reference/controlFlowForOfStatement.js b/tests/baselines/reference/controlFlowForOfStatement.js index 7b5685c7734a9..902af9f607f74 100644 --- a/tests/baselines/reference/controlFlowForOfStatement.js +++ b/tests/baselines/reference/controlFlowForOfStatement.js @@ -14,6 +14,7 @@ function a() { //// [controlFlowForOfStatement.js] +"use strict"; let obj; let x; function a() { diff --git a/tests/baselines/reference/controlFlowForStatement.errors.txt b/tests/baselines/reference/controlFlowForStatement.errors.txt index 35f0c92c9b24f..ec3e6e219f923 100644 --- a/tests/baselines/reference/controlFlowForStatement.errors.txt +++ b/tests/baselines/reference/controlFlowForStatement.errors.txt @@ -1,8 +1,12 @@ controlFlowForStatement.ts(29,14): error TS2873: This kind of expression is always falsy. controlFlowForStatement.ts(29,50): error TS2873: This kind of expression is always falsy. +controlFlowForStatement.ts(35,19): error TS2454: Variable 'x' is used before being assigned. +controlFlowForStatement.ts(36,9): error TS2454: Variable 'x' is used before being assigned. +controlFlowForStatement.ts(37,20): error TS2454: Variable 'x' is used before being assigned. +controlFlowForStatement.ts(38,9): error TS2322: Type 'undefined' is not assignable to type 'string | number | boolean'. -==== controlFlowForStatement.ts (2 errors) ==== +==== controlFlowForStatement.ts (6 errors) ==== declare let cond: boolean; function a() { let x: string | number | boolean; @@ -42,9 +46,17 @@ controlFlowForStatement.ts(29,50): error TS2873: This kind of expression is alwa function f() { let x: string | number | boolean; for (; typeof x !== "string";) { + ~ +!!! error TS2454: Variable 'x' is used before being assigned. x; // number | boolean + ~ +!!! error TS2454: Variable 'x' is used before being assigned. if (typeof x === "number") break; + ~ +!!! error TS2454: Variable 'x' is used before being assigned. x = undefined; + ~ +!!! error TS2322: Type 'undefined' is not assignable to type 'string | number | boolean'. } x; // string | number } diff --git a/tests/baselines/reference/controlFlowForStatement.js b/tests/baselines/reference/controlFlowForStatement.js index b5713535528d1..a75ab8ff01e81 100644 --- a/tests/baselines/reference/controlFlowForStatement.js +++ b/tests/baselines/reference/controlFlowForStatement.js @@ -45,6 +45,7 @@ function f() { //// [controlFlowForStatement.js] +"use strict"; function a() { let x; for (x = ""; cond; x = 5) { diff --git a/tests/baselines/reference/controlFlowForStatement.types b/tests/baselines/reference/controlFlowForStatement.types index 1bf8358a4a5cd..b796e9dc98055 100644 --- a/tests/baselines/reference/controlFlowForStatement.types +++ b/tests/baselines/reference/controlFlowForStatement.types @@ -211,16 +211,16 @@ function f() { > : ^^^^^^^^ x; // number | boolean ->x : number | boolean -> : ^^^^^^^^^^^^^^^^ +>x : string | number | boolean +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ if (typeof x === "number") break; >typeof x === "number" : boolean > : ^^^^^^^ >typeof x : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->x : number | boolean -> : ^^^^^^^^^^^^^^^^ +>x : string | number | boolean +> : ^^^^^^^^^^^^^^^^^^^^^^^^^ >"number" : "number" > : ^^^^^^^^ diff --git a/tests/baselines/reference/controlFlowIIFE.js b/tests/baselines/reference/controlFlowIIFE.js index cb43a24c4ba6e..1a9ff046a7339 100644 --- a/tests/baselines/reference/controlFlowIIFE.js +++ b/tests/baselines/reference/controlFlowIIFE.js @@ -76,6 +76,7 @@ function f6() { } //// [controlFlowIIFE.js] +"use strict"; function f1() { let x = getStringOrNumber(); if (typeof x === "string") { diff --git a/tests/baselines/reference/controlFlowIfStatement.js b/tests/baselines/reference/controlFlowIfStatement.js index 09bdfadffa24c..4e8e8964f8e25 100644 --- a/tests/baselines/reference/controlFlowIfStatement.js +++ b/tests/baselines/reference/controlFlowIfStatement.js @@ -65,6 +65,7 @@ function e(x: I<"A" | "B">) { //// [controlFlowIfStatement.js] +"use strict"; let x; let cond; x = /a/; diff --git a/tests/baselines/reference/controlFlowIfStatement.types b/tests/baselines/reference/controlFlowIfStatement.types index 823f3de5f6795..4d5ec19d2c3d4 100644 --- a/tests/baselines/reference/controlFlowIfStatement.types +++ b/tests/baselines/reference/controlFlowIfStatement.types @@ -45,8 +45,8 @@ if (x /* RegExp */, (x = true)) { } else { x; // boolean ->x : true -> : ^^^^ +>x : never +> : ^^^^^ x = 42; >x = 42 : 42 diff --git a/tests/baselines/reference/controlFlowInOperator.js b/tests/baselines/reference/controlFlowInOperator.js index cba99512fa38f..f6f379a02e38c 100644 --- a/tests/baselines/reference/controlFlowInOperator.js +++ b/tests/baselines/reference/controlFlowInOperator.js @@ -69,6 +69,7 @@ function uniqueID_54790_3(id: string | number, seenIDs: object) { //// [controlFlowInOperator.js] +"use strict"; const a = 'a'; const b = 'b'; const d = 'd'; diff --git a/tests/baselines/reference/controlFlowInOperator.types b/tests/baselines/reference/controlFlowInOperator.types index fb9c7f67b404c..0a5c5e0787640 100644 --- a/tests/baselines/reference/controlFlowInOperator.types +++ b/tests/baselines/reference/controlFlowInOperator.types @@ -114,8 +114,8 @@ function uniqueID_54790( > : ^ ^^ ^^ ^^ ^^^^^ id: string | undefined, ->id : string -> : ^^^^^^ +>id : string | undefined +> : ^^^^^^^^^^^^^^^^^^ seenIDs: { [key: string]: string } >seenIDs : { [key: string]: string; } @@ -127,16 +127,16 @@ function uniqueID_54790( if (id === undefined) { >id === undefined : boolean > : ^^^^^^^ ->id : string -> : ^^^^^^ +>id : string | undefined +> : ^^^^^^^^^^^^^^^^^^ >undefined : undefined > : ^^^^^^^^^ id = "1"; >id = "1" : "1" > : ^^^ ->id : string -> : ^^^^^^ +>id : string | undefined +> : ^^^^^^^^^^^^^^^^^^ >"1" : "1" > : ^^^ } diff --git a/tests/baselines/reference/controlFlowInstanceOfGuardPrimitives.js b/tests/baselines/reference/controlFlowInstanceOfGuardPrimitives.js index 4d3e10a5b9fd4..982cca610e513 100644 --- a/tests/baselines/reference/controlFlowInstanceOfGuardPrimitives.js +++ b/tests/baselines/reference/controlFlowInstanceOfGuardPrimitives.js @@ -16,6 +16,7 @@ distinguish("beef"); distinguish(3.14159265); //// [controlFlowInstanceOfGuardPrimitives.js] +"use strict"; function distinguish(thing) { if (thing instanceof Object) { console.log("Aha!! It's a Date in " + thing.getFullYear()); diff --git a/tests/baselines/reference/controlFlowInstanceofWithSymbolHasInstance.symbols b/tests/baselines/reference/controlFlowInstanceofWithSymbolHasInstance.symbols index a2bfbc3676c8e..bd011d2155f4c 100644 --- a/tests/baselines/reference/controlFlowInstanceofWithSymbolHasInstance.symbols +++ b/tests/baselines/reference/controlFlowInstanceofWithSymbolHasInstance.symbols @@ -161,14 +161,14 @@ class A { never ) { return Function.prototype[Symbol.hasInstance].call(this, value); ->Function.prototype[Symbol.hasInstance].call : Symbol(Function.call, Decl(lib.es5.d.ts, --, --)) +>Function.prototype[Symbol.hasInstance].call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) >Function.prototype : Symbol(FunctionConstructor.prototype, Decl(lib.es5.d.ts, --, --)) >Function : Symbol(Function, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >prototype : Symbol(FunctionConstructor.prototype, Decl(lib.es5.d.ts, --, --)) >Symbol.hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->call : Symbol(Function.call, Decl(lib.es5.d.ts, --, --)) +>call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) >this : Symbol(this, Decl(controlFlowInstanceofWithSymbolHasInstance.ts, 53, 35)) >value : Symbol(value, Decl(controlFlowInstanceofWithSymbolHasInstance.ts, 53, 43)) } diff --git a/tests/baselines/reference/controlFlowInstanceofWithSymbolHasInstance.types b/tests/baselines/reference/controlFlowInstanceofWithSymbolHasInstance.types index 949d9c5798bed..41cede40f0ab3 100644 --- a/tests/baselines/reference/controlFlowInstanceofWithSymbolHasInstance.types +++ b/tests/baselines/reference/controlFlowInstanceofWithSymbolHasInstance.types @@ -225,9 +225,10 @@ class A { never ) { return Function.prototype[Symbol.hasInstance].call(this, value); ->Function.prototype[Symbol.hasInstance].call(this, value) : any ->Function.prototype[Symbol.hasInstance].call : (this: Function, thisArg: any, ...argArray: any[]) => any -> : ^ ^^ ^^ ^^ ^^^^^ ^^ ^^^^^ +>Function.prototype[Symbol.hasInstance].call(this, value) : boolean +> : ^^^^^^^ +>Function.prototype[Symbol.hasInstance].call : (this: (this: T_1, ...args: A) => R, thisArg: T_1, ...args: A) => R +> : ^^^^^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^^^^ ^^ ^^^^^ >Function.prototype[Symbol.hasInstance] : (value: any) => boolean > : ^ ^^ ^^^^^ >Function.prototype : Function @@ -242,8 +243,8 @@ class A { > : ^^^^^^^^^^^^^^^^^ >hasInstance : unique symbol > : ^^^^^^^^^^^^^ ->call : (this: Function, thisArg: any, ...argArray: any[]) => any -> : ^ ^^ ^^ ^^ ^^^^^ ^^ ^^^^^ +>call : (this: (this: T_1, ...args: A) => R, thisArg: T_1, ...args: A) => R +> : ^^^^^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^^^^ ^^ ^^^^^ >this : T > : ^ >value : unknown diff --git a/tests/baselines/reference/controlFlowIteration.js b/tests/baselines/reference/controlFlowIteration.js index 0ad856023b3d8..4ee3a9f508c6c 100644 --- a/tests/baselines/reference/controlFlowIteration.js +++ b/tests/baselines/reference/controlFlowIteration.js @@ -22,6 +22,7 @@ function ff() { //// [controlFlowIteration.js] +"use strict"; let cond; function ff() { let x; diff --git a/tests/baselines/reference/controlFlowIterationErrors.js b/tests/baselines/reference/controlFlowIterationErrors.js index 5cc7efb12392d..a7577e3a6e0d0 100644 --- a/tests/baselines/reference/controlFlowIterationErrors.js +++ b/tests/baselines/reference/controlFlowIterationErrors.js @@ -95,6 +95,7 @@ function h4() { //// [controlFlowIterationErrors.js] +"use strict"; let cond; function len(s) { return s.length; diff --git a/tests/baselines/reference/controlFlowJavascript.js b/tests/baselines/reference/controlFlowJavascript.js index 3af65f8f2d092..3183e62d66f59 100644 --- a/tests/baselines/reference/controlFlowJavascript.js +++ b/tests/baselines/reference/controlFlowJavascript.js @@ -107,6 +107,7 @@ function f10() { //// [out.js] +"use strict"; let cond = true; // CFA for 'let' and no initializer function f1() { diff --git a/tests/baselines/reference/controlFlowJavascript.types b/tests/baselines/reference/controlFlowJavascript.types index 9eb2666b73f13..60076e13a4f2a 100644 --- a/tests/baselines/reference/controlFlowJavascript.types +++ b/tests/baselines/reference/controlFlowJavascript.types @@ -41,10 +41,10 @@ function f1() { > : ^^^^^^^ } const y = x; // string | number | undefined ->y : string | number -> : ^^^^^^^^^^^^^^^ ->x : string | number -> : ^^^^^^^^^^^^^^^ +>y : string | number | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>x : string | number | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ } // CFA for 'let' and 'undefined' initializer @@ -83,10 +83,10 @@ function f2() { > : ^^^^^^^ } const y = x; // string | number | undefined ->y : string | number -> : ^^^^^^^^^^^^^^^ ->x : string | number -> : ^^^^^^^^^^^^^^^ +>y : string | number | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>x : string | number | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ } // CFA for 'let' and 'null' initializer @@ -123,10 +123,10 @@ function f3() { > : ^^^^^^^ } const y = x; // string | number | null ->y : string | number -> : ^^^^^^^^^^^^^^^ ->x : string | number -> : ^^^^^^^^^^^^^^^ +>y : string | number | null +> : ^^^^^^^^^^^^^^^^^^^^^^ +>x : string | number | null +> : ^^^^^^^^^^^^^^^^^^^^^^ } // CFA for 'var' with no initializer @@ -163,10 +163,10 @@ function f5() { > : ^^^^^^^ } const y = x; // string | number | undefined ->y : string | number -> : ^^^^^^^^^^^^^^^ ->x : string | number -> : ^^^^^^^^^^^^^^^ +>y : string | number | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>x : string | number | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ } // CFA for 'var' with 'undefined' initializer @@ -205,10 +205,10 @@ function f6() { > : ^^^^^^^ } const y = x; // string | number | undefined ->y : string | number -> : ^^^^^^^^^^^^^^^ ->x : string | number -> : ^^^^^^^^^^^^^^^ +>y : string | number | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>x : string | number | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ } // CFA for 'var' with 'null' initializer @@ -245,10 +245,10 @@ function f7() { > : ^^^^^^^ } const y = x; // string | number | null ->y : string | number -> : ^^^^^^^^^^^^^^^ ->x : string | number -> : ^^^^^^^^^^^^^^^ +>y : string | number | null +> : ^^^^^^^^^^^^^^^^^^^^^^ +>x : string | number | null +> : ^^^^^^^^^^^^^^^^^^^^^^ } // No CFA for captured outer variables @@ -285,10 +285,10 @@ function f9() { > : ^^^^^^^ } const y = x; // string | number | undefined ->y : string | number -> : ^^^^^^^^^^^^^^^ ->x : string | number -> : ^^^^^^^^^^^^^^^ +>y : string | number | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>x : string | number | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ function f() { >f : () => void @@ -336,10 +336,10 @@ function f10() { > : ^^^^^^^ } const y = x; // string | number | undefined ->y : string | number -> : ^^^^^^^^^^^^^^^ ->x : string | number -> : ^^^^^^^^^^^^^^^ +>y : string | number | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>x : string | number | undefined +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ const f = () => { >f : () => void diff --git a/tests/baselines/reference/controlFlowLoopAnalysis.js b/tests/baselines/reference/controlFlowLoopAnalysis.js index 3502ae5735c60..8fb0669fbd55b 100644 --- a/tests/baselines/reference/controlFlowLoopAnalysis.js +++ b/tests/baselines/reference/controlFlowLoopAnalysis.js @@ -52,6 +52,7 @@ function mapUntilCant( //// [controlFlowLoopAnalysis.js] +"use strict"; // Repro from #8418 let cond; function foo(x) { return 1; } diff --git a/tests/baselines/reference/controlFlowNoImplicitAny.js b/tests/baselines/reference/controlFlowNoImplicitAny.js index 04c0fc583a378..1aca4085e59d0 100644 --- a/tests/baselines/reference/controlFlowNoImplicitAny.js +++ b/tests/baselines/reference/controlFlowNoImplicitAny.js @@ -130,6 +130,7 @@ function f10() { } //// [controlFlowNoImplicitAny.js] +"use strict"; // CFA for 'let' with no type annotation and initializer function f1() { let x; diff --git a/tests/baselines/reference/controlFlowOptionalChain2.js b/tests/baselines/reference/controlFlowOptionalChain2.js index 19876a6444390..7b4539381c055 100644 --- a/tests/baselines/reference/controlFlowOptionalChain2.js +++ b/tests/baselines/reference/controlFlowOptionalChain2.js @@ -108,6 +108,7 @@ function f8(x: X | N | null) { //// [controlFlowOptionalChain2.js] +"use strict"; function funcTwo(arg) { if ((arg === null || arg === void 0 ? void 0 : arg.type) === 'B') { arg; // `B` diff --git a/tests/baselines/reference/controlFlowOuterVariable.js b/tests/baselines/reference/controlFlowOuterVariable.js index 8b2fd66d72af8..a7f16f4d774ca 100644 --- a/tests/baselines/reference/controlFlowOuterVariable.js +++ b/tests/baselines/reference/controlFlowOuterVariable.js @@ -15,6 +15,7 @@ const helper = function(t: T[]) { } //// [controlFlowOuterVariable.js] +"use strict"; // Repros from #10641 const CONFIG = { foo: '', diff --git a/tests/baselines/reference/controlFlowParameter.js b/tests/baselines/reference/controlFlowParameter.js index f4b9ae5242bb4..d76c9d74051ed 100644 --- a/tests/baselines/reference/controlFlowParameter.js +++ b/tests/baselines/reference/controlFlowParameter.js @@ -36,6 +36,7 @@ function f4( //// [controlFlowParameter.js] +"use strict"; function f1(required = (() => { throw new Error("bad"); })()) { diff --git a/tests/baselines/reference/controlFlowPropertyInitializer.js b/tests/baselines/reference/controlFlowPropertyInitializer.js index 715b406c5db7c..9a8902cda9f94 100644 --- a/tests/baselines/reference/controlFlowPropertyInitializer.js +++ b/tests/baselines/reference/controlFlowPropertyInitializer.js @@ -10,6 +10,7 @@ class BestLanguage { } //// [controlFlowPropertyInitializer.js] +"use strict"; // Repro from #8967 const LANG = "Turbo Pascal"; class BestLanguage { diff --git a/tests/baselines/reference/controlFlowSuperPropertyAccess.js b/tests/baselines/reference/controlFlowSuperPropertyAccess.js index ec7a403abaf2d..10bec7b8eb096 100644 --- a/tests/baselines/reference/controlFlowSuperPropertyAccess.js +++ b/tests/baselines/reference/controlFlowSuperPropertyAccess.js @@ -12,6 +12,7 @@ class C extends B { //// [controlFlowSuperPropertyAccess.js] +"use strict"; class B { } class C extends B { diff --git a/tests/baselines/reference/controlFlowTruthiness.js b/tests/baselines/reference/controlFlowTruthiness.js index dbc86b60dc847..406f132b49ebd 100644 --- a/tests/baselines/reference/controlFlowTruthiness.js +++ b/tests/baselines/reference/controlFlowTruthiness.js @@ -98,6 +98,7 @@ function f9(x: T) { } //// [controlFlowTruthiness.js] +"use strict"; function f1() { let x = foo(); if (x) { diff --git a/tests/baselines/reference/controlFlowWhileStatement.errors.txt b/tests/baselines/reference/controlFlowWhileStatement.errors.txt index 9b3e1edcc3c3e..e13c157b88446 100644 --- a/tests/baselines/reference/controlFlowWhileStatement.errors.txt +++ b/tests/baselines/reference/controlFlowWhileStatement.errors.txt @@ -1,7 +1,8 @@ +controlFlowWhileStatement.ts(23,9): error TS2322: Type 'undefined' is not assignable to type 'string | number'. controlFlowWhileStatement.ts(81,12): error TS2365: Operator '>' cannot be applied to types 'string | number' and 'number'. -==== controlFlowWhileStatement.ts (1 errors) ==== +==== controlFlowWhileStatement.ts (2 errors) ==== let cond: boolean; function a() { let x: string | number; @@ -25,6 +26,8 @@ controlFlowWhileStatement.ts(81,12): error TS2365: Operator '>' cannot be applie while (cond) { x; // string x = undefined; + ~ +!!! error TS2322: Type 'undefined' is not assignable to type 'string | number'. if (typeof x === "string") continue; break; } diff --git a/tests/baselines/reference/controlFlowWhileStatement.js b/tests/baselines/reference/controlFlowWhileStatement.js index d2294753c7c4d..8291711b21653 100644 --- a/tests/baselines/reference/controlFlowWhileStatement.js +++ b/tests/baselines/reference/controlFlowWhileStatement.js @@ -110,6 +110,7 @@ function h3() { //// [controlFlowWhileStatement.js] +"use strict"; let cond; function a() { let x; diff --git a/tests/baselines/reference/controlFlowWhileStatement.types b/tests/baselines/reference/controlFlowWhileStatement.types index a2e4c50053d3b..28351949a96d3 100644 --- a/tests/baselines/reference/controlFlowWhileStatement.types +++ b/tests/baselines/reference/controlFlowWhileStatement.types @@ -226,8 +226,8 @@ function f() { break; } if (cond) { ->cond : true -> : ^^^^ +>cond : never +> : ^^^^^ x = true; >x = true : true @@ -286,8 +286,8 @@ function g() { break; } if (cond) { ->cond : boolean -> : ^^^^^^^ +>cond : false +> : ^^^^^ x = true; >x = true : true diff --git a/tests/baselines/reference/controlFlowWithIncompleteTypes.js b/tests/baselines/reference/controlFlowWithIncompleteTypes.js index 5c75c3407e1ed..976911524a44e 100644 --- a/tests/baselines/reference/controlFlowWithIncompleteTypes.js +++ b/tests/baselines/reference/controlFlowWithIncompleteTypes.js @@ -30,6 +30,7 @@ function foo2() { } //// [controlFlowWithIncompleteTypes.js] +"use strict"; // Repro from #11000 function foo1() { let x = 0; diff --git a/tests/baselines/reference/controlFlowWithTemplateLiterals.js b/tests/baselines/reference/controlFlowWithTemplateLiterals.js index eaacd1e252d63..5acc92745c958 100644 --- a/tests/baselines/reference/controlFlowWithTemplateLiterals.js +++ b/tests/baselines/reference/controlFlowWithTemplateLiterals.js @@ -13,6 +13,7 @@ if (`test` in obj) { //// [controlFlowWithTemplateLiterals.js] +"use strict"; if (typeof envVar === `string`) { envVar.slice(0); } diff --git a/tests/baselines/reference/convertClassExpressionToFunctionFromObjectProperty1(target=es2015).js b/tests/baselines/reference/convertClassExpressionToFunctionFromObjectProperty1(target=es2015).js index 9b4c268211123..026cdd01dbb22 100644 --- a/tests/baselines/reference/convertClassExpressionToFunctionFromObjectProperty1(target=es2015).js +++ b/tests/baselines/reference/convertClassExpressionToFunctionFromObjectProperty1(target=es2015).js @@ -243,6 +243,7 @@ foo.of = class { //// [convertClassExpressionToFunctionFromObjectProperty1.js] +"use strict"; const foo = {}; // properties foo.x = class { diff --git a/tests/baselines/reference/convertClassExpressionToFunctionFromObjectProperty1(target=es5).js b/tests/baselines/reference/convertClassExpressionToFunctionFromObjectProperty1(target=es5).js index bead9234a9195..70ea88e53f70e 100644 --- a/tests/baselines/reference/convertClassExpressionToFunctionFromObjectProperty1(target=es5).js +++ b/tests/baselines/reference/convertClassExpressionToFunctionFromObjectProperty1(target=es5).js @@ -243,6 +243,7 @@ foo.of = class { //// [convertClassExpressionToFunctionFromObjectProperty1.js] +"use strict"; var foo = {}; // properties foo.x = /** @class */ (function () { diff --git a/tests/baselines/reference/convertClassExpressionToFunctionFromObjectProperty2(target=es2015).js b/tests/baselines/reference/convertClassExpressionToFunctionFromObjectProperty2(target=es2015).js index 563abf3dc193c..51b2cf80622d7 100644 --- a/tests/baselines/reference/convertClassExpressionToFunctionFromObjectProperty2(target=es2015).js +++ b/tests/baselines/reference/convertClassExpressionToFunctionFromObjectProperty2(target=es2015).js @@ -242,6 +242,7 @@ //// [convertClassExpressionToFunctionFromObjectProperty2.js] +"use strict"; ({ x: class { constructor() { } diff --git a/tests/baselines/reference/convertClassExpressionToFunctionFromObjectProperty2(target=es5).js b/tests/baselines/reference/convertClassExpressionToFunctionFromObjectProperty2(target=es5).js index 05debaed49a89..c0b752bf1de2b 100644 --- a/tests/baselines/reference/convertClassExpressionToFunctionFromObjectProperty2(target=es5).js +++ b/tests/baselines/reference/convertClassExpressionToFunctionFromObjectProperty2(target=es5).js @@ -242,6 +242,7 @@ //// [convertClassExpressionToFunctionFromObjectProperty2.js] +"use strict"; ({ x: /** @class */ (function () { function x() { diff --git a/tests/baselines/reference/convertKeywords.js b/tests/baselines/reference/convertKeywords.js index c45d4f383a14d..22a109a40e70f 100644 --- a/tests/baselines/reference/convertKeywords.js +++ b/tests/baselines/reference/convertKeywords.js @@ -7,4 +7,5 @@ var abstract; //// [convertKeywords.js] +"use strict"; var abstract; diff --git a/tests/baselines/reference/convertKeywordsYes.errors.txt b/tests/baselines/reference/convertKeywordsYes.errors.txt index de9cad2cb2484..42978b89c9438 100644 --- a/tests/baselines/reference/convertKeywordsYes.errors.txt +++ b/tests/baselines/reference/convertKeywordsYes.errors.txt @@ -1,3 +1,30 @@ +convertKeywordsYes.ts(6,5): error TS1212: Identifier expected. 'implements' is a reserved word in strict mode. +convertKeywordsYes.ts(7,5): error TS1212: Identifier expected. 'interface' is a reserved word in strict mode. +convertKeywordsYes.ts(8,5): error TS1212: Identifier expected. 'let' is a reserved word in strict mode. +convertKeywordsYes.ts(11,5): error TS1212: Identifier expected. 'package' is a reserved word in strict mode. +convertKeywordsYes.ts(12,5): error TS1212: Identifier expected. 'private' is a reserved word in strict mode. +convertKeywordsYes.ts(13,5): error TS1212: Identifier expected. 'protected' is a reserved word in strict mode. +convertKeywordsYes.ts(14,5): error TS1212: Identifier expected. 'public' is a reserved word in strict mode. +convertKeywordsYes.ts(16,5): error TS1212: Identifier expected. 'static' is a reserved word in strict mode. +convertKeywordsYes.ts(19,5): error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. +convertKeywordsYes.ts(24,5): error TS1212: Identifier expected. 'implements' is a reserved word in strict mode. +convertKeywordsYes.ts(25,5): error TS1212: Identifier expected. 'interface' is a reserved word in strict mode. +convertKeywordsYes.ts(26,5): error TS1212: Identifier expected. 'let' is a reserved word in strict mode. +convertKeywordsYes.ts(28,5): error TS1212: Identifier expected. 'package' is a reserved word in strict mode. +convertKeywordsYes.ts(29,5): error TS1212: Identifier expected. 'private' is a reserved word in strict mode. +convertKeywordsYes.ts(30,5): error TS1212: Identifier expected. 'protected' is a reserved word in strict mode. +convertKeywordsYes.ts(31,5): error TS1212: Identifier expected. 'public' is a reserved word in strict mode. +convertKeywordsYes.ts(33,5): error TS1212: Identifier expected. 'static' is a reserved word in strict mode. +convertKeywordsYes.ts(35,5): error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. +convertKeywordsYes.ts(40,8): error TS1212: Identifier expected. 'implements' is a reserved word in strict mode. +convertKeywordsYes.ts(41,9): error TS1212: Identifier expected. 'interface' is a reserved word in strict mode. +convertKeywordsYes.ts(42,8): error TS1212: Identifier expected. 'let' is a reserved word in strict mode. +convertKeywordsYes.ts(45,8): error TS1212: Identifier expected. 'package' is a reserved word in strict mode. +convertKeywordsYes.ts(46,9): error TS1212: Identifier expected. 'private' is a reserved word in strict mode. +convertKeywordsYes.ts(47,9): error TS1212: Identifier expected. 'protected' is a reserved word in strict mode. +convertKeywordsYes.ts(48,9): error TS1212: Identifier expected. 'public' is a reserved word in strict mode. +convertKeywordsYes.ts(50,9): error TS1212: Identifier expected. 'static' is a reserved word in strict mode. +convertKeywordsYes.ts(53,8): error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. convertKeywordsYes.ts(175,12): error TS18006: Classes may not have a field named 'constructor'. convertKeywordsYes.ts(292,11): error TS1213: Identifier expected. 'implements' is a reserved word in strict mode. Class definitions are automatically in strict mode. convertKeywordsYes.ts(293,11): error TS1213: Identifier expected. 'interface' is a reserved word in strict mode. Class definitions are automatically in strict mode. @@ -10,60 +37,114 @@ convertKeywordsYes.ts(301,11): error TS1213: Identifier expected. 'static' is a convertKeywordsYes.ts(303,11): error TS1213: Identifier expected. 'yield' is a reserved word in strict mode. Class definitions are automatically in strict mode. -==== convertKeywordsYes.ts (10 errors) ==== +==== convertKeywordsYes.ts (37 errors) ==== // reserved ES5 future in strict mode var constructor = 0; var any = 0; var boolean = 0; var implements = 0; + ~~~~~~~~~~ +!!! error TS1212: Identifier expected. 'implements' is a reserved word in strict mode. var interface = 0; + ~~~~~~~~~ +!!! error TS1212: Identifier expected. 'interface' is a reserved word in strict mode. var let = 0; + ~~~ +!!! error TS1212: Identifier expected. 'let' is a reserved word in strict mode. var module = 0; var number = 0; var package = 0; + ~~~~~~~ +!!! error TS1212: Identifier expected. 'package' is a reserved word in strict mode. var private = 0; + ~~~~~~~ +!!! error TS1212: Identifier expected. 'private' is a reserved word in strict mode. var protected = 0; + ~~~~~~~~~ +!!! error TS1212: Identifier expected. 'protected' is a reserved word in strict mode. var public = 0; + ~~~~~~ +!!! error TS1212: Identifier expected. 'public' is a reserved word in strict mode. var set = 0; var static = 0; + ~~~~~~ +!!! error TS1212: Identifier expected. 'static' is a reserved word in strict mode. var string = 0; var get = 0; var yield = 0; + ~~~~~ +!!! error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. var declare = 0; function bigGeneric< constructor, implements , + ~~~~~~~~~~ +!!! error TS1212: Identifier expected. 'implements' is a reserved word in strict mode. interface , + ~~~~~~~~~ +!!! error TS1212: Identifier expected. 'interface' is a reserved word in strict mode. let, + ~~~ +!!! error TS1212: Identifier expected. 'let' is a reserved word in strict mode. module , package, + ~~~~~~~ +!!! error TS1212: Identifier expected. 'package' is a reserved word in strict mode. private , + ~~~~~~~ +!!! error TS1212: Identifier expected. 'private' is a reserved word in strict mode. protected, + ~~~~~~~~~ +!!! error TS1212: Identifier expected. 'protected' is a reserved word in strict mode. public , + ~~~~~~ +!!! error TS1212: Identifier expected. 'public' is a reserved word in strict mode. set , static , + ~~~~~~ +!!! error TS1212: Identifier expected. 'static' is a reserved word in strict mode. get , yield, + ~~~~~ +!!! error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. declare >(c: constructor, a: any, b2: boolean, i: implements , + ~~~~~~~~~~ +!!! error TS1212: Identifier expected. 'implements' is a reserved word in strict mode. i2: interface , + ~~~~~~~~~ +!!! error TS1212: Identifier expected. 'interface' is a reserved word in strict mode. l: let, + ~~~ +!!! error TS1212: Identifier expected. 'let' is a reserved word in strict mode. m: module , n: number, p: package, + ~~~~~~~ +!!! error TS1212: Identifier expected. 'package' is a reserved word in strict mode. p2: private , + ~~~~~~~ +!!! error TS1212: Identifier expected. 'private' is a reserved word in strict mode. p3: protected, + ~~~~~~~~~ +!!! error TS1212: Identifier expected. 'protected' is a reserved word in strict mode. p4: public , + ~~~~~~ +!!! error TS1212: Identifier expected. 'public' is a reserved word in strict mode. s: set , s2: static , + ~~~~~~ +!!! error TS1212: Identifier expected. 'static' is a reserved word in strict mode. s3: string, g: get , y: yield, + ~~~~~ +!!! error TS1212: Identifier expected. 'yield' is a reserved word in strict mode. d: declare ) { } var bigObject = { diff --git a/tests/baselines/reference/convertKeywordsYes.js b/tests/baselines/reference/convertKeywordsYes.js index 4eef6bc0316b2..e9f5ced54b202 100644 --- a/tests/baselines/reference/convertKeywordsYes.js +++ b/tests/baselines/reference/convertKeywordsYes.js @@ -308,6 +308,7 @@ namespace bigModule { } //// [convertKeywordsYes.js] +"use strict"; // reserved ES5 future in strict mode var constructor = 0; var any = 0; diff --git a/tests/baselines/reference/copyrightWithNewLine1.types b/tests/baselines/reference/copyrightWithNewLine1.types index 6050e1b3dc062..ca9094c070b84 100644 --- a/tests/baselines/reference/copyrightWithNewLine1.types +++ b/tests/baselines/reference/copyrightWithNewLine1.types @@ -10,10 +10,10 @@ import model = require("./greeter") > : ^^^ var el = document.getElementById('content'); ->el : HTMLElement -> : ^^^^^^^^^^^ ->document.getElementById('content') : HTMLElement -> : ^^^^^^^^^^^ +>el : HTMLElement | null +> : ^^^^^^^^^^^^^^^^^^ +>document.getElementById('content') : HTMLElement | null +> : ^^^^^^^^^^^^^^^^^^ >document.getElementById : (elementId: string) => HTMLElement | null > : ^ ^^ ^^^^^ >document : Document @@ -34,8 +34,8 @@ var greeter = new model.Greeter(el); > : ^^^ >Greeter : any > : ^^^ ->el : HTMLElement -> : ^^^^^^^^^^^ +>el : HTMLElement | null +> : ^^^^^^^^^^^^^^^^^^ /** things */ greeter.start(); diff --git a/tests/baselines/reference/copyrightWithoutNewLine1.types b/tests/baselines/reference/copyrightWithoutNewLine1.types index 20b7a0647eb13..8d784ce902056 100644 --- a/tests/baselines/reference/copyrightWithoutNewLine1.types +++ b/tests/baselines/reference/copyrightWithoutNewLine1.types @@ -9,10 +9,10 @@ import model = require("./greeter") > : ^^^ var el = document.getElementById('content'); ->el : HTMLElement -> : ^^^^^^^^^^^ ->document.getElementById('content') : HTMLElement -> : ^^^^^^^^^^^ +>el : HTMLElement | null +> : ^^^^^^^^^^^^^^^^^^ +>document.getElementById('content') : HTMLElement | null +> : ^^^^^^^^^^^^^^^^^^ >document.getElementById : (elementId: string) => HTMLElement | null > : ^ ^^ ^^^^^ >document : Document @@ -33,8 +33,8 @@ var greeter = new model.Greeter(el); > : ^^^ >Greeter : any > : ^^^ ->el : HTMLElement -> : ^^^^^^^^^^^ +>el : HTMLElement | null +> : ^^^^^^^^^^^^^^^^^^ /** things */ greeter.start(); diff --git a/tests/baselines/reference/correctOrderOfPromiseMethod.errors.txt b/tests/baselines/reference/correctOrderOfPromiseMethod.errors.txt new file mode 100644 index 0000000000000..644bed0f62fef --- /dev/null +++ b/tests/baselines/reference/correctOrderOfPromiseMethod.errors.txt @@ -0,0 +1,36 @@ +correctOrderOfPromiseMethod.ts(29,56): error TS2352: Conversion of type 'undefined' to type 'readonly ["a", "b", "c"]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. + + +==== correctOrderOfPromiseMethod.ts (1 errors) ==== + interface A { + id: string + } + + interface B { + id: string + fieldB: string + } + + async function countEverything(): Promise { + const providerA = async (): Promise => { return [] } + const providerB = async (): Promise => { return [] } + + const [resultA, resultB] = await Promise.all([ + providerA(), + providerB(), + ]); + + const dataA: A[] = resultA; + const dataB: B[] = resultB; + if (dataA && dataB) { + return dataA.length + dataB.length; + } + return 0; + } + + // #31179 + + const expected: Promise<["a", "b", "c"]> = Promise.all(undefined as readonly ["a", "b", "c"]); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2352: Conversion of type 'undefined' to type 'readonly ["a", "b", "c"]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. + \ No newline at end of file diff --git a/tests/baselines/reference/correctOrderOfPromiseMethod.js b/tests/baselines/reference/correctOrderOfPromiseMethod.js index fe9cc3a128b09..b6b857ac7be31 100644 --- a/tests/baselines/reference/correctOrderOfPromiseMethod.js +++ b/tests/baselines/reference/correctOrderOfPromiseMethod.js @@ -33,6 +33,7 @@ const expected: Promise<["a", "b", "c"]> = Promise.all(undefined as readonly ["a //// [correctOrderOfPromiseMethod.js] +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { diff --git a/tests/baselines/reference/correctOrderOfPromiseMethod.types b/tests/baselines/reference/correctOrderOfPromiseMethod.types index 2c6d644924e6e..2f29986422fa8 100644 --- a/tests/baselines/reference/correctOrderOfPromiseMethod.types +++ b/tests/baselines/reference/correctOrderOfPromiseMethod.types @@ -26,16 +26,16 @@ async function countEverything(): Promise { > : ^^^^^^ >async (): Promise => { return [] } : () => Promise > : ^^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ const providerB = async (): Promise => { return [] } >providerB : () => Promise > : ^^^^^^ >async (): Promise => { return [] } : () => Promise > : ^^^^^^ ->[] : undefined[] -> : ^^^^^^^^^^^ +>[] : never[] +> : ^^^^^^^ const [resultA, resultB] = await Promise.all([ >resultA : A[] diff --git a/tests/baselines/reference/correctlyMarkAliasAsReferences1.errors.txt b/tests/baselines/reference/correctlyMarkAliasAsReferences1.errors.txt new file mode 100644 index 0000000000000..f3189425e1b24 --- /dev/null +++ b/tests/baselines/reference/correctlyMarkAliasAsReferences1.errors.txt @@ -0,0 +1,19 @@ +0.tsx(7,21): error TS2698: Spread types may only be created from object types. + + +==== 0.tsx (1 errors) ==== + /// + /// + import * as cx from 'classnames'; + import * as React from "react"; + + let buttonProps; // any + let k = ; + +==== declaration.d.ts (0 errors) ==== + declare module "classnames"; + \ No newline at end of file diff --git a/tests/baselines/reference/correctlyMarkAliasAsReferences1.types b/tests/baselines/reference/correctlyMarkAliasAsReferences1.types index fff6b6515427f..73ab78b94ae25 100644 --- a/tests/baselines/reference/correctlyMarkAliasAsReferences1.types +++ b/tests/baselines/reference/correctlyMarkAliasAsReferences1.types @@ -5,6 +5,7 @@ /// import * as cx from 'classnames'; >cx : any +> : ^^^ import * as React from "react"; >React : typeof React @@ -12,6 +13,7 @@ import * as React from "react"; let buttonProps; // any >buttonProps : any +> : ^^^ let k = ; + +==== declaration.d.ts (0 errors) ==== + declare module "classnames"; + \ No newline at end of file diff --git a/tests/baselines/reference/correctlyMarkAliasAsReferences2.types b/tests/baselines/reference/correctlyMarkAliasAsReferences2.types index 4eb31046db991..84adbe584f6a5 100644 --- a/tests/baselines/reference/correctlyMarkAliasAsReferences2.types +++ b/tests/baselines/reference/correctlyMarkAliasAsReferences2.types @@ -5,6 +5,7 @@ /// import * as cx from 'classnames'; >cx : any +> : ^^^ import * as React from "react"; >React : typeof React @@ -32,8 +33,11 @@ let k =